package j5;

import com.martsnew.data.model.response.MovieResponse;
import com.martsnew.data.model.response.VoteResponse;
import com.martsnew.domain.model.Movie;
import com.martsnew.domain.model.Vote;
import com.martsnew.domain.type.MediaType;
import java.util.List;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class q implements p {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final l f13711a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final C1072c f13712b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final C1077h f13713c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final x f13714d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final C1073d f13715e;

    public q(l lVar, C1072c c1072c, C1077h c1077h, x xVar, C1073d c1073d) {
        P6.g.e(lVar, "genreMapper");
        P6.g.e(c1072c, "castMapper");
        P6.g.e(c1077h, "countryMapper");
        P6.g.e(xVar, "voteMapper");
        P6.g.e(c1073d, "companyMapper");
        this.f13711a = lVar;
        this.f13712b = c1072c;
        this.f13713c = c1077h;
        this.f13714d = xVar;
        this.f13715e = c1073d;
    }

    @Override // j5.p
    /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
    public final Movie a(MovieResponse movieResponse) {
        Vote voteB;
        P6.g.e(movieResponse, "dto");
        String str = movieResponse.f10861c;
        if (str == null) {
            str = "";
        }
        String strK = X6.n.K(str, "{width}x{height}", "1280x720");
        String str2 = movieResponse.f10864f;
        if (str2 == null) {
            str2 = "";
        }
        String strK2 = X6.n.K(str2, "{width}x{height}", "300x450");
        String str3 = movieResponse.f10862d;
        String str4 = str3 == null ? "" : str3;
        String str5 = movieResponse.f10863e;
        String str6 = str5 == null ? "" : str5;
        String str7 = movieResponse.f10865g;
        String str8 = str7 == null ? "" : str7;
        Integer num = movieResponse.f10866h;
        int iIntValue = num != null ? num.intValue() : 0;
        Integer num2 = movieResponse.i;
        MediaType mediaType = (num2 != null && num2.intValue() == 1) ? MediaType.f11105r : MediaType.f11106s;
        String str9 = movieResponse.f10867j;
        String str10 = str9 == null ? "" : str9;
        String str11 = movieResponse.f10868k;
        String str12 = str11 == null ? "" : str11;
        Integer num3 = movieResponse.f10869l;
        boolean z8 = num3 != null && num3.intValue() == 1;
        Integer num4 = movieResponse.f10870m;
        int iIntValue2 = num4 != null ? num4.intValue() : 0;
        Integer num5 = movieResponse.f10871n;
        int iIntValue3 = num5 != null ? num5.intValue() : 0;
        String str13 = movieResponse.f10872o;
        String str14 = str13 == null ? "" : str13;
        Double d8 = movieResponse.f10873p;
        double dDoubleValue = d8 != null ? d8.doubleValue() : 0.0d;
        Long l8 = movieResponse.f10874q;
        long jLongValue = l8 != null ? l8.longValue() : 0L;
        l lVar = this.f13711a;
        lVar.getClass();
        List listU = u0.u(lVar, movieResponse.f10875r);
        List list = movieResponse.f10877t;
        if (list == null) {
            list = B6.t.f1032q;
        }
        C1077h c1077h = this.f13713c;
        c1077h.getClass();
        List listU2 = u0.u(c1077h, list);
        C1072c c1072c = this.f13712b;
        c1072c.getClass();
        List listU3 = u0.u(c1072c, movieResponse.f10876s);
        C1073d c1073d = this.f13715e;
        c1073d.getClass();
        List listU4 = u0.u(c1073d, movieResponse.f10878u);
        VoteResponse voteResponse = movieResponse.f10880w;
        if (voteResponse != null) {
            this.f13714d.getClass();
            voteB = x.b(voteResponse);
        } else {
            voteB = null;
        }
        Vote vote = voteB;
        Integer num6 = movieResponse.f10879v;
        return new Movie(movieResponse.f10859a, strK, strK2, str4, str6, str8, iIntValue, mediaType, str10, str12, z8, iIntValue2, iIntValue3, str14, dDoubleValue, jLongValue, listU, listU2, listU3, listU4, num6 != null && num6.intValue() == 1, vote, 1048576);
    }
}
