package androidx.lifecycle; import c.q.a.k.a; import d0.z.d.m; import kotlin.coroutines.CoroutineContext; import kotlinx.coroutines.CoroutineScope; import s.a.e1; import s.a.j0; import s.a.s; import s.a.z; /* compiled from: ViewModel.kt */ public final class ViewModelKt { private static final String JOB_KEY = "androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY"; public static final CoroutineScope getViewModelScope(ViewModel viewModel) { m.checkNotNullParameter(viewModel, "$this$viewModelScope"); CoroutineScope coroutineScope = (CoroutineScope) viewModel.getTag("androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY"); if (coroutineScope != null) { return coroutineScope; } s b = a.b(null, 1); z zVar = j0.a; Object tagIfAbsent = viewModel.setTagIfAbsent("androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY", new CloseableCoroutineScope(CoroutineContext.Element.a.plus((e1) b, s.a.a.m.b.H()))); m.checkNotNullExpressionValue(tagIfAbsent, "setTagIfAbsent(\n …Main.immediate)\n )"); return (CoroutineScope) tagIfAbsent; } }