package com.ss.android.ugc.aweme.shortvideo.cut.videoedit;

import X.07U;
import X.0Bt;
import X.1Bn;
import X.C08205So;
import X.C10225a8;
import X.C10565ag;
import X.O4r;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.mediachoose.helper.MediaModel;
import com.ss.android.ugc.aweme.shortvideo.cut.model.CutVideoContext;
import com.ss.android.ugc.aweme.shortvideo.cut.model.VideoSegment;
import java.util.HashMap;
import java.util.List;

public class VideoEditViewModel extends 0Bt {
    public boolean LIZ;
    public 1Bn<Integer> LIZIZ = new 1Bn<>();
    public 1Bn<Boolean> LIZJ = new 1Bn<>();
    public 1Bn<Float> LIZLLL = new 1Bn<>();
    public 1Bn<Long> LJ = new 1Bn<>();
    public 1Bn<Void> LJFF = new 1Bn<>();
    public 1Bn<Void> LJI = new 1Bn<>();
    public 1Bn<Void> LJII = new 1Bn<>();
    public 1Bn<Void> LJIIIIZZ = new 1Bn<>();
    public 1Bn<Void> LJIIIZ = new 1Bn<>();
    public 1Bn<Void> LJIIJ = new 1Bn<>();
    public 1Bn<Void> LJIIJJI = new 1Bn<>();
    public 1Bn<Void> LJIIL = new 1Bn<>();
    public 1Bn<Float> LJIILIIL = new 1Bn<>();
    public 1Bn<07U<Integer, Integer>> LJIILJJIL = new 1Bn<>();
    public 1Bn<Void> LJIILL = new 1Bn<>();
    public 1Bn<Void> LJIILLIIL = new 1Bn<>();
    public 1Bn<VideoSegment> LJIIZILJ = new 1Bn<>();
    public 1Bn<Boolean> LJIJ = new 1Bn<>();
    public 1Bn<Void> LJIJI = new 1Bn<>();
    public 1Bn<Void> LJIJJ = new 1Bn<>();
    public 1Bn<Void> LJIJJLI = new 1Bn<>();
    public 1Bn<CutVideoContext> LJIL = new 1Bn<>();
    public HashMap<String, Integer> LJJ = new HashMap<>();
    public C10225a8 LJJI;
    public HashMap<String, Integer> LJJIFFI = new HashMap<>();

    static {
        Covode.recordClassIndex(109019);
    }

    public final void LIZ(boolean z) {
        this.LIZJ.setValue(Boolean.valueOf(z));
    }

    public final void LIZ(List<MediaModel> list) {
        CutVideoContext cutVideoContext = new CutVideoContext();
        cutVideoContext.setVideoSegmentList(C08205So.LIZIZ(list));
        cutVideoContext.totalSpeed = O4r.NORMAL.value();
        LIZ(cutVideoContext);
    }

    public final void LIZIZ() {
        this.LJFF.setValue((Object) null);
    }

    public final void LIZJ() {
        this.LJII.setValue((Object) null);
    }

    public final void LIZLLL() {
        this.LJIIJ.setValue((Object) null);
    }

    public final void LJ() {
        this.LJIJI.setValue((Object) null);
    }

    public final void LJFF() {
        this.LJIIJJI.setValue((Object) null);
    }

    public final void LJI() {
        this.LJIIL.setValue((Object) null);
    }

    public final void LJII() {
        this.LJIILL.setValue((Object) null);
    }

    public final void LJIIIIZZ() {
        this.LJIILLIIL.setValue((Object) null);
    }

    public final void LIZ() {
        this.LJI.setValue((Object) null);
    }

    public final List<VideoSegment> LJIIIZ() {
        return ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList();
    }

    public final List<VideoSegment> LJIIJ() {
        return ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList();
    }

    public final float LJIIJJI() {
        return ((CutVideoContext) this.LJIL.getValue()).totalSpeed;
    }

    public final boolean LJIIL() {
        for (VideoSegment LJFF2 : ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList()) {
            if (LJFF2.LJFF() != O4r.NORMAL.value()) {
                return true;
            }
        }
        return false;
    }

    public final boolean LJIILIIL() {
        if (!(this.LJIL.getValue() == null || ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList() == null || ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList().isEmpty())) {
            VideoSegment videoSegment = ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList().get(0);
            if (videoSegment.LJI <= 0 || videoSegment.LJII <= 0) {
                return false;
            }
            return true;
        }
        return false;
    }

    private void LIZ(CutVideoContext cutVideoContext) {
        this.LJIL.setValue(cutVideoContext);
    }

    public final void LIZIZ(float f) {
        this.LJIILIIL.setValue(Float.valueOf(f));
    }

    public final void LIZJ(float f) {
        ((CutVideoContext) this.LJIL.getValue()).totalSpeed = f;
    }

    public final void LIZ(float f) {
        this.LIZLLL.setValue(Float.valueOf(f));
    }

    public final void LIZIZ(List<VideoSegment> list) {
        CutVideoContext cutVideoContext = new CutVideoContext();
        cutVideoContext.setVideoSegmentList(list);
        cutVideoContext.totalSpeed = O4r.NORMAL.value();
        LIZ(cutVideoContext);
    }

    public final VideoSegment LIZJ(int i) {
        return ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList().get(i);
    }

    public final int LIZ(String str) {
        int i = 0;
        for (VideoSegment LIZ2 : ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList()) {
            if (LIZ2.LIZ(true).equals(str)) {
                return i;
            }
            i++;
        }
        return -1;
    }

    public final int LIZIZ(int i) {
        VideoSegment videoSegment = ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList().get(i);
        if (this.LJJIFFI.containsKey(videoSegment.LIZ(true))) {
            return this.LJJIFFI.get(videoSegment.LIZ(true)).intValue();
        }
        return 0;
    }

    public final void LIZJ(List<VideoSegment> list) {
        if (list != null && !list.isEmpty()) {
            ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList().addAll(list);
            1Bn<CutVideoContext> r1 = this.LJIL;
            r1.postValue(r1.getValue());
        }
    }

    public final void LIZ(int i) {
        this.LIZIZ.setValue(Integer.valueOf(i));
    }

    public final void LIZIZ(String str) {
        for (VideoSegment next : ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList()) {
            if (next.LIZ(true).equals(str)) {
                next.LJIIIZ = true;
                return;
            }
        }
    }

    public final void LIZ(long j) {
        this.LJ.setValue(Long.valueOf(j));
    }

    public final void LIZ(07U<Integer, Integer> r2) {
        this.LJIILJJIL.setValue(r2);
    }

    public final void LIZ(VideoSegment videoSegment) {
        this.LJIIZILJ.setValue(videoSegment);
    }

    public final void LIZ(int i, int i2) {
        this.LJJIFFI.put(((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList().get(i).LIZ(true), Integer.valueOf(i2));
    }

    public final void LIZ(C10565ag r4, int i) {
        VideoSegment videoSegment = ((CutVideoContext) this.LJIL.getValue()).getVideoSegmentList().get(i);
        videoSegment.LIZ(r4.LIZLLL);
        videoSegment.LIZ(r4.LIZ);
        videoSegment.LIZIZ(r4.LIZIZ);
        videoSegment.LJIIJ = r4.LIZJ;
        C10225a8 r0 = this.LJJI;
        if (r0 != null) {
            r0.LIZ(videoSegment);
        }
    }
}
