package tb;

import android.app.Activity;
import android.content.Intent;
import android.view.KeyEvent;
import android.view.View;
import cc.h;
import cc.i;
import cc.j;
import cc.l;
import com.google.android.gms.measurement.internal.u1;
import com.google.zxing.FormatException;
import com.google.zxing.common.CharacterSetECI;
import e.m;
import e.t0;
import ed.k;
import ed.q;
import ie.z;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import tv.danmaku.ijk.media.player.ui.IjkPlayerRuntime;
import xyz.netfly.SplashActivity;
import xyz.netfly.ui.vod_info.VodInfoActivity;
import xyz.stream.api.database.entity.ServerEntity;
import xyz.stream.api.entity.LanguageConfigEntity;
import xyz.stream.api.entity.SeasonCollectionBeaEntity;
import xyz.stream.api.viewmodel.VideoInfoViewModel;
import xyz.stream.utils.f0;
import xyz.stream.view.AppStatusManager;
import xyz.stream.view.OnItemListener;
import xyz.stream.view.UiUtils;
import xyz.stream.view.listener.OnDialogSelectListener;

/* JADX INFO: loaded from: classes.dex */
public final class d implements ed.f, OnDialogSelectListener, OnItemListener, xyz.stream.api.database.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f33019a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f33020b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Object f33021c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Object f33022d;

    public /* synthetic */ d(Object obj, Object obj2, Object obj3, int i10) {
        this.f33019a = i10;
        this.f33020b = obj;
        this.f33021c = obj2;
        this.f33022d = obj3;
    }

    public static int g(int i10, int i11, a aVar) {
        int i12 = 0;
        for (int i13 = 0; i13 < i11; i13++) {
            if (aVar.d(i10 + i13)) {
                i12 |= 1 << ((i11 - i13) - 1);
            }
        }
        return i12;
    }

    public final void a(char c6) {
        ((StringBuilder) this.f33020b).append((char) (c6 & 255));
    }

    public final void b(int i10) throws FormatException {
        e();
        CharacterSetECI characterSetECIA = CharacterSetECI.a(i10);
        if (characterSetECIA == null) {
            throw FormatException.a();
        }
        this.f33022d = Charset.forName(characterSetECIA.name());
    }

    public final String c(int i10, StringBuilder sb) throws FormatException {
        String str = null;
        while (true) {
            i iVarD = d(i10, str);
            String strA = l.a(iVarD.f4963c);
            if (strA != null) {
                sb.append(strA);
            }
            String strValueOf = iVarD.f4965e ? String.valueOf(iVarD.f4964d) : null;
            int i11 = iVarD.f32097b;
            if (i10 == i11) {
                return sb.toString();
            }
            i10 = i11;
            str = strValueOf;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:125:0x026f, code lost:
    
        if (j(((com.google.zxing.oned.rss.expanded.decoders.a) r16.f33022d).f24380a) == false) goto L127;
     */
    /* JADX WARN: Code restructure failed: missing block: B:126:0x0271, code lost:
    
        r1 = r16.f33022d;
        ((com.google.zxing.oned.rss.expanded.decoders.a) r1).f24380a += 3;
        ((com.google.zxing.oned.rss.expanded.decoders.a) r1).e();
     */
    /* JADX WARN: Code restructure failed: missing block: B:128:0x028c, code lost:
    
        if (k(((com.google.zxing.oned.rss.expanded.decoders.a) r16.f33022d).f24380a) == false) goto L134;
     */
    /* JADX WARN: Code restructure failed: missing block: B:129:0x028e, code lost:
    
        r1 = r16.f33022d;
        r3 = (com.google.zxing.oned.rss.expanded.decoders.a) r1;
        r4 = r3.f24380a;
        r5 = r4 + 5;
        r6 = ((tb.a) r16.f33021c).f33004b;
     */
    /* JADX WARN: Code restructure failed: missing block: B:130:0x029d, code lost:
    
        if (r5 >= r6) goto L132;
     */
    /* JADX WARN: Code restructure failed: missing block: B:131:0x029f, code lost:
    
        r3.f24380a = r4 + 5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:132:0x02a4, code lost:
    
        r3.f24380a = r6;
     */
    /* JADX WARN: Code restructure failed: missing block: B:133:0x02a6, code lost:
    
        ((com.google.zxing.oned.rss.expanded.decoders.a) r1).c();
     */
    /* JADX WARN: Code restructure failed: missing block: B:134:0x02ab, code lost:
    
        r1 = new e.t0(9);
     */
    /* JADX WARN: Code restructure failed: missing block: B:168:0x038f, code lost:
    
        r1 = ((com.google.zxing.oned.rss.expanded.decoders.a) r16.f33022d).f24380a;
     */
    /* JADX WARN: Code restructure failed: missing block: B:169:0x039d, code lost:
    
        if ((r1 + 1) <= ((tb.a) r16.f33021c).f33004b) goto L171;
     */
    /* JADX WARN: Code restructure failed: missing block: B:171:0x03a0, code lost:
    
        r3 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:172:0x03a1, code lost:
    
        if (r3 >= 4) goto L217;
     */
    /* JADX WARN: Code restructure failed: missing block: B:173:0x03a3, code lost:
    
        r4 = r3 + r1;
        r5 = (tb.a) r16.f33021c;
     */
    /* JADX WARN: Code restructure failed: missing block: B:174:0x03ab, code lost:
    
        if (r4 >= r5.f33004b) goto L218;
     */
    /* JADX WARN: Code restructure failed: missing block: B:176:0x03b1, code lost:
    
        if (r5.d(r4) == false) goto L178;
     */
    /* JADX WARN: Code restructure failed: missing block: B:178:0x03b4, code lost:
    
        r3 = r3 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:179:0x03b7, code lost:
    
        ((com.google.zxing.oned.rss.expanded.decoders.a) r16.f33022d).c();
        ((com.google.zxing.oned.rss.expanded.decoders.a) r16.f33022d).f24380a += 4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:180:0x03c7, code lost:
    
        r1 = new e.t0(9);
     */
    /* JADX WARN: Code restructure failed: missing block: B:46:0x00fc, code lost:
    
        if (j(((com.google.zxing.oned.rss.expanded.decoders.a) r16.f33022d).f24380a) == false) goto L48;
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x00fe, code lost:
    
        r1 = r16.f33022d;
        ((com.google.zxing.oned.rss.expanded.decoders.a) r1).f24380a += 3;
        ((com.google.zxing.oned.rss.expanded.decoders.a) r1).e();
     */
    /* JADX WARN: Code restructure failed: missing block: B:49:0x0119, code lost:
    
        if (k(((com.google.zxing.oned.rss.expanded.decoders.a) r16.f33022d).f24380a) == false) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:50:0x011b, code lost:
    
        r1 = r16.f33022d;
        r3 = (com.google.zxing.oned.rss.expanded.decoders.a) r1;
        r4 = r3.f24380a;
        r5 = r4 + 5;
        r6 = ((tb.a) r16.f33021c).f33004b;
     */
    /* JADX WARN: Code restructure failed: missing block: B:51:0x012a, code lost:
    
        if (r5 >= r6) goto L53;
     */
    /* JADX WARN: Code restructure failed: missing block: B:52:0x012c, code lost:
    
        r3.f24380a = r4 + 5;
     */
    /* JADX WARN: Code restructure failed: missing block: B:53:0x0131, code lost:
    
        r3.f24380a = r6;
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x0133, code lost:
    
        ((com.google.zxing.oned.rss.expanded.decoders.a) r1).d();
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0138, code lost:
    
        r1 = new e.t0(9);
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final i d(int i10, String str) throws FormatException {
        t0 t0Var;
        boolean z10;
        j jVar;
        t0 t0Var2;
        int iF;
        int iF2;
        int iF3;
        char c6;
        h hVar;
        h hVar2;
        int iF4;
        int iF5;
        char c10;
        h hVar3;
        h hVar4;
        ((StringBuilder) this.f33020b).setLength(0);
        if (str != null) {
            ((StringBuilder) this.f33020b).append(str);
        }
        ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a = i10;
        do {
            com.google.zxing.oned.rss.expanded.decoders.a aVar = (com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d;
            int i11 = aVar.f24380a;
            boolean z11 = true;
            int i12 = 16;
            if (aVar.a()) {
                while (true) {
                    int i13 = ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a;
                    if (i13 + 5 <= ((a) this.f33021c).f33004b && (((iF4 = f(i13, 5)) >= 5 && iF4 < 16) || (i13 + 6 <= ((a) this.f33021c).f33004b && (iF5 = f(i13, 6)) >= 16 && iF5 < 63))) {
                        int i14 = ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a;
                        int iF6 = f(i14, 5);
                        if (iF6 == 15) {
                            hVar4 = new h('$', i14 + 5);
                        } else {
                            if (iF6 < 5 || iF6 >= 15) {
                                int iF7 = f(i14, 6);
                                if (iF7 < 32 || iF7 >= 58) {
                                    switch (iF7) {
                                        case 58:
                                            c10 = '*';
                                            break;
                                        case 59:
                                            c10 = ',';
                                            break;
                                        case 60:
                                            c10 = '-';
                                            break;
                                        case 61:
                                            c10 = '.';
                                            break;
                                        case 62:
                                            c10 = '/';
                                            break;
                                        default:
                                            throw new IllegalStateException(u1.g("Decoding invalid alphanumeric value: ", iF7));
                                    }
                                    hVar3 = new h(c10, i14 + 6);
                                } else {
                                    hVar3 = new h((char) (iF7 + 33), i14 + 6);
                                }
                            } else {
                                hVar3 = new h((char) (iF6 + 43), i14 + 5);
                            }
                            hVar4 = hVar3;
                        }
                        Object obj = this.f33022d;
                        ((com.google.zxing.oned.rss.expanded.decoders.a) obj).f24380a = hVar4.f32097b;
                        char c11 = hVar4.f4962c;
                        if (c11 == '$') {
                            t0Var = new t0(new i(((com.google.zxing.oned.rss.expanded.decoders.a) obj).f24380a, ((StringBuilder) this.f33020b).toString()), z11);
                        } else {
                            ((StringBuilder) this.f33020b).append(c11);
                        }
                    }
                }
                z10 = t0Var.f25329a;
            } else if (((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).b()) {
                while (true) {
                    int i15 = ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a;
                    if (i15 + 5 <= ((a) this.f33021c).f33004b && (((iF = f(i15, 5)) >= 5 && iF < i12) || (i15 + 7 <= ((a) this.f33021c).f33004b && (((iF2 = f(i15, 7)) >= 64 && iF2 < 116) || (i15 + 8 <= ((a) this.f33021c).f33004b && (iF3 = f(i15, 8)) >= 232 && iF3 < 253))))) {
                        int i16 = ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a;
                        int iF8 = f(i16, 5);
                        if (iF8 == 15) {
                            hVar2 = new h('$', i16 + 5);
                        } else {
                            if (iF8 < 5 || iF8 >= 15) {
                                int iF9 = f(i16, 7);
                                if (iF9 >= 64 && iF9 < 90) {
                                    hVar = new h((char) (iF9 + 1), i16 + 7);
                                } else if (iF9 < 90 || iF9 >= 116) {
                                    switch (f(i16, 8)) {
                                        case 232:
                                            c6 = '!';
                                            break;
                                        case 233:
                                            c6 = '\"';
                                            break;
                                        case 234:
                                            c6 = '%';
                                            break;
                                        case 235:
                                            c6 = '&';
                                            break;
                                        case 236:
                                            c6 = '\'';
                                            break;
                                        case 237:
                                            c6 = '(';
                                            break;
                                        case 238:
                                            c6 = ')';
                                            break;
                                        case 239:
                                            c6 = '*';
                                            break;
                                        case 240:
                                            c6 = '+';
                                            break;
                                        case 241:
                                            c6 = ',';
                                            break;
                                        case 242:
                                            c6 = '-';
                                            break;
                                        case 243:
                                            c6 = '.';
                                            break;
                                        case IjkMediaMeta.FF_PROFILE_H264_HIGH_444_PREDICTIVE /* 244 */:
                                            c6 = '/';
                                            break;
                                        case 245:
                                            c6 = ':';
                                            break;
                                        case 246:
                                            c6 = ';';
                                            break;
                                        case 247:
                                            c6 = '<';
                                            break;
                                        case 248:
                                            c6 = '=';
                                            break;
                                        case 249:
                                            c6 = '>';
                                            break;
                                        case 250:
                                            c6 = '?';
                                            break;
                                        case 251:
                                            c6 = '_';
                                            break;
                                        case 252:
                                            c6 = ' ';
                                            break;
                                        default:
                                            throw FormatException.a();
                                    }
                                    hVar = new h(c6, i16 + 8);
                                } else {
                                    hVar = new h((char) (iF9 + 7), i16 + 7);
                                }
                            } else {
                                hVar = new h((char) (iF8 + 43), i16 + 5);
                            }
                            hVar2 = hVar;
                        }
                        Object obj2 = this.f33022d;
                        ((com.google.zxing.oned.rss.expanded.decoders.a) obj2).f24380a = hVar2.f32097b;
                        char c12 = hVar2.f4962c;
                        if (c12 == '$') {
                            t0Var = new t0(new i(((com.google.zxing.oned.rss.expanded.decoders.a) obj2).f24380a, ((StringBuilder) this.f33020b).toString()), z11);
                        } else {
                            ((StringBuilder) this.f33020b).append(c12);
                            i12 = 16;
                        }
                    }
                }
                z10 = t0Var.f25329a;
            } else {
                while (true) {
                    int i17 = ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a;
                    int i18 = i17 + 7;
                    int i19 = ((a) this.f33021c).f33004b;
                    if (i18 > i19) {
                        if (i17 + 4 > i19) {
                        }
                        int i20 = ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a;
                        int i21 = i20 + 7;
                        if (i21 > ((a) this.f33021c).f33004b) {
                            int iF10 = f(i20, 4);
                            jVar = iF10 == 0 ? new j(((a) this.f33021c).f33004b, 10, 10) : new j(((a) this.f33021c).f33004b, iF10 - 1, 10);
                        } else {
                            int iF11 = f(i20, 7) - 8;
                            jVar = new j(i21, iF11 / 11, iF11 % 11);
                        }
                        Object obj3 = this.f33022d;
                        ((com.google.zxing.oned.rss.expanded.decoders.a) obj3).f24380a = jVar.f32097b;
                        int i22 = jVar.f4967d;
                        int i23 = jVar.f4966c;
                        if (i23 == 10) {
                            t0Var2 = new t0(i22 == 10 ? new i(((com.google.zxing.oned.rss.expanded.decoders.a) obj3).f24380a, ((StringBuilder) this.f33020b).toString()) : new i(((com.google.zxing.oned.rss.expanded.decoders.a) obj3).f24380a, i22, ((StringBuilder) this.f33020b).toString()), z11);
                        } else {
                            ((StringBuilder) this.f33020b).append(i23);
                            if (i22 == 10) {
                                t0Var2 = new t0(new i(((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a, ((StringBuilder) this.f33020b).toString()), z11);
                            } else {
                                ((StringBuilder) this.f33020b).append(i22);
                            }
                        }
                    } else {
                        int i24 = i17;
                        while (true) {
                            int i25 = i17 + 3;
                            if (i24 < i25) {
                                if (!((a) this.f33021c).d(i24)) {
                                    i24++;
                                }
                            } else if (!((a) this.f33021c).d(i25)) {
                            }
                        }
                    }
                    z10 = t0Var.f25329a;
                }
                t0Var = t0Var2;
                z10 = t0Var.f25329a;
            }
            int i26 = ((com.google.zxing.oned.rss.expanded.decoders.a) this.f33022d).f24380a;
            if (i11 == i26 && !z10) {
            }
            i iVar = (i) t0Var.f25330b;
            return (iVar == null && iVar.f4965e) ? new i(i26, iVar.f4964d, ((StringBuilder) this.f33020b).toString()) : new i(i26, ((StringBuilder) this.f33020b).toString());
        } while (!z10);
        i iVar2 = (i) t0Var.f25330b;
        if (iVar2 == null) {
        }
    }

    public final void e() {
        Charset charset = (Charset) this.f33022d;
        Charset charset2 = StandardCharsets.ISO_8859_1;
        if (charset.equals(charset2)) {
            if (((StringBuilder) this.f33020b).length() > 0) {
                Object obj = this.f33021c;
                if (((StringBuilder) obj) == null) {
                    this.f33021c = (StringBuilder) this.f33020b;
                    this.f33020b = new StringBuilder();
                    return;
                } else {
                    ((StringBuilder) obj).append((CharSequence) this.f33020b);
                    this.f33020b = new StringBuilder();
                    return;
                }
            }
            return;
        }
        if (((StringBuilder) this.f33020b).length() > 0) {
            byte[] bytes = ((StringBuilder) this.f33020b).toString().getBytes(charset2);
            this.f33020b = new StringBuilder();
            Object obj2 = this.f33021c;
            if (((StringBuilder) obj2) == null) {
                this.f33021c = new StringBuilder(new String(bytes, (Charset) this.f33022d));
            } else {
                ((StringBuilder) obj2).append(new String(bytes, (Charset) this.f33022d));
            }
        }
    }

    public final int f(int i10, int i11) {
        return g(i10, i11, (a) this.f33021c);
    }

    @Override // xyz.stream.api.database.e
    public final void h(String str) {
        if (((xyz.stream.api.database.f) this.f33022d).f35811d + 1 >= ((List) this.f33020b).size()) {
            ((xyz.stream.api.database.e) this.f33021c).n(null, ((xyz.stream.api.database.f) this.f33022d).f35812e);
            return;
        }
        Object obj = this.f33022d;
        ((xyz.stream.api.database.f) obj).f35811d++;
        ((xyz.stream.api.database.f) this.f33022d).l((ServerEntity) ((List) this.f33020b).get(((xyz.stream.api.database.f) obj).f35811d), (List) this.f33020b, (xyz.stream.api.database.e) this.f33021c);
    }

    @Override // xyz.stream.api.database.e
    public final void i(int i10, String str) {
        if (i10 == 0) {
            return;
        }
        Object obj = this.f33022d;
        ((xyz.stream.api.database.f) obj).f35812e++;
        ((xyz.stream.api.database.e) this.f33021c).i(((xyz.stream.api.database.f) obj).f35812e, str);
    }

    public final boolean j(int i10) {
        int i11 = i10 + 3;
        if (i11 > ((a) this.f33021c).f33004b) {
            return false;
        }
        while (i10 < i11) {
            if (((a) this.f33021c).d(i10)) {
                return false;
            }
            i10++;
        }
        return true;
    }

    public final boolean k(int i10) {
        if (i10 + 1 > ((a) this.f33021c).f33004b) {
            return false;
        }
        for (int i11 = 0; i11 < 5; i11++) {
            int i12 = i11 + i10;
            Object obj = this.f33021c;
            if (i12 >= ((a) obj).f33004b) {
                return true;
            }
            if (i11 == 2) {
                if (!((a) obj).d(i10 + 2)) {
                    return false;
                }
            } else if (((a) obj).d(i12)) {
                return false;
            }
        }
        return true;
    }

    public final boolean l(int i10, int i11, int i12, int i13) {
        if (i10 < 0) {
            i10 += i12;
            i11 += 4 - ((i12 + 4) & 7);
        }
        if (i11 < 0) {
            i11 += i13;
            i10 += 4 - ((i13 + 4) & 7);
        }
        if (i10 >= i12) {
            i10 -= i12;
        }
        ((b) this.f33021c).h(i11, i10);
        return ((b) this.f33020b).b(i11, i10);
    }

    public final int m(int i10, int i11, int i12, int i13) {
        int i14 = i10 - 2;
        int i15 = i11 - 2;
        int i16 = (l(i14, i15, i12, i13) ? 1 : 0) << 1;
        int i17 = i11 - 1;
        if (l(i14, i17, i12, i13)) {
            i16 |= 1;
        }
        int i18 = i16 << 1;
        int i19 = i10 - 1;
        if (l(i19, i15, i12, i13)) {
            i18 |= 1;
        }
        int i20 = i18 << 1;
        if (l(i19, i17, i12, i13)) {
            i20 |= 1;
        }
        int i21 = i20 << 1;
        if (l(i19, i11, i12, i13)) {
            i21 |= 1;
        }
        int i22 = i21 << 1;
        if (l(i10, i15, i12, i13)) {
            i22 |= 1;
        }
        int i23 = i22 << 1;
        if (l(i10, i17, i12, i13)) {
            i23 |= 1;
        }
        int i24 = i23 << 1;
        return l(i10, i11, i12, i13) ? i24 | 1 : i24;
    }

    @Override // xyz.stream.api.database.e
    public final void n(ServerEntity serverEntity, int i10) {
        if (((xyz.stream.api.database.f) this.f33022d).f35811d + 1 >= ((List) this.f33020b).size()) {
            ((xyz.stream.api.database.e) this.f33021c).n(null, ((xyz.stream.api.database.f) this.f33022d).f35812e);
            return;
        }
        Object obj = this.f33022d;
        ((xyz.stream.api.database.f) obj).f35811d++;
        ((xyz.stream.api.database.f) this.f33022d).l((ServerEntity) ((List) this.f33020b).get(((xyz.stream.api.database.f) obj).f35811d), (List) this.f33020b, (xyz.stream.api.database.e) this.f33021c);
    }

    @Override // xyz.stream.view.listener.OnDialogSelectListener
    public final void onCancelClick() {
        super.onCancelClick();
        ((m) this.f33021c).show();
    }

    @Override // xyz.stream.view.OnItemListener
    public final void onItemClick(View view, int i10) {
        Object obj = this.f33022d;
        if (((VideoInfoViewModel) ((VodInfoActivity) obj).viewModel).episodes.f35959c == i10) {
            return;
        }
        ((VideoInfoViewModel) ((VodInfoActivity) obj).viewModel).episodes.b(i10);
        pf.b bVar = (pf.b) this.f33021c;
        int i11 = bVar.f31962b;
        bVar.f31962b = i10;
        bVar.notifyItemChanged(i11);
        bVar.notifyItemChanged(i10);
        VodInfoActivity vodInfoActivity = (VodInfoActivity) this.f33022d;
        int i12 = VodInfoActivity.V;
        vodInfoActivity.K(false, false, false);
    }

    @Override // xyz.stream.view.OnItemListener
    public final void onItemFocus(View view, int i10) {
        if (view != null) {
            UiUtils.scrollViewScrollToCenter(((z) ((VodInfoActivity) this.f33022d).binding).B, view);
        }
    }

    @Override // xyz.stream.view.OnItemListener
    public final boolean onItemKey(View view, int i10, KeyEvent keyEvent, int i11) {
        if (UiUtils.isDpadRight(i10) && keyEvent.getAction() == 0 && i11 == ((List) this.f33020b).size() - 1) {
            return true;
        }
        if (UiUtils.isDpadLeft(i10) && keyEvent.getAction() == 0 && i11 == 0) {
            return true;
        }
        if (i10 == 19 && keyEvent.getAction() == 0) {
            if (((VideoInfoViewModel) ((VodInfoActivity) this.f33022d).viewModel).episodes.f35961e.size() <= 1) {
                ((z) ((VodInfoActivity) this.f33022d).binding).f27774p.requestFocus();
                ((z) ((VodInfoActivity) this.f33022d).binding).B.o(0);
                return true;
            }
            t4.d dVarG = t4.f.x(((VideoInfoViewModel) ((VodInfoActivity) this.f33022d).viewModel).episodes.f35961e).e(new com.google.gson.internal.a(this, 24)).g();
            Object obj = (SeasonCollectionBeaEntity) ((VideoInfoViewModel) ((VodInfoActivity) this.f33022d).viewModel).episodes.f35961e.get(0);
            Object obj2 = dVarG.f32947a;
            if (obj2 != null) {
                obj = obj2;
            }
            View viewD = u1.d(((z) ((VodInfoActivity) this.f33022d).binding).f27783y, ((VideoInfoViewModel) ((VodInfoActivity) this.f33022d).viewModel).episodes.f35961e.indexOf((SeasonCollectionBeaEntity) obj));
            if (viewD != null) {
                viewD.requestFocus();
                return true;
            }
        }
        return false;
    }

    @Override // xyz.stream.view.listener.OnDialogSelectListener
    public final void onItemSelected(int i10) {
        xyz.stream.utils.e.d().getClass();
        if (xyz.stream.utils.e.e().equals(((LanguageConfigEntity) ((List) this.f33020b).get(i10)).getLanguageCode())) {
            ((m) this.f33021c).show();
            return;
        }
        f0.o().w(IjkPlayerRuntime.SP_LANGUAGE, ((LanguageConfigEntity) ((List) this.f33020b).get(i10)).getLanguageCode());
        AppStatusManager.getInstance().clearActivities();
        ua.b.f(false);
        Intent intent = new Intent((Activity) this.f33022d, (Class<?>) SplashActivity.class);
        intent.addFlags(268468224);
        ((Activity) this.f33022d).startActivity(intent);
        ((Activity) this.f33022d).finish();
    }

    @Override // ed.f
    public final void onMessage(ByteBuffer byteBuffer, ed.g gVar) {
        q qVarB = ((ed.l) this.f33022d).f25839c.b(byteBuffer);
        boolean zEquals = qVarB.f25842a.equals("listen");
        Object obj = qVarB.f25843b;
        if (zEquals) {
            ed.j jVar = new ed.j(this);
            if (((ed.j) ((AtomicReference) this.f33021c).getAndSet(jVar)) != null) {
                try {
                    ((k) this.f33020b).b();
                } catch (RuntimeException unused) {
                    String str = ((ed.l) this.f33022d).f25838b;
                }
            }
            try {
                ((k) this.f33020b).c(obj, jVar);
                gVar.reply(((ed.l) this.f33022d).f25839c.encodeSuccessEnvelope(null));
                return;
            } catch (RuntimeException e10) {
                ((AtomicReference) this.f33021c).set(null);
                ed.l lVar = (ed.l) this.f33022d;
                String str2 = lVar.f25838b;
                gVar.reply(lVar.f25839c.encodeErrorEnvelope(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR, e10.getMessage(), null));
                return;
            }
        }
        if (!qVarB.f25842a.equals("cancel")) {
            gVar.reply(null);
            return;
        }
        if (((ed.j) ((AtomicReference) this.f33021c).getAndSet(null)) == null) {
            gVar.reply(((ed.l) this.f33022d).f25839c.encodeErrorEnvelope(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR, "No active stream to cancel", null));
            return;
        }
        try {
            ((k) this.f33020b).b();
            gVar.reply(((ed.l) this.f33022d).f25839c.encodeSuccessEnvelope(null));
        } catch (RuntimeException e11) {
            ed.l lVar2 = (ed.l) this.f33022d;
            String str3 = lVar2.f25838b;
            gVar.reply(lVar2.f25839c.encodeErrorEnvelope(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR, e11.getMessage(), null));
        }
    }

    public final String toString() {
        switch (this.f33019a) {
            case 0:
                e();
                StringBuilder sb = (StringBuilder) this.f33021c;
                return sb == null ? "" : sb.toString();
            case 4:
                StringBuilder sb2 = new StringBuilder();
                Iterator it = ((List) this.f33020b).iterator();
                while (it.hasNext()) {
                    sb2.append(((kc.d) it.next()).toString());
                }
                return sb2.toString();
            default:
                return super.toString();
        }
    }

    public /* synthetic */ d(Object obj, List list, Object obj2, int i10) {
        this.f33019a = i10;
        this.f33022d = obj;
        this.f33020b = list;
        this.f33021c = obj2;
    }

    public d(jc.c[] cVarArr) {
        this.f33019a = 3;
        this.f33020b = cVarArr[0];
        this.f33021c = cVarArr[1];
        this.f33022d = cVarArr[2];
    }

    public d() {
        this.f33019a = 0;
        this.f33022d = StandardCharsets.ISO_8859_1;
        this.f33020b = new StringBuilder();
    }

    public d(b bVar) throws FormatException {
        int i10;
        int i11;
        int i12 = 1;
        this.f33019a = 1;
        int i13 = bVar.f33006b;
        if (i13 >= 8 && i13 <= 144 && (i10 = i13 & 1) == 0) {
            int i14 = bVar.f33005a;
            wb.b[] bVarArr = wb.b.f34262h;
            if (i10 == 0 && (i14 & 1) == 0) {
                wb.b[] bVarArr2 = wb.b.f34262h;
                int length = bVarArr2.length;
                int i15 = 0;
                while (i15 < length) {
                    wb.b bVar2 = bVarArr2[i15];
                    int i16 = bVar2.f34264b;
                    if (i16 == i13 && (i11 = bVar2.f34265c) == i14) {
                        this.f33022d = bVar2;
                        if (bVar.f33006b == i16) {
                            int i17 = bVar2.f34266d;
                            int i18 = i16 / i17;
                            int i19 = bVar2.f34267e;
                            int i20 = i11 / i19;
                            b bVar3 = new b(i20 * i19, i18 * i17);
                            int i21 = 0;
                            while (i21 < i18) {
                                int i22 = i21 * i17;
                                int i23 = 0;
                                while (i23 < i20) {
                                    int i24 = i23 * i19;
                                    int i25 = 0;
                                    while (i25 < i17) {
                                        int i26 = ((i17 + 2) * i21) + i12 + i25;
                                        int i27 = i22 + i25;
                                        for (int i28 = 0; i28 < i19; i28++) {
                                            if (bVar.b(((i19 + 2) * i23) + 1 + i28, i26)) {
                                                bVar3.h(i24 + i28, i27);
                                            }
                                        }
                                        i25++;
                                        i12 = 1;
                                    }
                                    i23++;
                                    i12 = 1;
                                }
                                i21++;
                                i12 = 1;
                            }
                            this.f33020b = bVar3;
                            this.f33021c = new b(bVar3.f33005a, bVar3.f33006b);
                            return;
                        }
                        throw new IllegalArgumentException("Dimension of bitMatrix must match the version size");
                    }
                    i15++;
                    i12 = 1;
                }
                throw FormatException.a();
            }
            throw FormatException.a();
        }
        throw FormatException.a();
    }

    public d(int i10) {
        this.f33019a = 0;
        this.f33022d = StandardCharsets.ISO_8859_1;
        this.f33020b = new StringBuilder(i10);
    }

    public d(a aVar) {
        this.f33019a = 2;
        this.f33022d = new com.google.zxing.oned.rss.expanded.decoders.a();
        this.f33020b = new StringBuilder();
        this.f33021c = aVar;
    }

    public d(ed.l lVar, k kVar) {
        this.f33019a = 5;
        this.f33022d = lVar;
        this.f33021c = new AtomicReference(null);
        this.f33020b = kVar;
    }
}
