package com.bytedance.ies.foundation.base;

import X.0Bt;
import X.7he;
import X.AnonymousClass4T1;
import X.AnonymousClass4T2;
import X.AnonymousClass4T3;
import X.C07702fi;
import X.C33033fT;
import X.C53284Sy;
import X.Crj;
import X.Lel;
import X.Ls2;
import X.M12;
import com.bytedance.covode.number.Covode;
import java.util.List;

public class BaseViewModel extends 0Bt {
    public final Crj configuration$delegate = 7he.LIZ(AnonymousClass4T1.LIZ);
    public volatile boolean initialized;
    public final Crj subscribeStore$delegate = 7he.LIZ(AnonymousClass4T2.LIZ);

    static {
        Covode.recordClassIndex(29402);
    }

    public final C53284Sy getConfiguration() {
        return (C53284Sy) this.configuration$delegate.getValue();
    }

    public final AnonymousClass4T3 getSubscribeStore() {
        return (AnonymousClass4T3) this.subscribeStore$delegate.getValue();
    }

    public List<C33033fT> initProcessors() {
        return Lel.INSTANCE;
    }

    public final List<C33033fT> getProcessors() {
        return getConfiguration().LIZ();
    }

    public void onCleared() {
        BaseViewModel.super.onCleared();
        C53284Sy configuration = getConfiguration();
        configuration.LIZIZ().clear();
        configuration.LIZ().clear();
    }

    public void init() {
        if (!this.initialized) {
            List<C33033fT> initProcessors = initProcessors();
            getConfiguration().LIZ().addAll(initProcessors);
            for (C33033fT r1 : initProcessors) {
                C53284Sy configuration = getConfiguration();
                M12.LIZ(configuration);
                r1.LIZJ = configuration;
            }
            this.initialized = true;
        }
    }

    public final void config(Ls2<? extends C07702fi> ls2) {
        M12.LIZ(ls2);
        getConfiguration().LIZ((C07702fi) ls2.invoke());
    }
}
