package defpackage;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/* renamed from: ᵡˉˀ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC3191 extends ˉᵜˆ {
    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public static String m7541(String str) {
        return AbstractC3761.m8385(new C4540(new C2696(3, str), new C3449(5, "    "), 2), "\n", 62);
    }

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public static String m7542(String str) {
        Comparable comparable;
        List listM5092 = AbstractC1789.m5092(str);
        ArrayList arrayList = new ArrayList();
        for (Object obj : listM5092) {
            if (!AbstractC1789.m5095((String) obj)) {
                arrayList.add(obj);
            }
        }
        ArrayList arrayList2 = new ArrayList(AbstractC3869.m8517(arrayList, 10));
        int size = arrayList.size();
        int i = 0;
        int i2 = 0;
        while (i2 < size) {
            Object obj2 = arrayList.get(i2);
            i2++;
            String str2 = (String) obj2;
            int length = str2.length();
            int length2 = 0;
            while (true) {
                if (length2 >= length) {
                    length2 = -1;
                    break;
                }
                if (!ˉˇʨ.ᵿʗᵝʽ(str2.charAt(length2))) {
                    break;
                }
                length2++;
            }
            if (length2 == -1) {
                length2 = str2.length();
            }
            arrayList2.add(Integer.valueOf(length2));
        }
        Iterator it = arrayList2.iterator();
        if (it.hasNext()) {
            comparable = (Comparable) it.next();
            while (it.hasNext()) {
                Comparable comparable2 = (Comparable) it.next();
                if (comparable.compareTo(comparable2) > 0) {
                    comparable = comparable2;
                }
            }
        } else {
            comparable = null;
        }
        Integer num = (Integer) comparable;
        int iIntValue = num != null ? num.intValue() : 0;
        int length3 = str.length();
        listM5092.size();
        int iM5908 = AbstractC2240.m5908(listM5092);
        ArrayList arrayList3 = new ArrayList();
        for (Object obj3 : listM5092) {
            int i3 = i + 1;
            if (i < 0) {
                AbstractC2240.m5909();
                throw null;
            }
            String str3 = (String) obj3;
            String strM5097 = ((i == 0 || i == iM5908) && AbstractC1789.m5095(str3)) ? null : AbstractC1789.m5097(iIntValue, str3);
            if (strM5097 != null) {
                arrayList3.add(strM5097);
            }
            i = i3;
        }
        StringBuilder sb = new StringBuilder(length3);
        AbstractC2767.m6836(arrayList3, sb, "\n", "", "", "...", null);
        return sb.toString();
    }

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public static String m7543(String str) {
        if (AbstractC1789.m5095("|")) {
            ᵹˉᵞ.ˌᵜᵹᵩ("marginPrefix must be non-blank string.");
            return null;
        }
        List listM5092 = AbstractC1789.m5092(str);
        int length = str.length();
        listM5092.size();
        int iM5908 = AbstractC2240.m5908(listM5092);
        ArrayList arrayList = new ArrayList();
        int i = 0;
        for (Object obj : listM5092) {
            int i2 = i + 1;
            if (i < 0) {
                AbstractC2240.m5909();
                throw null;
            }
            String str2 = (String) obj;
            if ((i == 0 || i == iM5908) && AbstractC1789.m5095(str2)) {
                str2 = null;
            } else {
                int length2 = str2.length();
                int i3 = 0;
                while (true) {
                    if (i3 >= length2) {
                        i3 = -1;
                        break;
                    }
                    if (!ˉˇʨ.ᵿʗᵝʽ(str2.charAt(i3))) {
                        break;
                    }
                    i3++;
                }
                String strSubstring = (i3 != -1 && str2.startsWith("|", i3)) ? str2.substring("|".length() + i3) : null;
                if (strSubstring != null) {
                    str2 = strSubstring;
                }
            }
            if (str2 != null) {
                arrayList.add(str2);
            }
            i = i2;
        }
        StringBuilder sb = new StringBuilder(length);
        AbstractC2767.m6836(arrayList, sb, "\n", "", "", "...", null);
        return sb.toString();
    }
}
