package defpackage;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* JADX INFO: renamed from: ᵩᵡˆ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3832 implements Iterable, InterfaceC2992 {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final String f14630;

    public C3832(String str) {
        if (str != null) {
            this.f14630 = str;
        } else {
            ᵕᵩʽᵲ.ᵮᵣᵗˈ("StringValue cannot be null.");
            throw null;
        }
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof C3832) {
            return this.f14630.equals(((C3832) obj).f14630);
        }
        return false;
    }

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

    @Override // java.lang.Iterable
    public final Iterator iterator() {
        return new C1660(1, this);
    }

    public final String toString() {
        String str = this.f14630;
        return AbstractC0793.m2864(new StringBuilder(str.length() + 2), "\"", str, "\"");
    }

    @Override // defpackage.InterfaceC2992
    /* JADX INFO: renamed from: ʽˈˋ */
    public final Iterator mo3181() {
        return new C1660(0, this);
    }

    @Override // defpackage.InterfaceC2992
    /* JADX INFO: renamed from: ˊᵫᵗ */
    public final Double mo3182() {
        String str = this.f14630;
        if (str.isEmpty()) {
            return Double.valueOf(0.0d);
        }
        try {
            return Double.valueOf(str);
        } catch (NumberFormatException unused) {
            return Double.valueOf(Double.NaN);
        }
    }

    @Override // defpackage.InterfaceC2992
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final Boolean mo3183() {
        return Boolean.valueOf(!this.f14630.isEmpty());
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:104:0x02e4 A[PHI: r8
      0x02e4: PHI (r8v6 boolean) = (r8v12 boolean), (r8v13 boolean), (r8v16 boolean) binds: [B:100:0x02d0, B:101:0x02d2, B:103:0x02e2] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:107:0x02ea  */
    /* JADX WARN: Removed duplicated region for block: B:109:0x02ee A[LOOP:0: B:108:0x02ec->B:109:0x02ee, LOOP_END] */
    @Override // defpackage.InterfaceC2992
    /* JADX INFO: renamed from: ᵨᵣ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final InterfaceC2992 mo2235(String str, C4055 c4055, ArrayList arrayList) {
        String str2;
        String str3;
        String strMo3185;
        int i;
        int i2;
        int i3;
        C4055 c40552;
        if ("charAt".equals(str) || "concat".equals(str) || "hasOwnProperty".equals(str) || "indexOf".equals(str) || "lastIndexOf".equals(str) || "match".equals(str) || "replace".equals(str) || "search".equals(str) || "slice".equals(str) || "split".equals(str) || "substring".equals(str) || "toLowerCase".equals(str) || "toLocaleLowerCase".equals(str) || "toString".equals(str) || "toUpperCase".equals(str) || "toLocaleUpperCase".equals(str)) {
            str2 = "hasOwnProperty";
            str3 = "trim";
        } else {
            str2 = "hasOwnProperty";
            str3 = "trim";
            if (!str3.equals(str)) {
                ᵕᵩʽᵲ.ᵮᵣᵗˈ(str.concat(" is not a String function"));
                return null;
            }
        }
        int iHashCode = str.hashCode();
        strMo3185 = "undefined";
        String str4 = this.f14630;
        z = false;
        boolean z = false;
        switch (iHashCode) {
            case -1789698943:
                String str5 = str2;
                if (str.equals(str5)) {
                    ˀᵳˎᵹ.ˌᵨʠᵫ(str5, 1, arrayList);
                    InterfaceC2992 interfaceC2992 = ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0));
                    boolean zEquals = "length".equals(interfaceC2992.mo3185());
                    C0937 c0937 = InterfaceC2992.f11523;
                    if (zEquals) {
                        return c0937;
                    }
                    double dDoubleValue = interfaceC2992.mo3182().doubleValue();
                    return (dDoubleValue != Math.floor(dDoubleValue) || (i = (int) dDoubleValue) < 0 || i >= str4.length()) ? InterfaceC2992.f11522 : c0937;
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -1776922004:
                if (str.equals("toString")) {
                    ˀᵳˎᵹ.ˌᵨʠᵫ("toString", 0, arrayList);
                    return this;
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -1464939364:
                if (str.equals("toLocaleLowerCase")) {
                    ˀᵳˎᵹ.ˌᵨʠᵫ("toLocaleLowerCase", 0, arrayList);
                    return new C3832(str4.toLowerCase());
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -1361633751:
                if (str.equals("charAt")) {
                    ˀᵳˎᵹ.ˑˊᵲ("charAt", 1, arrayList);
                    int i4 = arrayList.isEmpty() ? 0 : (int) ˀᵳˎᵹ.ˀᵭ(((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3182().doubleValue());
                    return (i4 < 0 || i4 >= str4.length()) ? InterfaceC2992.f11525 : new C3832(String.valueOf(str4.charAt(i4)));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -1354795244:
                if (str.equals("concat")) {
                    if (!arrayList.isEmpty()) {
                        StringBuilder sb = new StringBuilder(str4);
                        for (int i5 = 0; i5 < arrayList.size(); i5++) {
                            sb.append(((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(i5)).mo3185());
                        }
                        return new C3832(sb.toString());
                    }
                    return this;
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -1137582698:
                if (str.equals("toLowerCase")) {
                    ˀᵳˎᵹ.ˌᵨʠᵫ("toLowerCase", 0, arrayList);
                    return new C3832(str4.toLowerCase(Locale.ENGLISH));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -906336856:
                if (str.equals("search")) {
                    ˀᵳˎᵹ.ˑˊᵲ("search", 1, arrayList);
                    return Pattern.compile(arrayList.isEmpty() ? "undefined" : ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3185()).matcher(str4).find() ? new C4102(Double.valueOf(r0.start())) : new C4102(Double.valueOf(-1.0d));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -726908483:
                if (str.equals("toLocaleUpperCase")) {
                    ˀᵳˎᵹ.ˌᵨʠᵫ("toLocaleUpperCase", 0, arrayList);
                    return new C3832(str4.toUpperCase());
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -467511597:
                if (str.equals("lastIndexOf")) {
                    ˀᵳˎᵹ.ˑˊᵲ("lastIndexOf", 2, arrayList);
                    String strMo31852 = arrayList.size() > 0 ? ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3185() : "undefined";
                    return new C4102(Double.valueOf(str4.lastIndexOf(strMo31852, (int) (Double.isNaN(arrayList.size() < 2 ? Double.NaN : ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(1)).mo3182().doubleValue()) ? Double.POSITIVE_INFINITY : ˀᵳˎᵹ.ˀᵭ(r1)))));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case -399551817:
                if (str.equals("toUpperCase")) {
                    ˀᵳˎᵹ.ˌᵨʠᵫ("toUpperCase", 0, arrayList);
                    return new C3832(str4.toUpperCase(Locale.ENGLISH));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case 3568674:
                if (str.equals(str3)) {
                    ˀᵳˎᵹ.ˌᵨʠᵫ("toUpperCase", 0, arrayList);
                    return new C3832(str4.trim());
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case 103668165:
                if (str.equals("match")) {
                    ˀᵳˎᵹ.ˑˊᵲ("match", 1, arrayList);
                    Matcher matcher = Pattern.compile(arrayList.size() <= 0 ? "" : ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3185()).matcher(str4);
                    return matcher.find() ? new C4446(Arrays.asList(new C3832(matcher.group()))) : InterfaceC2992.f11524;
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case 109526418:
                if (str.equals("slice")) {
                    ˀᵳˎᵹ.ˑˊᵲ("slice", 2, arrayList);
                    double d = ˀᵳˎᵹ.ˀᵭ(!arrayList.isEmpty() ? ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3182().doubleValue() : 0.0d);
                    double dMax = d < 0.0d ? Math.max(((double) str4.length()) + d, 0.0d) : Math.min(d, str4.length());
                    double d2 = ˀᵳˎᵹ.ˀᵭ(arrayList.size() > 1 ? ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(1)).mo3182().doubleValue() : str4.length());
                    int i6 = (int) dMax;
                    return new C3832(str4.substring(i6, Math.max(0, ((int) (d2 < 0.0d ? Math.max(((double) str4.length()) + d2, 0.0d) : Math.min(d2, str4.length()))) - i6) + i6));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case 109648666:
                if (str.equals("split")) {
                    ˀᵳˎᵹ.ˑˊᵲ("split", 2, arrayList);
                    if (str4.length() == 0) {
                        return new C4446(Arrays.asList(this));
                    }
                    ArrayList arrayList2 = new ArrayList();
                    if (arrayList.isEmpty()) {
                        arrayList2.add(this);
                    } else {
                        String strMo31853 = ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3185();
                        long j = arrayList.size() > 1 ? ((long) ˀᵳˎᵹ.ˁˌᵩ(((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(1)).mo3182().doubleValue())) & 4294967295L : 2147483647L;
                        if (j == 0) {
                            return new C4446();
                        }
                        String[] strArrSplit = str4.split(Pattern.quote(strMo31853), ((int) j) + 1);
                        int length = strArrSplit.length;
                        if (!strMo31853.isEmpty() || length <= 0) {
                            i2 = length;
                            i3 = z;
                            if (length > j) {
                                i2--;
                            }
                            while (i3 < i2) {
                                arrayList2.add(new C3832(strArrSplit[i3]));
                                i3++;
                            }
                        } else {
                            boolean zIsEmpty = strArrSplit[0].isEmpty();
                            i2 = length - 1;
                            i3 = zIsEmpty;
                            z = zIsEmpty;
                            if (!strArrSplit[i2].isEmpty()) {
                            }
                            if (length > j) {
                            }
                            while (i3 < i2) {
                            }
                        }
                    }
                    return new C4446(arrayList2);
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case 530542161:
                if (str.equals("substring")) {
                    ˀᵳˎᵹ.ˑˊᵲ("substring", 2, arrayList);
                    int i7 = !arrayList.isEmpty() ? (int) ˀᵳˎᵹ.ˀᵭ(((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3182().doubleValue()) : 0;
                    int i8 = arrayList.size() > 1 ? (int) ˀᵳˎᵹ.ˀᵭ(((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(1)).mo3182().doubleValue()) : str4.length();
                    int iMin = Math.min(Math.max(i7, 0), str4.length());
                    int iMin2 = Math.min(Math.max(i8, 0), str4.length());
                    return new C3832(str4.substring(Math.min(iMin, iMin2), Math.max(iMin, iMin2)));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case 1094496948:
                if (str.equals("replace")) {
                    ˀᵳˎᵹ.ˑˊᵲ("replace", 2, arrayList);
                    boolean zIsEmpty2 = arrayList.isEmpty();
                    InterfaceC2992 interfaceC2992Mo1168 = InterfaceC2992.f11526;
                    if (!zIsEmpty2) {
                        strMo3185 = ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(0)).mo3185();
                        if (arrayList.size() > 1) {
                            interfaceC2992Mo1168 = ((ʽᵺᴵ) c4055.f15557).ˊᵨᵧ(c4055, (InterfaceC2992) arrayList.get(1));
                        }
                    }
                    String str6 = strMo3185;
                    int iIndexOf = str4.indexOf(str6);
                    if (iIndexOf >= 0) {
                        if (interfaceC2992Mo1168 instanceof AbstractC5350) {
                            interfaceC2992Mo1168 = ((AbstractC5350) interfaceC2992Mo1168).mo1168(c4055, Arrays.asList(new C3832(str6), new C4102(Double.valueOf(iIndexOf)), this));
                        }
                        String strSubstring = str4.substring(0, iIndexOf);
                        String strMo31854 = interfaceC2992Mo1168.mo3185();
                        String strSubstring2 = str4.substring(str6.length() + iIndexOf);
                        return new C3832(AbstractC0793.m2864(new StringBuilder(strSubstring.length() + String.valueOf(strMo31854).length() + strSubstring2.length()), strSubstring, strMo31854, strSubstring2));
                    }
                    return this;
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            case 1943291465:
                if (str.equals("indexOf")) {
                    ˀᵳˎᵹ.ˑˊᵲ("indexOf", 2, arrayList);
                    if (arrayList.size() <= 0) {
                        c40552 = c4055;
                    } else {
                        c40552 = c4055;
                        strMo3185 = ((ʽᵺᴵ) c40552.f15557).ˊᵨᵧ(c40552, (InterfaceC2992) arrayList.get(0)).mo3185();
                    }
                    return new C4102(Double.valueOf(str4.indexOf(strMo3185, (int) ˀᵳˎᵹ.ˀᵭ(arrayList.size() < 2 ? 0.0d : ((ʽᵺᴵ) c40552.f15557).ˊᵨᵧ(c40552, (InterfaceC2992) arrayList.get(1)).mo3182().doubleValue()))));
                }
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
            default:
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("Command not supported");
                return null;
        }
    }

    @Override // defpackage.InterfaceC2992
    /* JADX INFO: renamed from: ᵱᵽʡᵚ */
    public final InterfaceC2992 mo3184() {
        return new C3832(this.f14630);
    }

    @Override // defpackage.InterfaceC2992
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final String mo3185() {
        return this.f14630;
    }
}
