package com.ss.android.ugc.aweme.filter.view.internal.main;

import X.0CB;
import X.0CH;
import X.1Bn;
import X.2YN;
import X.2cN;
import X.6Is;
import X.9HM;
import X.C0547MYu;
import X.C0549MYw;
import X.C0550MYx;
import X.C0551MYy;
import X.C1084Mk3;
import X.LWx;
import X.M12;
import X.MZ7;
import X.PgX;
import X.Qx3;
import androidx.lifecycle.LiveData;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.filter.FilterBean;
import com.ss.android.ugc.tools.view.base.HumbleViewModel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public final class FilterListViewStateViewModel extends HumbleViewModel implements 6Is, C0551MYy {
    public final 1Bn<Map<FilterBean, MZ7>> LIZ = new 1Bn<>();
    public List<? extends FilterBean> LIZIZ;
    public 2cN LIZJ;
    public final 2YN<C0549MYw> LIZLLL = new C0550MYx(this);
    public final C0547MYu LJ;

    static {
        Covode.recordClassIndex(80398);
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final LiveData<Map<FilterBean, MZ7>> LIZ() {
        return this.LIZ;
    }

    public final void onCleared() {
        2cN r0 = this.LIZJ;
        if (r0 != null) {
            r0.dispose();
        }
        this.LIZJ = null;
    }

    public final void LIZ(List<? extends FilterBean> list) {
        M12.LIZ(list);
        this.LIZIZ = list;
        1Bn<Map<FilterBean, MZ7>> r5 = this.LIZ;
        LinkedHashMap linkedHashMap = new LinkedHashMap(Qx3.LIZJ(LWx.LIZ(9HM.LIZ(list, 10)), 16));
        for (T next : list) {
            linkedHashMap.put(next, this.LJ.LIZ(((FilterBean) next).getId()));
        }
        r5.setValue(linkedHashMap);
        if ((!list.isEmpty()) && !isDestroyed() && this.LIZJ == null) {
            this.LIZJ = this.LJ.LJ().LIZ(C1084Mk3.LIZ()).LIZ(this.LIZLLL, PgX.LIZLLL);
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public FilterListViewStateViewModel(0CH r2, C0547MYu mYu) {
        super(r2);
        M12.LIZ(r2, mYu);
        this.LJ = mYu;
    }
}
