package com.chartboost.sdk.impl;

import android.view.ViewGroup;
import com.chartboost.sdk.impl.u;
import com.chartboost.sdk.internal.Model.CBError;
import com.chartboost.sdk.view.CBImpressionActivity;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class y1 implements z5, h6, a6, r6 {

    /* renamed from: a  reason: collision with root package name */
    public final f6 f1876a;
    public final /* synthetic */ z5 b;
    public final /* synthetic */ h6 c;
    public final /* synthetic */ a6 d;
    public final /* synthetic */ r6 e;
    public m6 f;

    public y1(f6 impressionDependency, z5 impressionClick, h6 impressionDismiss, a6 impressionComplete, r6 impressionView) {
        Intrinsics.checkNotNullParameter(impressionDependency, "impressionDependency");
        Intrinsics.checkNotNullParameter(impressionClick, "impressionClick");
        Intrinsics.checkNotNullParameter(impressionDismiss, "impressionDismiss");
        Intrinsics.checkNotNullParameter(impressionComplete, "impressionComplete");
        Intrinsics.checkNotNullParameter(impressionView, "impressionView");
        this.f1876a = impressionDependency;
        this.b = impressionClick;
        this.c = impressionDismiss;
        this.d = impressionComplete;
        this.e = impressionView;
        this.f = m6.c;
    }

    @Override // com.chartboost.sdk.impl.z5
    public void a(String str, CBError.a error) {
        Intrinsics.checkNotNullParameter(error, "error");
        this.b.a(str, error);
    }

    @Override // com.chartboost.sdk.impl.z5
    public void b() {
        this.b.b();
    }

    @Override // com.chartboost.sdk.impl.z5
    public void c(m2 cbUrl) {
        Intrinsics.checkNotNullParameter(cbUrl, "cbUrl");
        this.b.c(cbUrl);
    }

    @Override // com.chartboost.sdk.impl.h6
    public void e() {
        this.c.e();
    }

    @Override // com.chartboost.sdk.impl.r6
    public void f() {
        this.e.f();
    }

    @Override // com.chartboost.sdk.impl.r6
    public void g() {
        this.e.g();
    }

    @Override // com.chartboost.sdk.impl.r6
    public boolean h() {
        return this.e.h();
    }

    @Override // com.chartboost.sdk.impl.r6
    public boolean i() {
        return this.e.i();
    }

    @Override // com.chartboost.sdk.impl.r6
    public void j() {
        this.e.j();
    }

    @Override // com.chartboost.sdk.impl.r6
    public boolean k() {
        return this.e.k();
    }

    @Override // com.chartboost.sdk.impl.r6
    public void l() {
        this.e.l();
    }

    @Override // com.chartboost.sdk.impl.r6
    public boolean m() {
        return this.e.m();
    }

    @Override // com.chartboost.sdk.impl.r6
    public void n() {
        this.e.n();
    }

    @Override // com.chartboost.sdk.impl.r6
    public ViewGroup o() {
        return this.e.o();
    }

    public m6 s() {
        return this.f;
    }

    @Override // com.chartboost.sdk.impl.r6
    public void a(m6 state, CBImpressionActivity activity) {
        Intrinsics.checkNotNullParameter(state, "state");
        Intrinsics.checkNotNullParameter(activity, "activity");
        this.e.a(state, activity);
    }

    public final void b(CBError.b error) {
        Intrinsics.checkNotNullParameter(error, "error");
        if (k()) {
            this.f1876a.c().p();
        } else {
            a(error);
        }
    }

    @Override // com.chartboost.sdk.impl.r6
    public void c() {
        this.e.c();
    }

    @Override // com.chartboost.sdk.impl.z5
    public void e(boolean z) {
        this.b.e(z);
    }

    @Override // com.chartboost.sdk.impl.h6
    public void f(boolean z) {
        this.c.f(z);
    }

    @Override // com.chartboost.sdk.impl.r6
    public void a(ViewGroup viewGroup) {
        this.e.a(viewGroup);
    }

    @Override // com.chartboost.sdk.impl.r6
    public void c(boolean z) {
        this.e.c(z);
    }

    @Override // com.chartboost.sdk.impl.a6
    public void a() {
        this.d.a();
    }

    @Override // com.chartboost.sdk.impl.z5
    public boolean a(Boolean bool, m6 impressionState) {
        Intrinsics.checkNotNullParameter(impressionState, "impressionState");
        return this.b.a(bool, impressionState);
    }

    @Override // com.chartboost.sdk.impl.h6
    public void a(m6 state) {
        Intrinsics.checkNotNullParameter(state, "state");
        this.c.a(state);
    }

    @Override // com.chartboost.sdk.impl.r6
    public void a(CBError.b error) {
        Intrinsics.checkNotNullParameter(error, "error");
        this.e.a(error);
    }

    @Override // com.chartboost.sdk.impl.z5
    public void a(m2 cbUrl) {
        Intrinsics.checkNotNullParameter(cbUrl, "cbUrl");
        this.b.a(cbUrl);
    }

    public final void a(List verificationScriptResourceList, Integer num) {
        Intrinsics.checkNotNullParameter(verificationScriptResourceList, "verificationScriptResourceList");
        this.f1876a.r().a(verificationScriptResourceList, num);
    }

    public final void L() {
        this.f = m6.c;
        CBError.b A = this.f1876a.r().A();
        if (A == null) {
            j();
        } else {
            b(A);
        }
    }

    public final void M() {
        a(this.f1876a.n(), Float.valueOf(this.f1876a.r().t()), Float.valueOf(this.f1876a.r().s()));
    }

    public final void I() {
        if (this.f != m6.e || k()) {
            return;
        }
        n();
        c(true);
    }

    public final void G() {
        b(this.f1876a.n(), Float.valueOf(this.f1876a.r().t()), Float.valueOf(this.f1876a.r().s()));
        b();
    }

    public final void d() {
        a(this.f);
    }

    @Override // com.chartboost.sdk.impl.r6
    public void d(boolean z) {
        this.e.d(z);
    }

    public final String t() {
        return this.f1876a.n();
    }

    public final boolean N() {
        return this.f1876a.a().c();
    }

    public final String q() {
        return this.f1876a.b().m();
    }

    public final void R() {
        this.f1876a.r().f();
    }

    public final boolean E() {
        if (this.f1876a.r().u() != null) {
            xb u = this.f1876a.r().u();
            if ((u != null ? u.getRootView() : null) != null) {
                return false;
            }
        }
        return true;
    }

    public final xb A() {
        return this.f1876a.r().u();
    }

    public final int z() {
        if (this.f1876a.r() instanceof rb) {
            return ((rb) this.f1876a.r()).G();
        }
        return -1;
    }

    public final void Q() {
        this.f1876a.r().w();
    }

    @Override // com.chartboost.sdk.impl.z5
    public void b(m2 cbUrl) {
        Intrinsics.checkNotNullParameter(cbUrl, "cbUrl");
        this.b.b(cbUrl);
    }

    public void b(m6 newState) {
        Intrinsics.checkNotNullParameter(newState, "newState");
        this.f = newState;
    }

    public final void C() {
        if (k() && Intrinsics.areEqual(this.f1876a.a(), u.c.g)) {
            B();
        }
    }

    public final void H() {
        if (this.f1876a.l().c() <= 1) {
            D();
            e6 l = this.f1876a.l();
            l.c(l.c() + 1);
        }
    }

    public final void K() {
        try {
            o2 r = this.f1876a.r();
            Intrinsics.checkNotNull(r, "null cannot be cast to non-null type com.chartboost.sdk.internal.video.VideoProtocol");
            ((rb) r).M();
        } catch (Exception e) {
            c7.b("Invalid play video command", e);
        }
    }

    public final void J() {
        try {
            o2 r = this.f1876a.r();
            Intrinsics.checkNotNull(r, "null cannot be cast to non-null type com.chartboost.sdk.internal.video.VideoProtocol");
            ((rb) r).L();
        } catch (Exception e) {
            c7.b("Invalid pause video command", e);
        }
    }

    public final void p() {
        try {
            o2 r = this.f1876a.r();
            Intrinsics.checkNotNull(r, "null cannot be cast to non-null type com.chartboost.sdk.internal.video.VideoProtocol");
            ((rb) r).E();
        } catch (Exception e) {
            c7.b("Invalid close video command", e);
        }
    }

    public final void F() {
        try {
            if (this.f1876a.r() instanceof rb) {
                ((rb) this.f1876a.r()).I();
            } else {
                this.f1876a.r().v();
                this.f1876a.r().a(fb.l);
            }
        } catch (Exception e) {
            c7.b("Invalid mute video command", e);
        }
    }

    public final void P() {
        try {
            if (this.f1876a.r() instanceof rb) {
                ((rb) this.f1876a.r()).O();
            } else {
                this.f1876a.r().D();
                this.f1876a.r().a(fb.l);
            }
        } catch (Exception e) {
            c7.b("Invalid unmute video command", e);
        }
    }

    @Override // com.chartboost.sdk.impl.r6
    public void b(boolean z) {
        this.e.b(z);
    }

    public final void O() {
        if (this.f1876a.l().d() <= 1) {
            B();
            D();
            e6 l = this.f1876a.l();
            l.d(l.d() + 1);
        }
    }

    public final String x() {
        return this.f1876a.r().o();
    }

    public final String v() {
        return this.f1876a.r().k();
    }

    public final String u() {
        return this.f1876a.r().i();
    }

    public final String y() {
        return this.f1876a.r().p();
    }

    public final String w() {
        return this.f1876a.r().m();
    }

    public final String r() {
        return this.f1876a.b().t();
    }

    public final void B() {
        if (this.f1876a.l().a() <= 1) {
            a();
            e6 l = this.f1876a.l();
            l.a(l.a() + 1);
        }
    }

    public final void D() {
        if (this.f1876a.l().b() <= 1) {
            M();
            e6 l = this.f1876a.l();
            l.b(l.b() + 1);
        }
    }

    public final void b(float f) {
        this.f1876a.r().b(f);
    }

    @Override // com.chartboost.sdk.impl.z5
    public void b(String location, Float f, Float f2) {
        Intrinsics.checkNotNullParameter(location, "location");
        this.b.b(location, f, f2);
    }

    public final void a(float f, float f2) {
        this.f1876a.r().a(f, f2);
    }

    @Override // com.chartboost.sdk.impl.a6
    public void a(String location, Float f, Float f2) {
        Intrinsics.checkNotNullParameter(location, "location");
        this.d.a(location, f, f2);
    }

    public final void a(String event) {
        List<String> list;
        Intrinsics.checkNotNullParameter(event, "event");
        if (event.length() <= 0 || (list = (List) this.f1876a.b().l().get(event)) == null) {
            return;
        }
        for (String str : list) {
            this.f1876a.r().d(str);
        }
    }

    public final void a(fb vastVideoEvent) {
        Intrinsics.checkNotNullParameter(vastVideoEvent, "vastVideoEvent");
        this.f1876a.r().a(vastVideoEvent);
    }

    public final void a(boolean z, String forceOrientation) {
        Intrinsics.checkNotNullParameter(forceOrientation, "forceOrientation");
        this.f1876a.r().a(z, forceOrientation);
    }

    public final void a(float f) {
        this.f1876a.r().a(f);
    }

    @Override // com.chartboost.sdk.impl.r6
    public void a(boolean z) {
        this.e.a(z);
    }

    public final void a(Boolean bool) {
        a(bool, this.f);
    }

    public final void a(i8 playerState) {
        Intrinsics.checkNotNullParameter(playerState, "playerState");
        this.f1876a.r().a(playerState);
    }
}
