package p000.p001.p002.p014.p015;

import ar.tvplayer.core.data.db.entities.ނ;
import ar.tvplayer.core.data.db.entities.ޤ;
import ar.tvplayer.core.data.repositories.ʳ;
import ar.tvplayer.core.data.repositories.ʹ;
import ar.tvplayer.core.data.repositories.ސ;
import ar.tvplayer.core.data.repositories.ޑ;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import p000.p001.p002.p014.p015.C1129;
import p025.p026.C1340;
import p025.p026.C1356;
import p025.p026.InterfaceC1327;
import p037.p099.C2226;
import p037.p099.C2229;
import p037.p099.InterfaceC2230;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.C6549;
import p402.InterfaceC6540;
import p402.p403.C6560;
import p402.p405.InterfaceC6575;
import p402.p405.p406.EnumC6586;
import p402.p405.p407.p408.AbstractC6597;
import p402.p405.p407.p408.InterfaceC6593;
import p402.p411.p412.InterfaceC6614;
import p402.p411.p412.InterfaceC6618;
import p402.p411.p413.AbstractC6636;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ނ.֏.֏.ނ.֏.ޓ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
@InterfaceC6593(c = "ar.tvplayer.tv.search.ui.SearchViewModel$search$1", f = "SearchViewModel.kt", l = {38}, m = "invokeSuspend")
public final class C1143 extends AbstractC6597 implements InterfaceC6618<InterfaceC1327, InterfaceC6575<? super C6549>, Object> {

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public InterfaceC1327 f4222;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public Object f4223;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public int f4224;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final /* synthetic */ C1129 f4225;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final /* synthetic */ boolean f4226;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public final /* synthetic */ String f4227;

    /* JADX INFO: renamed from: ނ.֏.֏.ނ.֏.ޓ$֏, reason: contains not printable characters */
    public static final class C1144 extends AbstractC6636 implements InterfaceC6614<List<? extends ނ>, C6549> {

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public final /* synthetic */ C2229 f4228;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C1144(C2229 c2229) {
            super(1);
            this.f4228 = c2229;
        }

        @Override // p402.p411.p412.InterfaceC6614
        /* JADX INFO: renamed from: ؠ */
        public C6549 mo1606(List<? extends ނ> list) {
            List<? extends ނ> list2 = list;
            if (list2 != null) {
                this.f4228.mo345(list2);
                return C6549.f19328;
            }
            C6635.m9824("it");
            throw null;
        }
    }

    /* JADX INFO: Add missing generic type declarations: [S] */
    /* JADX INFO: renamed from: ނ.֏.֏.ނ.֏.ޓ$ؠ, reason: contains not printable characters */
    public static final class C1145<T, S> implements InterfaceC2230<S> {
        public C1145() {
        }

        @Override // p037.p099.InterfaceC2230
        /* JADX INFO: renamed from: ֏ */
        public void mo1576(Object obj) {
            List<ނ> list = (List) obj;
            C1129 c1129 = C1143.this.f4225;
            C6635.m9823((Object) list, "it");
            c1129.m2433(list);
        }
    }

    /* JADX INFO: renamed from: ނ.֏.֏.ނ.֏.ޓ$ހ, reason: contains not printable characters */
    public static final class C1146 extends AbstractC6636 implements InterfaceC6614<List<? extends ޤ>, C6549> {

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public final /* synthetic */ C2229 f4230;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C1146(C2229 c2229) {
            super(1);
            this.f4230 = c2229;
        }

        @Override // p402.p411.p412.InterfaceC6614
        /* JADX INFO: renamed from: ؠ */
        public C6549 mo1606(List<? extends ޤ> list) {
            List<? extends ޤ> list2 = list;
            if (list2 != null) {
                this.f4230.mo345(list2);
                return C6549.f19328;
            }
            C6635.m9824("it");
            throw null;
        }
    }

    /* JADX INFO: Add missing generic type declarations: [S] */
    /* JADX INFO: renamed from: ނ.֏.֏.ނ.֏.ޓ$ށ, reason: contains not printable characters */
    public static final class C1147<T, S> implements InterfaceC2230<S> {
        public C1147() {
        }

        @Override // p037.p099.InterfaceC2230
        /* JADX INFO: renamed from: ֏ */
        public void mo1576(Object obj) {
            List list = (List) obj;
            C1129 c1129 = C1143.this.f4225;
            C6635.m9823((Object) list, "it");
            C2229<List<ނ>> c2229 = c1129.f4198;
            if (c2229 != null) {
                c1129.f4195.m4289(c2229);
            }
            C2229<List<ނ>> c22292 = new C2229<>();
            ArrayList arrayList = new ArrayList(C4303.m6985(list, 10));
            Iterator<T> it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(Long.valueOf(((ޤ) it.next()).ؠ));
            }
            HashSet hashSet = new HashSet(C4303.m7176(C4303.m6985(arrayList, 12)));
            C6560.m9776((Iterable) arrayList, hashSet);
            C4303.m7160(C1356.f4507, C1340.f4488, null, new ޑ(hashSet, new C1141(c22292), (InterfaceC6575) null), 2, null);
            c1129.f4198 = c22292;
            c1129.f4195.m4290(c22292, new C1142(c1129));
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C1143(C1129 c1129, boolean z, String str, InterfaceC6575 interfaceC6575) {
        super(2, interfaceC6575);
        this.f4225 = c1129;
        this.f4226 = z;
        this.f4227 = str;
    }

    @Override // p402.p405.p407.p408.AbstractC6589
    /* JADX INFO: renamed from: ֏ */
    public final InterfaceC6575<C6549> mo837(Object obj, InterfaceC6575<?> interfaceC6575) {
        if (interfaceC6575 == null) {
            C6635.m9824("completion");
            throw null;
        }
        C1143 c1143 = new C1143(this.f4225, this.f4226, this.f4227, interfaceC6575);
        c1143.f4222 = (InterfaceC1327) obj;
        return c1143;
    }

    @Override // p402.p411.p412.InterfaceC6618
    /* JADX INFO: renamed from: ؠ */
    public final Object mo838(InterfaceC1327 interfaceC1327, InterfaceC6575<? super C6549> interfaceC6575) {
        return ((C1143) mo837(interfaceC1327, interfaceC6575)).mo839(C6549.f19328);
    }

    @Override // p402.p405.p407.p408.AbstractC6589
    /* JADX INFO: renamed from: ށ */
    public final Object mo839(Object obj) {
        EnumC6586 enumC6586 = EnumC6586.COROUTINE_SUSPENDED;
        int i = this.f4224;
        if (i == 0) {
            C4303.m7198(obj);
            InterfaceC1327 interfaceC1327 = this.f4222;
            if (this.f4226) {
                this.f4223 = interfaceC1327;
                this.f4224 = 1;
                if (C4303.m7005(250L, this) == enumC6586) {
                    return enumC6586;
                }
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            C4303.m7198(obj);
        }
        C1129 c1129 = this.f4225;
        C2229<List<ނ>> c2229 = new C2229<>();
        String str = this.f4227;
        C1144 c1144 = new C1144(c2229);
        if (str == null) {
            C6635.m9824("_query");
            throw null;
        }
        C4303.m7160(C1356.f4507, C1340.m2665().mo2725(), null, new ސ(str, c1144, (InterfaceC6575) null), 2, null);
        c1129.f4196 = c2229;
        C1129 c11292 = this.f4225;
        C2226<C1129.C1132> c2226 = c11292.f4195;
        C2229<List<ނ>> c22292 = c11292.f4196;
        if (c22292 == null) {
            C6635.m9826("channelsLiveData");
            throw null;
        }
        c2226.m4290(c22292, new C1145());
        C1129 c11293 = this.f4225;
        C2229<List<ޤ>> c22293 = new C2229<>();
        ʳ r1 = ʳ.ނ;
        String str2 = this.f4227;
        C1146 c1146 = new C1146(c22293);
        if (str2 == null) {
            C6635.m9824("_query");
            throw null;
        }
        C4303.m7160(C1356.f4507, C1340.f4488, null, new ʹ(str2, c1146, (InterfaceC6575) null), 2, null);
        c11293.f4197 = c22293;
        C1129 c11294 = this.f4225;
        C2226<C1129.C1132> c22262 = c11294.f4195;
        C2229<List<ޤ>> c22294 = c11294.f4197;
        if (c22294 != null) {
            c22262.m4290(c22294, new C1147());
            return C6549.f19328;
        }
        C6635.m9826("programsLiveData");
        throw null;
    }
}
