package FSaI4_7.Nm6q_10;

import FSaI4_7.KNBe_11.Xgtqvk_8;
import com.wang.avi.BuildConfig;
/* compiled from: _Sequences.kt */
/* loaded from: classes.dex */
public class X6FRs_4 extends Mqv2r_3 {
    public static final <T, R> KQgRr5e_0<R> KQgRr5e_0(KQgRr5e_0<? extends T> kQgRr5e_0, FSaI4_7.Xgtqvk_8.KQgRr5e_0.KQgRr5e_0<? super T, ? extends R> kQgRr5e_02) {
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(kQgRr5e_0, "$receiver");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(kQgRr5e_02, "transform");
        return new IFxWkV_5(kQgRr5e_0, kQgRr5e_02);
    }

    public static final <T, A extends Appendable> A KQgRr5e_0(KQgRr5e_0<? extends T> kQgRr5e_0, A a, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, FSaI4_7.Xgtqvk_8.KQgRr5e_0.KQgRr5e_0<? super T, ? extends CharSequence> kQgRr5e_02) {
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(kQgRr5e_0, "$receiver");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(a, "buffer");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence, "separator");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence2, "prefix");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence3, "postfix");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence4, "truncated");
        a.append(charSequence2);
        int i2 = 0;
        for (T t : kQgRr5e_0) {
            i2++;
            if (i2 > 1) {
                a.append(charSequence);
            }
            if (i >= 0 && i2 > i) {
                break;
            }
            Xgtqvk_8.KQgRr5e_0(a, t, kQgRr5e_02);
        }
        if (i >= 0 && i2 > i) {
            a.append(charSequence4);
        }
        a.append(charSequence3);
        return a;
    }

    public static /* bridge */ /* synthetic */ String KQgRr5e_0(KQgRr5e_0 kQgRr5e_0, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, FSaI4_7.Xgtqvk_8.KQgRr5e_0.KQgRr5e_0 kQgRr5e_02, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            charSequence = ", ";
        }
        int i3 = i2 & 2;
        CharSequence charSequence5 = BuildConfig.FLAVOR;
        CharSequence charSequence6 = i3 != 0 ? BuildConfig.FLAVOR : charSequence2;
        if ((i2 & 4) == 0) {
            charSequence5 = charSequence3;
        }
        int i4 = (i2 & 8) != 0 ? -1 : i;
        if ((i2 & 16) != 0) {
            charSequence4 = "...";
        }
        CharSequence charSequence7 = charSequence4;
        if ((i2 & 32) != 0) {
            kQgRr5e_02 = null;
        }
        return KQgRr5e_0(kQgRr5e_0, charSequence, charSequence6, charSequence5, i4, charSequence7, kQgRr5e_02);
    }

    public static final <T> String KQgRr5e_0(KQgRr5e_0<? extends T> kQgRr5e_0, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, FSaI4_7.Xgtqvk_8.KQgRr5e_0.KQgRr5e_0<? super T, ? extends CharSequence> kQgRr5e_02) {
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(kQgRr5e_0, "$receiver");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence, "separator");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence2, "prefix");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence3, "postfix");
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.QxJ9d_1(charSequence4, "truncated");
        StringBuilder sb = new StringBuilder();
        KQgRr5e_0(kQgRr5e_0, sb, charSequence, charSequence2, charSequence3, i, charSequence4, kQgRr5e_02);
        String sb2 = sb.toString();
        FSaI4_7.Xgtqvk_8.QxJ9d_1.IFxWkV_5.KQgRr5e_0((Object) sb2, "joinTo(StringBuilder(), …ed, transform).toString()");
        return sb2;
    }
}
