package defpackage;

import androidx.media3.container.NalUnitUtil;
import com.strmr.ps.data.model.ContentItem;
import defpackage.gj1;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lb34;", "Ln02;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class b34 implements n02 {
    public final i85 a;
    public final sq3 b;
    public final ng1 c;
    public final ig6 d;
    public fx4 e;
    public long f;

    public b34(i85 i85Var, sq3 sq3Var) {
        this.a = i85Var;
        this.b = sq3Var;
        m12 m12Var = sc2.a;
        qm5 qm5Var = sm5.a;
        u81 u81VarB = zd9.b();
        qm5Var.getClass();
        ng1 ng1VarA = bk1.a(gj1.b.a.c(qm5Var, u81VarB));
        this.c = ng1VarA;
        this.d = i49.a(new q07(0L, null));
        i85Var.getLifecycle().a(this);
        wj0.c(ng1VarA, null, null, new z24(this, null), 3);
    }

    public final void a(ContentItem contentItem) {
        cr4.g(contentItem, "content");
        contentItem.getTitle();
        contentItem.getId();
        fx4 fx4Var = this.e;
        if (fx4Var != null) {
            ((rx4) fx4Var).h(null);
        }
        long j = this.f + 1;
        this.f = j;
        this.d.setValue(new q07(Long.valueOf(j), contentItem));
    }

    public final void b(ContentItem contentItem) {
        cr4.g(contentItem, "content");
        fx4 fx4Var = this.e;
        if (fx4Var != null) {
            ((rx4) fx4Var).h(null);
        }
        long j = this.f + 1;
        this.f = j;
        if (j != j) {
            return;
        }
        this.e = wj0.c(this.c, null, null, new a34(this, contentItem, null), 3);
    }

    @Override // defpackage.n02
    public final void onDestroy(i85 i85Var) {
        fx4 fx4Var = this.e;
        if (fx4Var != null) {
            ((rx4) fx4Var).h(null);
        }
        bk1.b(this.c, null);
    }
}
