导航菜单

页面标题

页面副标题

Rilo v2.0.21 - BaseSheetViewModel.java 源代码

正在查看: Rilo v2.0.21 应用的 BaseSheetViewModel.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.stripe.android.paymentsheet.viewmodels;

import android.app.Application;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.SavedStateHandle;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelKt;
import com.stripe.android.core.Logger;
import com.stripe.android.link.LinkConfigurationCoordinator;
import com.stripe.android.link.ui.inline.InlineSignupViewState;
import com.stripe.android.link.ui.inline.UserInput;
import com.stripe.android.model.CreateFinancialConnectionsSessionForDeferredPaymentParams;
import com.stripe.android.model.PaymentIntent;
import com.stripe.android.model.PaymentMethod;
import com.stripe.android.model.PaymentMethodOptionsParams;
import com.stripe.android.model.SetupIntent;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.model.parsers.AccountRangeJsonParser;
import com.stripe.android.payments.paymentlauncher.PaymentResult;
import com.stripe.android.paymentsheet.LinkHandler;
import com.stripe.android.paymentsheet.PaymentOptionsItem;
import com.stripe.android.paymentsheet.PaymentOptionsState;
import com.stripe.android.paymentsheet.PaymentOptionsStateFactoryKt;
import com.stripe.android.paymentsheet.PaymentOptionsViewModel;
import com.stripe.android.paymentsheet.PaymentSheet;
import com.stripe.android.paymentsheet.PaymentSheetViewModel;
import com.stripe.android.paymentsheet.PrefsRepository;
import com.stripe.android.paymentsheet.analytics.EventReporter;
import com.stripe.android.paymentsheet.forms.FormArgumentsFactory;
import com.stripe.android.paymentsheet.injection.FormViewModelSubcomponent;
import com.stripe.android.paymentsheet.model.MandateText;
import com.stripe.android.paymentsheet.model.PaymentSelection;
import com.stripe.android.paymentsheet.model.SupportedPaymentMethodKtxKt;
import com.stripe.android.paymentsheet.navigation.PaymentSheetScreen;
import com.stripe.android.paymentsheet.paymentdatacollection.FormArguments;
import com.stripe.android.paymentsheet.repositories.CustomerRepository;
import com.stripe.android.paymentsheet.state.GooglePayState;
import com.stripe.android.paymentsheet.state.WalletsState;
import com.stripe.android.paymentsheet.ui.HeaderTextFactory;
import com.stripe.android.paymentsheet.ui.ModifiableEditPaymentMethodViewInteractor;
import com.stripe.android.paymentsheet.ui.PaymentSheetTopBarState;
import com.stripe.android.paymentsheet.ui.PaymentSheetTopBarStateFactory;
import com.stripe.android.paymentsheet.ui.PrimaryButton;
import com.stripe.android.paymentsheet.utils.StateFlowsKt;
import com.stripe.android.ui.core.Amount;
import com.stripe.android.ui.core.cbc.CardBrandChoiceEligibility;
import com.stripe.android.ui.core.forms.resources.LpmRepository;
import com.tiktok.appevents.contents.TTContentsEventConstants;
import com.truecaller.android.sdk.network.RestAdapter;
import com.twilio.audioswitch.wired.WiredHeadsetReceiverKt;
import java.io.Closeable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import javax.inject.Provider;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
import kotlin.reflect.KFunction;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowCollector;
import kotlinx.coroutines.flow.FlowKt;
import kotlinx.coroutines.flow.MutableStateFlow;
import kotlinx.coroutines.flow.SharingStarted;
import kotlinx.coroutines.flow.StateFlow;
import kotlinx.coroutines.flow.StateFlowKt;

@Metadata(d1 = {"\u0000à\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0010\n\u0002\u0010\u0003\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000f\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u001d\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0006\b \u0018\u0000 ô\u00012\u00020\u0001:\u0004ô\u0001õ\u0001B}\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\b\u001a\u00020\t\u0012\u0006\u0010\n\u001a\u00020\u000b\u0012\b\b\u0002\u0010\f\u001a\u00020\r\u0012\u0006\u0010\u000e\u001a\u00020\u000f\u0012\u0006\u0010\u0010\u001a\u00020\u0011\u0012\u0006\u0010\u0012\u001a\u00020\u0013\u0012\u0006\u0010\u0014\u001a\u00020\u0015\u0012\u0006\u0010\u0016\u001a\u00020\u0017\u0012\u0006\u0010\u0018\u001a\u00020\u0019\u0012\f\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u001c0\u001b\u0012\u0006\u0010\u001d\u001a\u00020\u001e¢\u0006\u0002\u0010\u001fJ\n\u0010§\u0001\u001a\u00030¨\u0001H&J\u0012\u0010©\u0001\u001a\u00030ª\u00012\b\u0010«\u0001\u001a\u00030\u0097\u0001J\u000f\u0010¬\u0001\u001a\b\u0012\u0004\u0012\u0002050-H&J\b\u0010\u00ad\u0001\u001a\u00030¨\u0001J\u0014\u0010®\u0001\u001a\u00030¨\u00012\b\u0010¯\u0001\u001a\u00030°\u0001H&J\u0016\u0010±\u0001\u001a\u00030¨\u00012\n\u0010\u008e\u0001\u001a\u0005\u0018\u00010\u008f\u0001H&J@\u0010²\u0001\u001a\u0004\u0018\u00010\\2\t\u0010³\u0001\u001a\u0004\u0018\u0001052\u0007\u0010´\u0001\u001a\u00020$2\u0006\u0010W\u001a\u00020X2\u0011\u0010\u0098\u0001\u001a\f\u0012\b\u0012\u00060.j\u0002`/0-H\u0002¢\u0006\u0003\u0010µ\u0001J9\u0010¶\u0001\u001a\t\u0012\u0004\u0012\u00020y0·\u00012\u0007\u0010¸\u0001\u001a\u00020y2\b\u0010¹\u0001\u001a\u00030º\u0001H\u0082@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0006\b»\u0001\u0010¼\u0001J\u0011\u0010½\u0001\u001a\u00030¨\u00012\u0007\u0010¸\u0001\u001a\u00020yJ\u001c\u0010¾\u0001\u001a\u00030¨\u00012\n\b\u0003\u0010Q\u001a\u0004\u0018\u00010\\H&¢\u0006\u0003\u0010¿\u0001J\u0016\u0010¾\u0001\u001a\u00030¨\u00012\n\b\u0002\u0010Q\u001a\u0004\u0018\u00010.H&J\u0013\u0010À\u0001\u001a\u00030¨\u00012\u0007\u0010Á\u0001\u001a\u00020mH&J\n\u0010Â\u0001\u001a\u00030¨\u0001H&J\u0014\u0010Ã\u0001\u001a\u00030¨\u00012\b\u0010Ä\u0001\u001a\u00030Å\u0001H&J\n\u0010Æ\u0001\u001a\u00030¨\u0001H\u0002J\n\u0010Ç\u0001\u001a\u00030¨\u0001H&J\u0016\u0010È\u0001\u001a\u00030¨\u00012\n\u0010É\u0001\u001a\u0005\u0018\u00010Ê\u0001H\u0002J\u001a\u0010Ë\u0001\u001a\u00020.2\u000f\u0010Ì\u0001\u001a\n\u0018\u00010.j\u0004\u0018\u0001`/H\u0002J\u0013\u0010Í\u0001\u001a\u00030¨\u00012\u0007\u0010Î\u0001\u001a\u00020.H\u0002J\u0011\u0010Ï\u0001\u001a\u00030¨\u00012\u0007\u0010¸\u0001\u001a\u00020yJ\u001e\u0010Ð\u0001\u001a\u0004\u0018\u00010m2\u0007\u0010¸\u0001\u001a\u00020yH\u0082@ø\u0001\u0002¢\u0006\u0003\u0010Ñ\u0001J/\u0010Ò\u0001\u001a\t\u0012\u0004\u0012\u00020y0·\u00012\u0007\u0010Î\u0001\u001a\u00020.H\u0082@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0006\bÓ\u0001\u0010Ô\u0001J\u0011\u0010Õ\u0001\u001a\u00030¨\u00012\u0007\u0010Ö\u0001\u001a\u00020.J\n\u0010×\u0001\u001a\u00030¨\u0001H\u0004J\n\u0010Ø\u0001\u001a\u00030¨\u0001H\u0004J\u0015\u0010Ù\u0001\u001a\u00030¨\u00012\u000b\u0010Ì\u0001\u001a\u00060.j\u0002`/J\u0012\u0010Ú\u0001\u001a\u00030¨\u00012\u0006\u0010D\u001a\u000205H\u0002J\u0019\u0010Û\u0001\u001a\u00030¨\u00012\r\u0010Ü\u0001\u001a\b\u0012\u0004\u0012\u0002050-H\u0002J\b\u0010Ý\u0001\u001a\u00030¨\u0001J\u0011\u0010Þ\u0001\u001a\u00030¨\u00012\u0007\u0010ß\u0001\u001a\u00020$J\u0015\u0010à\u0001\u001a\u00030¨\u00012\t\u0010\u0094\u0001\u001a\u0004\u0018\u00010+H\u0004J\b\u0010á\u0001\u001a\u00030¨\u0001J\u0013\u0010â\u0001\u001a\u00030¨\u00012\u0007\u0010ã\u0001\u001a\u000205H\u0002J\b\u0010ä\u0001\u001a\u00030¨\u0001J\n\u0010å\u0001\u001a\u00030¨\u0001H\u0004J\"\u0010æ\u0001\u001a\u00030¨\u00012\u0018\u0010ç\u0001\u001a\u0013\u0012\u0006\u0012\u0004\u0018\u00010G\u0012\u0006\u0012\u0004\u0018\u00010G0è\u0001J\u0015\u0010é\u0001\u001a\u00030¨\u00012\t\u0010ê\u0001\u001a\u0004\u0018\u00010GH\u0002J\u001b\u0010ë\u0001\u001a\u00030¨\u00012\b\u0010g\u001a\u0004\u0018\u00010.2\u0007\u0010ì\u0001\u001a\u00020$J\b\u0010í\u0001\u001a\u00030¨\u0001J\u0012\u0010î\u0001\u001a\u00030¨\u00012\b\u0010ï\u0001\u001a\u00030ð\u0001J\u0011\u0010ñ\u0001\u001a\u00030¨\u00012\u0007\u0010ê\u0001\u001a\u00020)J\u0014\u0010ò\u0001\u001a\u00030¨\u00012\n\u0010\u008e\u0001\u001a\u0005\u0018\u00010\u008f\u0001J\u000e\u0010ó\u0001\u001a\u00030¨\u0001*\u000205H\u0002R\u0016\u0010 \u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\"0!X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010#\u001a\b\u0012\u0004\u0012\u00020$0!X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010%\u001a\b\u0012\u0004\u0012\u00020$0!X\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010&\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010'0!X\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010(\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010)0!X\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010*\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010+0!X\u0082\u0004¢\u0006\u0002\n\u0000R\u001e\u0010,\u001a\u0012\u0012\u000e\u0012\f\u0012\b\u0012\u00060.j\u0002`/0-0!X\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u00100\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\"01X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b2\u00103R \u00104\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002050-0!X\u0084\u0004¢\u0006\b\n\u0000\u001a\u0004\b6\u00107R\u001a\u00108\u001a\b\u0012\u0004\u0012\u00020$01X\u0084\u0004¢\u0006\b\n\u0000\u001a\u0004\b9\u00103R\u001a\u0010:\u001a\u00020;X\u0084\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b<\u0010=\"\u0004\b>\u0010?R\u0014\u0010\u0004\u001a\u00020\u0005X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b@\u0010AR\u001a\u0010B\u001a\b\u0012\u0004\u0012\u00020$01X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bC\u00103R\u0017\u0010D\u001a\b\u0012\u0004\u0012\u00020501¢\u0006\b\n\u0000\u001a\u0004\bE\u00103R\u001c\u0010F\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010G0!X\u0084\u0004¢\u0006\b\n\u0000\u001a\u0004\bH\u00107R\u0016\u0010I\u001a\u0004\u0018\u00010JX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bK\u0010LR\u0014\u0010\b\u001a\u00020\tX\u0084\u0004¢\u0006\b\n\u0000\u001a\u0004\bM\u0010NR\u000e\u0010\u001d\u001a\u00020\u001eX\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010O\u001a\b\u0012\u0004\u0012\u00020$01X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bP\u00103R\u001a\u0010Q\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010.01X¦\u0004¢\u0006\u0006\u001a\u0004\bR\u00103R\u0014\u0010\u0006\u001a\u00020\u0007X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bS\u0010TR\u0017\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u001c0\u001b¢\u0006\b\n\u0000\u001a\u0004\bU\u0010VR\u001a\u0010W\u001a\b\u0012\u0004\u0012\u00020X01X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bY\u00103R\u001c\u0010Z\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\\0[X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b]\u0010^R\u000e\u0010\u0018\u001a\u00020\u0019X\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0016\u001a\u00020\u0017¢\u0006\b\n\u0000\u001a\u0004\b_\u0010`R\u0011\u0010\u0014\u001a\u00020\u0015¢\u0006\b\n\u0000\u001a\u0004\ba\u0010bR\u0014\u0010\u000e\u001a\u00020\u000fX\u0084\u0004¢\u0006\b\n\u0000\u001a\u0004\bc\u0010dR\u0011\u0010\u0010\u001a\u00020\u0011¢\u0006\b\n\u0000\u001a\u0004\be\u0010fR\u001c\u0010g\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010'01X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bh\u00103R\u0014\u0010i\u001a\u00020.X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bj\u0010kR\u001c\u0010l\u001a\u0004\u0018\u00010mX\u0084\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bn\u0010o\"\u0004\bp\u0010qR\u001a\u0010r\u001a\u0004\u0018\u00010sX¦\u000e¢\u0006\f\u001a\u0004\bt\u0010u\"\u0004\bv\u0010wR\"\u0010x\u001a\u0010\u0012\f\u0012\n\u0012\u0004\u0012\u00020y\u0018\u00010-01X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\bz\u00103R\u0017\u0010{\u001a\b\u0012\u0004\u0012\u00020|01¢\u0006\b\n\u0000\u001a\u0004\b}\u00103R\u001f\u0010~\u001a\u00020\u007f8BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b\u0082\u0001\u0010\u0083\u0001\u001a\u0006\b\u0080\u0001\u0010\u0081\u0001R\u0016\u0010\n\u001a\u00020\u000bX\u0084\u0004¢\u0006\n\n\u0000\u001a\u0006\b\u0084\u0001\u0010\u0085\u0001R\u001b\u0010\u0086\u0001\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010)01¢\u0006\t\n\u0000\u001a\u0005\b\u0087\u0001\u00103R\u001c\u0010\u0088\u0001\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010G01X¦\u0004¢\u0006\u0007\u001a\u0005\b\u0089\u0001\u00103R\u0019\u0010\u008a\u0001\u001a\b\u0012\u0004\u0012\u00020$01¢\u0006\t\n\u0000\u001a\u0005\b\u008b\u0001\u00103R\u0013\u0010\u0012\u001a\u00020\u0013¢\u0006\n\n\u0000\u001a\u0006\b\u008c\u0001\u0010\u008d\u0001R\u001f\u0010\u008e\u0001\u001a\u000b\u0012\u0007\u0012\u0005\u0018\u00010\u008f\u000101X\u0080\u0004¢\u0006\t\n\u0000\u001a\u0005\b\u0090\u0001\u00103R\u0015\u0010\u0091\u0001\u001a\u00020$X¦\u0004¢\u0006\b\u001a\u0006\b\u0092\u0001\u0010\u0093\u0001R\u001e\u0010\u0094\u0001\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010+01X\u0080\u0004¢\u0006\t\n\u0000\u001a\u0005\b\u0095\u0001\u00103R8\u0010\u0098\u0001\u001a\t\u0012\u0005\u0012\u00030\u0097\u00010-2\u000e\u0010\u0096\u0001\u001a\t\u0012\u0005\u0012\u00030\u0097\u00010-@@X\u0080\u000e¢\u0006\u0012\n\u0000\u001a\u0006\b\u0099\u0001\u0010\u009a\u0001\"\u0006\b\u009b\u0001\u0010\u009c\u0001R&\u0010\u009d\u0001\u001a\u0012\u0012\u000e\u0012\f\u0012\b\u0012\u00060.j\u0002`/0-01X\u0084\u0004¢\u0006\t\n\u0000\u001a\u0005\b\u009e\u0001\u00103R\u001a\u0010\u009f\u0001\u001a\t\u0012\u0005\u0012\u00030 \u000101¢\u0006\t\n\u0000\u001a\u0005\b¡\u0001\u00103R\u001d\u0010¢\u0001\u001a\u000b\u0012\u0007\u0012\u0005\u0018\u00010£\u000101X¦\u0004¢\u0006\u0007\u001a\u0005\b¤\u0001\u00103R\u0016\u0010\f\u001a\u00020\rX\u0084\u0004¢\u0006\n\n\u0000\u001a\u0006\b¥\u0001\u0010¦\u0001\u0082\u0002\u000f\n\u0002\b!\n\u0005\b¡\u001e0\u0001\n\u0002\b\u0019¨\u0006ö\u0001"}, d2 = {"Lcom/stripe/android/paymentsheet/viewmodels/BaseSheetViewModel;", "Landroidx/lifecycle/AndroidViewModel;", "application", "Landroid/app/Application;", "config", "Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;", "eventReporter", "Lcom/stripe/android/paymentsheet/analytics/EventReporter;", "customerRepository", "Lcom/stripe/android/paymentsheet/repositories/CustomerRepository;", "prefsRepository", "Lcom/stripe/android/paymentsheet/PrefsRepository;", "workContext", "Lkotlin/coroutines/CoroutineContext;", "logger", "Lcom/stripe/android/core/Logger;", "lpmRepository", "Lcom/stripe/android/ui/core/forms/resources/LpmRepository;", "savedStateHandle", "Landroidx/lifecycle/SavedStateHandle;", "linkHandler", "Lcom/stripe/android/paymentsheet/LinkHandler;", "linkConfigurationCoordinator", "Lcom/stripe/android/link/LinkConfigurationCoordinator;", "headerTextFactory", "Lcom/stripe/android/paymentsheet/ui/HeaderTextFactory;", "formViewModelSubComponentBuilderProvider", "Ljavax/inject/Provider;", "Lcom/stripe/android/paymentsheet/injection/FormViewModelSubcomponent$Builder;", "editInteractorFactory", "Lcom/stripe/android/paymentsheet/ui/ModifiableEditPaymentMethodViewInteractor$Factory;", "(Landroid/app/Application;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lcom/stripe/android/paymentsheet/analytics/EventReporter;Lcom/stripe/android/paymentsheet/repositories/CustomerRepository;Lcom/stripe/android/paymentsheet/PrefsRepository;Lkotlin/coroutines/CoroutineContext;Lcom/stripe/android/core/Logger;Lcom/stripe/android/ui/core/forms/resources/LpmRepository;Landroidx/lifecycle/SavedStateHandle;Lcom/stripe/android/paymentsheet/LinkHandler;Lcom/stripe/android/link/LinkConfigurationCoordinator;Lcom/stripe/android/paymentsheet/ui/HeaderTextFactory;Ljavax/inject/Provider;Lcom/stripe/android/paymentsheet/ui/ModifiableEditPaymentMethodViewInteractor$Factory;)V", "_amount", "Lkotlinx/coroutines/flow/MutableStateFlow;", "Lcom/stripe/android/ui/core/Amount;", "_contentVisible", "", "_editing", "_mandateText", "Lcom/stripe/android/paymentsheet/model/MandateText;", "_primaryButtonState", "Lcom/stripe/android/paymentsheet/ui/PrimaryButton$State;", "_stripeIntent", "Lcom/stripe/android/model/StripeIntent;", "_supportedPaymentMethodsFlow", "", "", "Lcom/stripe/android/model/PaymentMethodCode;", CreateFinancialConnectionsSessionForDeferredPaymentParams.PARAM_AMOUNT, "Lkotlinx/coroutines/flow/StateFlow;", "getAmount$paymentsheet_release", "()Lkotlinx/coroutines/flow/StateFlow;", "backStack", "Lcom/stripe/android/paymentsheet/navigation/PaymentSheetScreen;", "getBackStack", "()Lkotlinx/coroutines/flow/MutableStateFlow;", "buttonsEnabled", "getButtonsEnabled", "cbcEligibility", "Lcom/stripe/android/ui/core/cbc/CardBrandChoiceEligibility;", "getCbcEligibility", "()Lcom/stripe/android/ui/core/cbc/CardBrandChoiceEligibility;", "setCbcEligibility", "(Lcom/stripe/android/ui/core/cbc/CardBrandChoiceEligibility;)V", "getConfig$paymentsheet_release", "()Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;", "contentVisible", "getContentVisible$paymentsheet_release", "currentScreen", "getCurrentScreen", "customPrimaryButtonUiState", "Lcom/stripe/android/paymentsheet/ui/PrimaryButton$UIState;", "getCustomPrimaryButtonUiState", "customerConfig", "Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;", "getCustomerConfig$paymentsheet_release", "()Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;", "getCustomerRepository", "()Lcom/stripe/android/paymentsheet/repositories/CustomerRepository;", "editing", "getEditing$paymentsheet_release", "error", "getError", "getEventReporter$paymentsheet_release", "()Lcom/stripe/android/paymentsheet/analytics/EventReporter;", "getFormViewModelSubComponentBuilderProvider", "()Ljavax/inject/Provider;", "googlePayState", "Lcom/stripe/android/paymentsheet/state/GooglePayState;", "getGooglePayState$paymentsheet_release", "headerText", "Lkotlinx/coroutines/flow/Flow;", "", "getHeaderText$paymentsheet_release", "()Lkotlinx/coroutines/flow/Flow;", "getLinkConfigurationCoordinator", "()Lcom/stripe/android/link/LinkConfigurationCoordinator;", "getLinkHandler", "()Lcom/stripe/android/paymentsheet/LinkHandler;", "getLogger", "()Lcom/stripe/android/core/Logger;", "getLpmRepository", "()Lcom/stripe/android/ui/core/forms/resources/LpmRepository;", "mandateText", "getMandateText$paymentsheet_release", "merchantName", "getMerchantName$paymentsheet_release", "()Ljava/lang/String;", "mostRecentError", "", "getMostRecentError", "()Ljava/lang/Throwable;", "setMostRecentError", "(Ljava/lang/Throwable;)V", "newPaymentSelection", "Lcom/stripe/android/paymentsheet/model/PaymentSelection$New;", "getNewPaymentSelection", "()Lcom/stripe/android/paymentsheet/model/PaymentSelection$New;", "setNewPaymentSelection", "(Lcom/stripe/android/paymentsheet/model/PaymentSelection$New;)V", "paymentMethods", "Lcom/stripe/android/model/PaymentMethod;", "getPaymentMethods$paymentsheet_release", "paymentOptionsState", "Lcom/stripe/android/paymentsheet/PaymentOptionsState;", "getPaymentOptionsState", "paymentOptionsStateMapper", "Lcom/stripe/android/paymentsheet/viewmodels/PaymentOptionsStateMapper;", "getPaymentOptionsStateMapper", "()Lcom/stripe/android/paymentsheet/viewmodels/PaymentOptionsStateMapper;", "paymentOptionsStateMapper$delegate", "Lkotlin/Lazy;", "getPrefsRepository", "()Lcom/stripe/android/paymentsheet/PrefsRepository;", "primaryButtonState", "getPrimaryButtonState", "primaryButtonUiState", "getPrimaryButtonUiState", BaseSheetViewModel.SAVE_PROCESSING, "getProcessing", "getSavedStateHandle", "()Landroidx/lifecycle/SavedStateHandle;", BaseSheetViewModel.SAVE_SELECTION, "Lcom/stripe/android/paymentsheet/model/PaymentSelection;", "getSelection$paymentsheet_release", "shouldCompleteLinkFlowInline", "getShouldCompleteLinkFlowInline", "()Z", "stripeIntent", "getStripeIntent$paymentsheet_release", TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE, "Lcom/stripe/android/ui/core/forms/resources/LpmRepository$SupportedPaymentMethod;", "supportedPaymentMethods", "getSupportedPaymentMethods$paymentsheet_release", "()Ljava/util/List;", "setSupportedPaymentMethods$paymentsheet_release", "(Ljava/util/List;)V", "supportedPaymentMethodsFlow", "getSupportedPaymentMethodsFlow", "topBarState", "Lcom/stripe/android/paymentsheet/ui/PaymentSheetTopBarState;", "getTopBarState", "walletsState", "Lcom/stripe/android/paymentsheet/state/WalletsState;", "getWalletsState", "getWorkContext", "()Lkotlin/coroutines/CoroutineContext;", "clearErrorMessages", "", "createFormArguments", "Lcom/stripe/android/paymentsheet/paymentdatacollection/FormArguments;", "selectedItem", "determineInitialBackStack", "handleBackPressed", "handleConfirmUSBankAccount", "paymentSelection", "Lcom/stripe/android/paymentsheet/model/PaymentSelection$New$USBankAccount;", "handlePaymentMethodSelected", "mapToHeaderTextResource", "screen", "isLinkAvailable", "(Lcom/stripe/android/paymentsheet/navigation/PaymentSheetScreen;ZLcom/stripe/android/paymentsheet/state/GooglePayState;Ljava/util/List;)Ljava/lang/Integer;", "modifyCardPaymentMethod", "Lkotlin/Result;", "paymentMethod", AccountRangeJsonParser.FIELD_BRAND, "Lcom/stripe/android/model/CardBrand;", "modifyCardPaymentMethod-0E7RQCE", "(Lcom/stripe/android/model/PaymentMethod;Lcom/stripe/android/model/CardBrand;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "modifyPaymentMethod", "onError", "(Ljava/lang/Integer;)V", "onFatal", "throwable", "onFinish", "onPaymentResult", "paymentResult", "Lcom/stripe/android/payments/paymentlauncher/PaymentResult;", "onUserBack", "onUserCancel", "payWithLinkInline", "userInput", "Lcom/stripe/android/link/ui/inline/UserInput;", "providePaymentMethodName", PaymentMethodOptionsParams.Blik.PARAM_CODE, "removeDeletedPaymentMethodFromState", "paymentMethodId", "removePaymentMethod", "removePaymentMethodInEditScreen", "(Lcom/stripe/android/model/PaymentMethod;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "removePaymentMethodInternal", "removePaymentMethodInternal-gIAlu-s", "(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "reportAutofillEvent", "type", "reportConfirmButtonPressed", "reportDismiss", "reportPaymentMethodTypeSelected", "reportPaymentSheetShown", "resetTo", "screens", "resetUSBankPrimaryButton", "setContentVisible", "visible", "setStripeIntent", "toggleEditing", "transitionTo", "target", "transitionToAddPaymentScreen", "transitionToFirstScreen", "updateCustomPrimaryButtonUiState", "block", "Lkotlin/Function1;", "updateLinkPrimaryButtonUiState", WiredHeadsetReceiverKt.INTENT_STATE, "updateMandateText", "showAbove", "updatePrimaryButtonForLinkInline", "updatePrimaryButtonForLinkSignup", "viewState", "Lcom/stripe/android/link/ui/inline/InlineSignupViewState;", "updatePrimaryButtonState", "updateSelection", "onClose", "Companion", "UserErrorMessage", "paymentsheet_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public abstract class BaseSheetViewModel extends AndroidViewModel {
    public static final String SAVE_GOOGLE_PAY_STATE = "google_pay_state";
    public static final String SAVE_PAYMENT_METHODS = "customer_payment_methods";
    public static final String SAVE_PROCESSING = "processing";
    public static final String SAVE_SELECTION = "selection";
    private final MutableStateFlow<Amount> _amount;
    private final MutableStateFlow<Boolean> _contentVisible;
    private final MutableStateFlow<Boolean> _editing;
    private final MutableStateFlow<MandateText> _mandateText;
    private final MutableStateFlow<PrimaryButton.State> _primaryButtonState;
    private final MutableStateFlow<StripeIntent> _stripeIntent;
    private final MutableStateFlow<List<String>> _supportedPaymentMethodsFlow;
    private final StateFlow<Amount> amount;
    private final MutableStateFlow<List<PaymentSheetScreen>> backStack;
    private final StateFlow<Boolean> buttonsEnabled;
    private CardBrandChoiceEligibility cbcEligibility;
    private final PaymentSheet.Configuration config;
    private final StateFlow<Boolean> contentVisible;
    private final StateFlow<PaymentSheetScreen> currentScreen;
    private final MutableStateFlow<PrimaryButton.UIState> customPrimaryButtonUiState;
    private final PaymentSheet.CustomerConfiguration customerConfig;
    private final CustomerRepository customerRepository;
    private final ModifiableEditPaymentMethodViewInteractor.Factory editInteractorFactory;
    private final StateFlow<Boolean> editing;
    private final EventReporter eventReporter;
    private final Provider<FormViewModelSubcomponent.Builder> formViewModelSubComponentBuilderProvider;
    private final StateFlow<GooglePayState> googlePayState;
    private final Flow<Integer> headerText;
    private final HeaderTextFactory headerTextFactory;
    private final LinkConfigurationCoordinator linkConfigurationCoordinator;
    private final LinkHandler linkHandler;
    private final Logger logger;
    private final LpmRepository lpmRepository;
    private final StateFlow<MandateText> mandateText;
    private final String merchantName;
    private Throwable mostRecentError;
    private final StateFlow<List<PaymentMethod>> paymentMethods;
    private final StateFlow<PaymentOptionsState> paymentOptionsState;

    private final Lazy paymentOptionsStateMapper;
    private final PrefsRepository prefsRepository;
    private final StateFlow<PrimaryButton.State> primaryButtonState;
    private final StateFlow<Boolean> processing;
    private final SavedStateHandle savedStateHandle;
    private final StateFlow<PaymentSelection> selection;
    private final StateFlow<StripeIntent> stripeIntent;
    private List<LpmRepository.SupportedPaymentMethod> supportedPaymentMethods;
    private final StateFlow<List<String>> supportedPaymentMethodsFlow;
    private final StateFlow<PaymentSheetTopBarState> topBarState;
    private final CoroutineContext workContext;

    public abstract void clearErrorMessages();

    public abstract List<PaymentSheetScreen> determineInitialBackStack();

    public abstract StateFlow<String> getError();

    public abstract PaymentSelection.New getNewPaymentSelection();

    public abstract StateFlow<PrimaryButton.UIState> getPrimaryButtonUiState();

    public abstract boolean getShouldCompleteLinkFlowInline();

    public abstract StateFlow<WalletsState> getWalletsState();

    public abstract void handleConfirmUSBankAccount(PaymentSelection.New.USBankAccount paymentSelection);

    public abstract void handlePaymentMethodSelected(PaymentSelection selection);

    public abstract void onError(Integer error);

    public abstract void onError(String error);

    public abstract void onFatal(Throwable throwable);

    public abstract void onFinish();

    public abstract void onPaymentResult(PaymentResult paymentResult);

    public abstract void onUserCancel();

    public abstract void setNewPaymentSelection(PaymentSelection.New r1);

    public final PaymentSheet.Configuration getConfig() {
        return this.config;
    }

    public final EventReporter getEventReporter() {
        return this.eventReporter;
    }

    protected final CustomerRepository getCustomerRepository() {
        return this.customerRepository;
    }

    protected final PrefsRepository getPrefsRepository() {
        return this.prefsRepository;
    }

    public BaseSheetViewModel(Application application, PaymentSheet.Configuration configuration, EventReporter eventReporter, CustomerRepository customerRepository, PrefsRepository prefsRepository, CoroutineContext coroutineContext, Logger logger, LpmRepository lpmRepository, SavedStateHandle savedStateHandle, LinkHandler linkHandler, LinkConfigurationCoordinator linkConfigurationCoordinator, HeaderTextFactory headerTextFactory, Provider provider, ModifiableEditPaymentMethodViewInteractor.Factory factory, int i2, DefaultConstructorMarker defaultConstructorMarker) {
        this(application, configuration, eventReporter, customerRepository, prefsRepository, (i2 & 32) != 0 ? (CoroutineContext) Dispatchers.getIO() : coroutineContext, logger, lpmRepository, savedStateHandle, linkHandler, linkConfigurationCoordinator, headerTextFactory, provider, factory);
    }

    protected final CoroutineContext getWorkContext() {
        return this.workContext;
    }

    protected final Logger getLogger() {
        return this.logger;
    }

    public final LpmRepository getLpmRepository() {
        return this.lpmRepository;
    }

    public final SavedStateHandle getSavedStateHandle() {
        return this.savedStateHandle;
    }

    public final LinkHandler getLinkHandler() {
        return this.linkHandler;
    }

    public final LinkConfigurationCoordinator getLinkConfigurationCoordinator() {
        return this.linkConfigurationCoordinator;
    }

    public final Provider<FormViewModelSubcomponent.Builder> getFormViewModelSubComponentBuilderProvider() {
        return this.formViewModelSubComponentBuilderProvider;
    }

    public BaseSheetViewModel(Application application, PaymentSheet.Configuration configuration, EventReporter eventReporter, CustomerRepository customerRepository, PrefsRepository prefsRepository, CoroutineContext coroutineContext, Logger logger, LpmRepository lpmRepository, SavedStateHandle savedStateHandle, LinkHandler linkHandler, LinkConfigurationCoordinator linkConfigurationCoordinator, HeaderTextFactory headerTextFactory, Provider<FormViewModelSubcomponent.Builder> provider, ModifiableEditPaymentMethodViewInteractor.Factory factory) {
        super(application);
        Intrinsics.checkNotNullParameter(application, "application");
        Intrinsics.checkNotNullParameter(configuration, "config");
        Intrinsics.checkNotNullParameter(eventReporter, "eventReporter");
        Intrinsics.checkNotNullParameter(customerRepository, "customerRepository");
        Intrinsics.checkNotNullParameter(prefsRepository, "prefsRepository");
        Intrinsics.checkNotNullParameter(coroutineContext, "workContext");
        Intrinsics.checkNotNullParameter(logger, "logger");
        Intrinsics.checkNotNullParameter(lpmRepository, "lpmRepository");
        Intrinsics.checkNotNullParameter(savedStateHandle, "savedStateHandle");
        Intrinsics.checkNotNullParameter(linkHandler, "linkHandler");
        Intrinsics.checkNotNullParameter(linkConfigurationCoordinator, "linkConfigurationCoordinator");
        Intrinsics.checkNotNullParameter(headerTextFactory, "headerTextFactory");
        Intrinsics.checkNotNullParameter(provider, "formViewModelSubComponentBuilderProvider");
        Intrinsics.checkNotNullParameter(factory, "editInteractorFactory");
        this.config = configuration;
        this.eventReporter = eventReporter;
        this.customerRepository = customerRepository;
        this.prefsRepository = prefsRepository;
        this.workContext = coroutineContext;
        this.logger = logger;
        this.lpmRepository = lpmRepository;
        this.savedStateHandle = savedStateHandle;
        this.linkHandler = linkHandler;
        this.linkConfigurationCoordinator = linkConfigurationCoordinator;
        this.headerTextFactory = headerTextFactory;
        this.formViewModelSubComponentBuilderProvider = provider;
        this.editInteractorFactory = factory;
        this.customerConfig = configuration.getCustomer();
        this.merchantName = configuration.getMerchantDisplayName();
        this.cbcEligibility = CardBrandChoiceEligibility.Ineligible.INSTANCE;
        Flow stateFlow = savedStateHandle.getStateFlow(SAVE_GOOGLE_PAY_STATE, GooglePayState.Indeterminate.INSTANCE);
        this.googlePayState = stateFlow;
        Flow MutableStateFlow = StateFlowKt.MutableStateFlow((Object) null);
        this._stripeIntent = MutableStateFlow;
        Flow flow = (StateFlow) MutableStateFlow;
        this.stripeIntent = flow;
        this.supportedPaymentMethods = CollectionsKt.emptyList();
        Flow MutableStateFlow2 = StateFlowKt.MutableStateFlow(CollectionsKt.emptyList());
        this._supportedPaymentMethodsFlow = MutableStateFlow2;
        Flow flow2 = (StateFlow) MutableStateFlow2;
        this.supportedPaymentMethodsFlow = flow2;
        Flow stateFlow2 = savedStateHandle.getStateFlow(SAVE_PAYMENT_METHODS, (Object) null);
        this.paymentMethods = stateFlow2;
        StateFlow<Amount> MutableStateFlow3 = StateFlowKt.MutableStateFlow((Object) null);
        this._amount = MutableStateFlow3;
        this.amount = MutableStateFlow3;
        Flow MutableStateFlow4 = StateFlowKt.MutableStateFlow(CollectionsKt.listOf(PaymentSheetScreen.Loading.INSTANCE));
        this.backStack = MutableStateFlow4;
        final Flow flow3 = MutableStateFlow4;
        Flow<PaymentSheetScreen> flow4 = new Flow<PaymentSheetScreen>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = flow3.collect(new AnonymousClass2(flowCollector), continuation);
                return collect == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? collect : Unit.INSTANCE;
            }

            @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0007\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032\u0006\u0010\u0004\u001a\u0002H\u0002H\u008a@¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\b"}, d2 = {"<anonymous>", "", "T", "R", TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE, "emit", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1", "kotlinx/coroutines/flow/FlowKt__TransformKt$map$$inlined$unsafeTransform$1$2"}, k = 3, mv = {1, 8, 0}, xi = 48)
            public static final class AnonymousClass2<T> implements FlowCollector {
                final FlowCollector $this_unsafeFlow;

                @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
                @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$special$$inlined$map$1$2", f = "BaseSheetViewModel.kt", i = {}, l = {223}, m = "emit", n = {}, s = {})
                public static final class AnonymousClass1 extends ContinuationImpl {
                    Object L$0;
                    int label;
                    Object result;

                    public AnonymousClass1(Continuation continuation) {
                        super(continuation);
                    }

                    public final Object invokeSuspend(Object obj) {
                        this.result = obj;
                        this.label |= Integer.MIN_VALUE;
                        return AnonymousClass2.this.emit(null, (Continuation) this);
                    }
                }

                public AnonymousClass2(FlowCollector flowCollector) {
                    this.$this_unsafeFlow = flowCollector;
                }

                public final java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) {
                    throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$special$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        };
        ViewModel viewModel = (ViewModel) this;
        Flow stateIn = FlowKt.stateIn(flow4, ViewModelKt.getViewModelScope(viewModel), SharingStarted.Companion.WhileSubscribed$default(SharingStarted.Companion, 0L, 0L, 3, (Object) null), PaymentSheetScreen.Loading.INSTANCE);
        this.currentScreen = stateIn;
        this.headerText = FlowKt.combine(stateIn, FlowKt.filterNotNull(linkHandler.isLinkEnabled()), stateFlow, flow2, new BaseSheetViewModel$headerText$1(this, null));
        this.selection = savedStateHandle.getStateFlow(SAVE_SELECTION, (Object) null);
        Flow MutableStateFlow5 = StateFlowKt.MutableStateFlow(false);
        this._editing = MutableStateFlow5;
        Flow flow5 = (StateFlow) MutableStateFlow5;
        this.editing = flow5;
        Flow stateFlow3 = savedStateHandle.getStateFlow(SAVE_PROCESSING, false);
        this.processing = stateFlow3;
        StateFlow<Boolean> MutableStateFlow6 = StateFlowKt.MutableStateFlow(true);
        this._contentVisible = MutableStateFlow6;
        this.contentVisible = MutableStateFlow6;
        StateFlow<PrimaryButton.State> MutableStateFlow7 = StateFlowKt.MutableStateFlow((Object) null);
        this._primaryButtonState = MutableStateFlow7;
        this.primaryButtonState = MutableStateFlow7;
        this.customPrimaryButtonUiState = StateFlowKt.MutableStateFlow((Object) null);
        StateFlow<MandateText> MutableStateFlow8 = StateFlowKt.MutableStateFlow((Object) null);
        this._mandateText = MutableStateFlow8;
        this.mandateText = MutableStateFlow8;
        this.buttonsEnabled = StateFlowsKt.combineStateFlows(viewModel, stateFlow3, flow5, new Function2<Boolean, Boolean, Boolean>() {
            public Object invoke(Object obj, Object obj2) {
                return invoke(((Boolean) obj).booleanValue(), ((Boolean) obj2).booleanValue());
            }

            public final Boolean invoke(boolean z, boolean z2) {
                return Boolean.valueOf((z || z2) ? false : true);
            }
        });
        this.paymentOptionsStateMapper = LazyKt.lazy(new Function0<PaymentOptionsStateMapper>() {
            {
                super(0);
            }

            public final PaymentOptionsStateMapper m647invoke() {
                StateFlow<List<PaymentMethod>> paymentMethods$paymentsheet_release = BaseSheetViewModel.this.getPaymentMethods$paymentsheet_release();
                StateFlow<PaymentSelection> selection$paymentsheet_release = BaseSheetViewModel.this.getSelection$paymentsheet_release();
                StateFlow<GooglePayState> googlePayState$paymentsheet_release = BaseSheetViewModel.this.getGooglePayState$paymentsheet_release();
                StateFlow<Boolean> isLinkEnabled = BaseSheetViewModel.this.getLinkHandler().isLinkEnabled();
                boolean z = BaseSheetViewModel.this instanceof PaymentOptionsViewModel;
                Function1 function1 = (KFunction) new AnonymousClass1(BaseSheetViewModel.this);
                final BaseSheetViewModel baseSheetViewModel = BaseSheetViewModel.this;
                return new PaymentOptionsStateMapper(paymentMethods$paymentsheet_release, googlePayState$paymentsheet_release, isLinkEnabled, selection$paymentsheet_release, function1, z, new Function0<Boolean>() {
                    {
                        super(0);
                    }

                    public final Boolean m648invoke() {
                        return Boolean.valueOf(BaseSheetViewModel.this.getCbcEligibility() instanceof CardBrandChoiceEligibility.Eligible);
                    }
                });
            }

            @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
            class AnonymousClass1 extends FunctionReferenceImpl implements Function1<String, String> {
                AnonymousClass1(Object obj) {
                    super(1, obj, BaseSheetViewModel.class, "providePaymentMethodName", "providePaymentMethodName(Ljava/lang/String;)Ljava/lang/String;", 0);
                }

                public final String invoke(String str) {
                    String providePaymentMethodName;
                    providePaymentMethodName = ((BaseSheetViewModel) this.receiver).providePaymentMethodName(str);
                    return providePaymentMethodName;
                }
            }
        });
        this.paymentOptionsState = FlowKt.stateIn(FlowKt.filterNotNull(getPaymentOptionsStateMapper().invoke()), ViewModelKt.getViewModelScope(viewModel), SharingStarted.Companion.WhileSubscribed$default(SharingStarted.Companion, 0L, 0L, 3, (Object) null), new PaymentOptionsState(null, 0, 3, null));
        final Flow flow6 = stateFlow2;
        final Flow flow7 = flow;
        this.topBarState = FlowKt.stateIn(FlowKt.combine(stateIn, new Flow<List<? extends PaymentMethod>>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = flow6.collect(new AnonymousClass2(flowCollector), continuation);
                return collect == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? collect : Unit.INSTANCE;
            }

            @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0007\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032\u0006\u0010\u0004\u001a\u0002H\u0002H\u008a@¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\b"}, d2 = {"<anonymous>", "", "T", "R", TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE, "emit", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1", "kotlinx/coroutines/flow/FlowKt__TransformKt$map$$inlined$unsafeTransform$1$2"}, k = 3, mv = {1, 8, 0}, xi = 48)
            public static final class AnonymousClass2<T> implements FlowCollector {
                final FlowCollector $this_unsafeFlow;

                @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
                @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$special$$inlined$map$2$2", f = "BaseSheetViewModel.kt", i = {}, l = {223}, m = "emit", n = {}, s = {})
                public static final class AnonymousClass1 extends ContinuationImpl {
                    Object L$0;
                    int label;
                    Object result;

                    public AnonymousClass1(Continuation continuation) {
                        super(continuation);
                    }

                    public final Object invokeSuspend(Object obj) {
                        this.result = obj;
                        this.label |= Integer.MIN_VALUE;
                        return AnonymousClass2.this.emit(null, (Continuation) this);
                    }
                }

                public AnonymousClass2(FlowCollector flowCollector) {
                    this.$this_unsafeFlow = flowCollector;
                }

                public final java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) {
                    throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$special$$inlined$map$2.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        }, new Flow<Boolean>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = flow7.collect(new AnonymousClass2(flowCollector), continuation);
                return collect == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? collect : Unit.INSTANCE;
            }

            @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0007\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032\u0006\u0010\u0004\u001a\u0002H\u0002H\u008a@¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\b"}, d2 = {"<anonymous>", "", "T", "R", TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE, "emit", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1", "kotlinx/coroutines/flow/FlowKt__TransformKt$map$$inlined$unsafeTransform$1$2"}, k = 3, mv = {1, 8, 0}, xi = 48)
            public static final class AnonymousClass2<T> implements FlowCollector {
                final FlowCollector $this_unsafeFlow;

                @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
                @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$special$$inlined$map$3$2", f = "BaseSheetViewModel.kt", i = {}, l = {223}, m = "emit", n = {}, s = {})
                public static final class AnonymousClass1 extends ContinuationImpl {
                    Object L$0;
                    int label;
                    Object result;

                    public AnonymousClass1(Continuation continuation) {
                        super(continuation);
                    }

                    public final Object invokeSuspend(Object obj) {
                        this.result = obj;
                        this.label |= Integer.MIN_VALUE;
                        return AnonymousClass2.this.emit(null, (Continuation) this);
                    }
                }

                public AnonymousClass2(FlowCollector flowCollector) {
                    this.$this_unsafeFlow = flowCollector;
                }

                public final java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) {
                    throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$special$$inlined$map$3.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        }, stateFlow3, flow5, new BaseSheetViewModel$topBarState$3(PaymentSheetTopBarStateFactory.INSTANCE)), ViewModelKt.getViewModelScope(viewModel), SharingStarted.Companion.WhileSubscribed$default(SharingStarted.Companion, 0L, 0L, 3, (Object) null), PaymentSheetTopBarStateFactory.INSTANCE.createDefault());
        BuildersKt.launch$default(ViewModelKt.getViewModelScope(viewModel), (CoroutineContext) null, (CoroutineStart) null, new AnonymousClass1(null), 3, (Object) null);
        BuildersKt.launch$default(ViewModelKt.getViewModelScope(viewModel), (CoroutineContext) null, (CoroutineStart) null, new AnonymousClass2(null), 3, (Object) null);
    }

    public final PaymentSheet.CustomerConfiguration getCustomerConfig() {
        return this.customerConfig;
    }

    public final String getMerchantName() {
        return this.merchantName;
    }

    protected final Throwable getMostRecentError() {
        return this.mostRecentError;
    }

    protected final void setMostRecentError(Throwable th) {
        this.mostRecentError = th;
    }

    protected final CardBrandChoiceEligibility getCbcEligibility() {
        return this.cbcEligibility;
    }

    protected final void setCbcEligibility(CardBrandChoiceEligibility cardBrandChoiceEligibility) {
        Intrinsics.checkNotNullParameter(cardBrandChoiceEligibility, "<set-?>");
        this.cbcEligibility = cardBrandChoiceEligibility;
    }

    public final StateFlow<GooglePayState> getGooglePayState$paymentsheet_release() {
        return this.googlePayState;
    }

    public final StateFlow<StripeIntent> getStripeIntent$paymentsheet_release() {
        return this.stripeIntent;
    }

    public final List<LpmRepository.SupportedPaymentMethod> getSupportedPaymentMethods$paymentsheet_release() {
        return this.supportedPaymentMethods;
    }

    public final void setSupportedPaymentMethods$paymentsheet_release(List<LpmRepository.SupportedPaymentMethod> list) {
        Intrinsics.checkNotNullParameter(list, TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE);
        this.supportedPaymentMethods = list;
        MutableStateFlow<List<String>> mutableStateFlow = this._supportedPaymentMethodsFlow;
        List<LpmRepository.SupportedPaymentMethod> list2 = list;
        ArrayList arrayList = new ArrayList(CollectionsKt.collectionSizeOrDefault(list2, 10));
        Iterator<T> it2 = list2.iterator();
        while (it2.hasNext()) {
            arrayList.add(((LpmRepository.SupportedPaymentMethod) it2.next()).getCode());
        }
        mutableStateFlow.tryEmit(arrayList);
    }

    protected final StateFlow<List<String>> getSupportedPaymentMethodsFlow() {
        return this.supportedPaymentMethodsFlow;
    }

    public final StateFlow<List<PaymentMethod>> getPaymentMethods$paymentsheet_release() {
        return this.paymentMethods;
    }

    public final StateFlow<Amount> getAmount$paymentsheet_release() {
        return this.amount;
    }

    protected final MutableStateFlow<List<PaymentSheetScreen>> getBackStack() {
        return this.backStack;
    }

    public final StateFlow<PaymentSheetScreen> getCurrentScreen() {
        return this.currentScreen;
    }

    public final Flow<Integer> getHeaderText$paymentsheet_release() {
        return this.headerText;
    }

    public final StateFlow<PaymentSelection> getSelection$paymentsheet_release() {
        return this.selection;
    }

    public final StateFlow<Boolean> getEditing$paymentsheet_release() {
        return this.editing;
    }

    public final StateFlow<Boolean> getProcessing() {
        return this.processing;
    }

    public final StateFlow<Boolean> getContentVisible$paymentsheet_release() {
        return this.contentVisible;
    }

    public final StateFlow<PrimaryButton.State> getPrimaryButtonState() {
        return this.primaryButtonState;
    }

    protected final MutableStateFlow<PrimaryButton.UIState> getCustomPrimaryButtonUiState() {
        return this.customPrimaryButtonUiState;
    }

    public final StateFlow<MandateText> getMandateText$paymentsheet_release() {
        return this.mandateText;
    }

    protected final StateFlow<Boolean> getButtonsEnabled() {
        return this.buttonsEnabled;
    }

    private final PaymentOptionsStateMapper getPaymentOptionsStateMapper() {
        return (PaymentOptionsStateMapper) this.paymentOptionsStateMapper.getValue();
    }

    public final String providePaymentMethodName(String code) {
        LpmRepository.SupportedPaymentMethod fromCode = this.lpmRepository.fromCode(code);
        String string = fromCode != null ? getApplication().getString(fromCode.getDisplayNameResource()) : null;
        return string == null ? "" : string;
    }

    public final StateFlow<PaymentOptionsState> getPaymentOptionsState() {
        return this.paymentOptionsState;
    }

    public final StateFlow<PaymentSheetTopBarState> getTopBarState() {
        return this.topBarState;
    }

    public static final Object topBarState$create(PaymentSheetTopBarStateFactory paymentSheetTopBarStateFactory, PaymentSheetScreen paymentSheetScreen, List list, boolean z, boolean z2, boolean z3, Continuation continuation) {
        return paymentSheetTopBarStateFactory.create(paymentSheetScreen, list, z, z2, z3);
    }

    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u008a@"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {1, 8, 0}, xi = 48)
    @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$1", f = "BaseSheetViewModel.kt", i = {}, l = {234}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        int label;

        AnonymousClass1(Continuation<? super AnonymousClass1> continuation) {
            super(2, continuation);
        }

        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            return BaseSheetViewModel.this.new AnonymousClass1(continuation);
        }

        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return create(coroutineScope, continuation).invokeSuspend(Unit.INSTANCE);
        }

        @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010\u0003H\u008a@"}, d2 = {"<anonymous>", "", "paymentMethods", "", "Lcom/stripe/android/model/PaymentMethod;"}, k = 3, mv = {1, 8, 0}, xi = 48)
        @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$1$1", f = "BaseSheetViewModel.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
        static final class C00241 extends SuspendLambda implements Function2<List<? extends PaymentMethod>, Continuation<? super Unit>, Object> {
            Object L$0;
            int label;
            final BaseSheetViewModel this$0;

            C00241(BaseSheetViewModel baseSheetViewModel, Continuation<? super C00241> continuation) {
                super(2, continuation);
                this.this$0 = baseSheetViewModel;
            }

            public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
                Continuation<Unit> c00241 = new C00241(this.this$0, continuation);
                c00241.L$0 = obj;
                return c00241;
            }

            public final Object invoke(List<PaymentMethod> list, Continuation<? super Unit> continuation) {
                return create(list, continuation).invokeSuspend(Unit.INSTANCE);
            }

            public final Object invokeSuspend(Object obj) {
                IntrinsicsKt.getCOROUTINE_SUSPENDED();
                if (this.label != 0) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
                List list = (List) this.L$0;
                if ((list == null || list.isEmpty()) && ((Boolean) this.this$0.getEditing$paymentsheet_release().getValue()).booleanValue()) {
                    this.this$0.toggleEditing();
                }
                return Unit.INSTANCE;
            }
        }

        public final Object invokeSuspend(Object obj) {
            Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
            int i2 = this.label;
            if (i2 == 0) {
                ResultKt.throwOnFailure(obj);
                this.label = 1;
                if (FlowKt.collect(FlowKt.onEach(BaseSheetViewModel.this.getPaymentMethods$paymentsheet_release(), new C00241(BaseSheetViewModel.this, null)), (Continuation) this) == coroutine_suspended) {
                    return coroutine_suspended;
                }
            } else {
                if (i2 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
            }
            return Unit.INSTANCE;
        }
    }

    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u008a@"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {1, 8, 0}, xi = 48)
    @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$2", f = "BaseSheetViewModel.kt", i = {}, l = {247}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass2 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        int label;

        AnonymousClass2(Continuation<? super AnonymousClass2> continuation) {
            super(2, continuation);
        }

        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            return BaseSheetViewModel.this.new AnonymousClass2(continuation);
        }

        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return create(coroutineScope, continuation).invokeSuspend(Unit.INSTANCE);
        }

        public final Object invokeSuspend(Object obj) {
            Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
            int i2 = this.label;
            if (i2 == 0) {
                ResultKt.throwOnFailure(obj);
                final Flow paymentOptionsState = BaseSheetViewModel.this.getPaymentOptionsState();
                final Flow<PaymentSelection> flow = new Flow<PaymentSelection>() {
                    public Object collect(FlowCollector flowCollector, Continuation continuation) {
                        Object collect = paymentOptionsState.collect(new AnonymousClass2(flowCollector), continuation);
                        return collect == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? collect : Unit.INSTANCE;
                    }

                    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0007\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032\u0006\u0010\u0004\u001a\u0002H\u0002H\u008a@¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\b"}, d2 = {"<anonymous>", "", "T", "R", TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE, "emit", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1", "kotlinx/coroutines/flow/FlowKt__TransformKt$mapNotNull$$inlined$unsafeTransform$1$2"}, k = 3, mv = {1, 8, 0}, xi = 48)
                    public static final class AnonymousClass2<T> implements FlowCollector {
                        final FlowCollector $this_unsafeFlow;

                        @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
                        @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$2$invokeSuspend$$inlined$mapNotNull$1$2", f = "BaseSheetViewModel.kt", i = {}, l = {225}, m = "emit", n = {}, s = {})
                        public static final class AnonymousClass1 extends ContinuationImpl {
                            Object L$0;
                            int label;
                            Object result;

                            public AnonymousClass1(Continuation continuation) {
                                super(continuation);
                            }

                            public final Object invokeSuspend(Object obj) {
                                this.result = obj;
                                this.label |= Integer.MIN_VALUE;
                                return AnonymousClass2.this.emit(null, (Continuation) this);
                            }
                        }

                        public AnonymousClass2(FlowCollector flowCollector) {
                            this.$this_unsafeFlow = flowCollector;
                        }

                        public final java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) {
                            throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$2$invokeSuspend$$inlined$mapNotNull$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                        }
                    }
                };
                final BaseSheetViewModel baseSheetViewModel = BaseSheetViewModel.this;
                Flow<PaymentSelection> flow2 = new Flow<PaymentSelection>() {
                    public Object collect(FlowCollector flowCollector, Continuation continuation) {
                        Object collect = flow.collect(new AnonymousClass2(flowCollector, baseSheetViewModel), continuation);
                        return collect == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? collect : Unit.INSTANCE;
                    }

                    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0007\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032\u0006\u0010\u0004\u001a\u0002H\u0002H\u008a@¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\b"}, d2 = {"<anonymous>", "", "T", "R", TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE, "emit", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1", "kotlinx/coroutines/flow/FlowKt__TransformKt$filter$$inlined$unsafeTransform$1$2"}, k = 3, mv = {1, 8, 0}, xi = 48)
                    public static final class AnonymousClass2<T> implements FlowCollector {
                        final FlowCollector $this_unsafeFlow;
                        final BaseSheetViewModel this$0;

                        @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
                        @DebugMetadata(c = "com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$2$invokeSuspend$$inlined$filter$1$2", f = "BaseSheetViewModel.kt", i = {}, l = {223}, m = "emit", n = {}, s = {})
                        public static final class AnonymousClass1 extends ContinuationImpl {
                            Object L$0;
                            Object L$1;
                            int label;
                            Object result;

                            public AnonymousClass1(Continuation continuation) {
                                super(continuation);
                            }

                            public final Object invokeSuspend(Object obj) {
                                this.result = obj;
                                this.label |= Integer.MIN_VALUE;
                                return AnonymousClass2.this.emit(null, (Continuation) this);
                            }
                        }

                        public AnonymousClass2(FlowCollector flowCollector, BaseSheetViewModel baseSheetViewModel) {
                            this.$this_unsafeFlow = flowCollector;
                            this.this$0 = baseSheetViewModel;
                        }

                        public final java.lang.Object emit(java.lang.Object r6, kotlin.coroutines.Continuation r7) {
                            throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel$2$invokeSuspend$$inlined$filter$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                        }
                    }
                };
                final BaseSheetViewModel baseSheetViewModel2 = BaseSheetViewModel.this;
                this.label = 1;
                if (flow2.collect(new FlowCollector<PaymentSelection>() {
                    public final Object emit(PaymentSelection paymentSelection, Continuation<? super Unit> continuation) {
                        BaseSheetViewModel.this.updateSelection(paymentSelection);
                        return Unit.INSTANCE;
                    }

                    public Object emit(Object obj2, Continuation continuation) {
                        return emit((PaymentSelection) obj2, (Continuation<? super Unit>) continuation);
                    }
                }, (Continuation) this) == coroutine_suspended) {
                    return coroutine_suspended;
                }
            } else {
                if (i2 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ResultKt.throwOnFailure(obj);
            }
            return Unit.INSTANCE;
        }
    }

    protected final void transitionToFirstScreen() {
        List<PaymentSheetScreen> determineInitialBackStack = determineInitialBackStack();
        resetTo(determineInitialBackStack);
        reportPaymentSheetShown((PaymentSheetScreen) CollectionsKt.first(determineInitialBackStack));
    }

    public final void transitionToAddPaymentScreen() {
        transitionTo(PaymentSheetScreen.AddAnotherPaymentMethod.INSTANCE);
    }

    private final void transitionTo(PaymentSheetScreen target) {
        Object value;
        clearErrorMessages();
        MutableStateFlow<List<PaymentSheetScreen>> mutableStateFlow = this.backStack;
        do {
            value = mutableStateFlow.getValue();
        } while (!mutableStateFlow.compareAndSet(value, CollectionsKt.plus(CollectionsKt.minus((List) value, PaymentSheetScreen.Loading.INSTANCE), target)));
    }

    private final void reportPaymentSheetShown(PaymentSheetScreen currentScreen) {
        if (currentScreen instanceof PaymentSheetScreen.Loading ? true : Intrinsics.areEqual(currentScreen, PaymentSheetScreen.AddAnotherPaymentMethod.INSTANCE)) {
            return;
        }
        if (currentScreen instanceof PaymentSheetScreen.SelectSavedPaymentMethods) {
            this.eventReporter.onShowExistingPaymentOptions();
        } else if (currentScreen instanceof PaymentSheetScreen.AddFirstPaymentMethod) {
            this.eventReporter.onShowNewPaymentOptionForm();
        } else {
            boolean z = currentScreen instanceof PaymentSheetScreen.EditPaymentMethod;
        }
    }

    public final void reportConfirmButtonPressed() {
        this.eventReporter.onPressConfirmButton();
    }

    protected final void setStripeIntent(StripeIntent stripeIntent) {
        this._stripeIntent.setValue(stripeIntent);
        setSupportedPaymentMethods$paymentsheet_release(SupportedPaymentMethodKtxKt.getPMsToAdd$default(stripeIntent, this.config, this.lpmRepository, null, 8, null));
        if (stripeIntent instanceof PaymentIntent) {
            MutableStateFlow<Amount> mutableStateFlow = this._amount;
            PaymentIntent paymentIntent = (PaymentIntent) stripeIntent;
            Long amount = paymentIntent.getAmount();
            if (amount == null) {
                throw new IllegalArgumentException("Required value was null.".toString());
            }
            long longValue = amount.longValue();
            String currency = paymentIntent.getCurrency();
            if (currency != null) {
                mutableStateFlow.setValue(new Amount(longValue, currency));
                return;
            }
            throw new IllegalArgumentException("Required value was null.".toString());
        }
    }

    protected final void reportDismiss() {
        this.eventReporter.onDismiss();
    }

    public final void reportPaymentMethodTypeSelected(String code) {
        Intrinsics.checkNotNullParameter(code, PaymentMethodOptionsParams.Blik.PARAM_CODE);
        this.eventReporter.onSelectPaymentMethod(code);
    }

    public final void updatePrimaryButtonForLinkSignup(InlineSignupViewState viewState) {
        PrimaryButton.UIState uIState;
        Intrinsics.checkNotNullParameter(viewState, "viewState");
        PrimaryButton.UIState uIState2 = (PrimaryButton.UIState) getPrimaryButtonUiState().getValue();
        if (uIState2 == null) {
            return;
        }
        if (viewState.getUseLink()) {
            final UserInput userInput = viewState.getUserInput();
            PaymentSelection paymentSelection = (PaymentSelection) this.selection.getValue();
            if (userInput != null && paymentSelection != null) {
                uIState = new PrimaryButton.UIState(uIState2.getLabel(), new Function0<Unit>() {
                    {
                        super(0);
                    }

                    public Object invoke() {
                        m650invoke();
                        return Unit.INSTANCE;
                    }

                    public final void m650invoke() {
                        BaseSheetViewModel.this.payWithLinkInline(userInput);
                    }
                }, true, this instanceof PaymentSheetViewModel);
            } else {
                uIState = new PrimaryButton.UIState(uIState2.getLabel(), new Function0<Unit>() {
                    public final void m651invoke() {
                    }

                    public Object invoke() {
                        m651invoke();
                        return Unit.INSTANCE;
                    }
                }, false, this instanceof PaymentSheetViewModel);
            }
        } else {
            uIState = null;
        }
        updateLinkPrimaryButtonUiState(uIState);
    }

    public final void updatePrimaryButtonForLinkInline() {
        PrimaryButton.UIState uIState = (PrimaryButton.UIState) getPrimaryButtonUiState().getValue();
        if (uIState == null) {
            return;
        }
        updateLinkPrimaryButtonUiState(new PrimaryButton.UIState(uIState.getLabel(), new Function0<Unit>() {
            {
                super(0);
            }

            public Object invoke() {
                m649invoke();
                return Unit.INSTANCE;
            }

            public final void m649invoke() {
                BaseSheetViewModel.this.payWithLinkInline(null);
            }
        }, true, this instanceof PaymentSheetViewModel));
    }

    private final void updateLinkPrimaryButtonUiState(PrimaryButton.UIState state) {
        this.customPrimaryButtonUiState.setValue(state);
    }

    public final void updateCustomPrimaryButtonUiState(Function1<? super PrimaryButton.UIState, PrimaryButton.UIState> block) {
        Object value;
        Intrinsics.checkNotNullParameter(block, "block");
        MutableStateFlow<PrimaryButton.UIState> mutableStateFlow = this.customPrimaryButtonUiState;
        do {
            value = mutableStateFlow.getValue();
        } while (!mutableStateFlow.compareAndSet(value, block.invoke(value)));
    }

    public final void resetUSBankPrimaryButton() {
        this.customPrimaryButtonUiState.setValue((Object) null);
    }

    public final void updatePrimaryButtonState(PrimaryButton.State state) {
        Intrinsics.checkNotNullParameter(state, WiredHeadsetReceiverKt.INTENT_STATE);
        this._primaryButtonState.setValue(state);
    }

    public final void updateMandateText(String mandateText, boolean showAbove) {
        this._mandateText.setValue(mandateText != null ? new MandateText(mandateText, showAbove) : null);
    }

    public final void updateSelection(PaymentSelection selection) {
        boolean z = selection instanceof PaymentSelection.New;
        if (z) {
            setNewPaymentSelection((PaymentSelection.New) selection);
        }
        this.savedStateHandle.set(SAVE_SELECTION, selection);
        String mandateText = selection != null ? selection.mandateText(getApplication(), this.merchantName, z && ((PaymentSelection.New) selection).getCustomerRequestedSave() == PaymentSelection.CustomerRequestedSave.RequestReuse, this.stripeIntent.getValue() instanceof SetupIntent) : null;
        PaymentSelection.Saved saved = selection instanceof PaymentSelection.Saved ? (PaymentSelection.Saved) selection : null;
        updateMandateText(mandateText, saved != null && saved.getShowMandateAbovePrimaryButton());
        clearErrorMessages();
    }

    public final void toggleEditing() {
        this._editing.setValue(Boolean.valueOf(!((Boolean) this.editing.getValue()).booleanValue()));
    }

    public final void setContentVisible(boolean visible) {
        this._contentVisible.setValue(Boolean.valueOf(visible));
    }

    public final void removePaymentMethod(PaymentMethod paymentMethod) {
        Intrinsics.checkNotNullParameter(paymentMethod, "paymentMethod");
        String str = paymentMethod.id;
        if (str == null) {
            return;
        }
        BuildersKt.launch$default(ViewModelKt.getViewModelScope((ViewModel) this), (CoroutineContext) null, (CoroutineStart) null, new BaseSheetViewModel$removePaymentMethod$1(this, str, null), 3, (Object) null);
    }

    public final java.lang.Object m646removePaymentMethodInternalgIAlus(java.lang.String r6, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.model.PaymentMethod>> r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel.m646removePaymentMethodInternalgIAlus(java.lang.String, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final void removeDeletedPaymentMethodFromState(String paymentMethodId) {
        ArrayList arrayList;
        SavedStateHandle savedStateHandle = this.savedStateHandle;
        List list = (List) this.paymentMethods.getValue();
        if (list != null) {
            ArrayList arrayList2 = new ArrayList();
            for (Object obj : list) {
                if (!Intrinsics.areEqual(((PaymentMethod) obj).id, paymentMethodId)) {
                    arrayList2.add(obj);
                }
            }
            arrayList = arrayList2;
        } else {
            arrayList = null;
        }
        savedStateHandle.set(SAVE_PAYMENT_METHODS, arrayList);
        Collection collection = (Collection) this.paymentMethods.getValue();
        if ((collection == null || collection.isEmpty()) && (this.currentScreen.getValue() instanceof PaymentSheetScreen.SelectSavedPaymentMethods)) {
            resetTo(CollectionsKt.listOf(PaymentSheetScreen.AddFirstPaymentMethod.INSTANCE));
        }
    }

    public final void modifyPaymentMethod(PaymentMethod paymentMethod) {
        Intrinsics.checkNotNullParameter(paymentMethod, "paymentMethod");
        ModifiableEditPaymentMethodViewInteractor.Factory factory = this.editInteractorFactory;
        PaymentMethod.Type type = paymentMethod.type;
        transitionTo(new PaymentSheetScreen.EditPaymentMethod(factory.create(paymentMethod, new BaseSheetViewModel$modifyPaymentMethod$1(this, null), new BaseSheetViewModel$modifyPaymentMethod$2(this, null), providePaymentMethodName(type != null ? type.code : null))));
    }

    public final java.lang.Object removePaymentMethodInEditScreen(com.stripe.android.model.PaymentMethod r9, kotlin.coroutines.Continuation<? super java.lang.Throwable> r10) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel.removePaymentMethodInEditScreen(com.stripe.android.model.PaymentMethod, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object m645modifyCardPaymentMethod0E7RQCE(com.stripe.android.model.PaymentMethod r13, com.stripe.android.model.CardBrand r14, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.model.PaymentMethod>> r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.viewmodels.BaseSheetViewModel.m645modifyCardPaymentMethod0E7RQCE(com.stripe.android.model.PaymentMethod, com.stripe.android.model.CardBrand, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final Integer mapToHeaderTextResource(PaymentSheetScreen screen, boolean isLinkAvailable, GooglePayState googlePayState, List<String> supportedPaymentMethods) {
        return this.headerTextFactory.create(screen, isLinkAvailable || (googlePayState instanceof GooglePayState.Available), supportedPaymentMethods);
    }

    public final void payWithLinkInline(UserInput userInput) {
        BuildersKt.launch$default(ViewModelKt.getViewModelScope((ViewModel) this), (CoroutineContext) null, (CoroutineStart) null, new BaseSheetViewModel$payWithLinkInline$1(this, userInput, null), 3, (Object) null);
    }

    public final FormArguments createFormArguments(LpmRepository.SupportedPaymentMethod selectedItem) {
        Intrinsics.checkNotNullParameter(selectedItem, "selectedItem");
        FormArgumentsFactory formArgumentsFactory = FormArgumentsFactory.INSTANCE;
        Object value = this.stripeIntent.getValue();
        if (value != null) {
            return formArgumentsFactory.create(selectedItem, (StripeIntent) value, this.config, this.merchantName, (Amount) this.amount.getValue(), getNewPaymentSelection(), this.cbcEligibility);
        }
        throw new IllegalArgumentException("Required value was null.".toString());
    }

    public final void handleBackPressed() {
        if (((Boolean) this.processing.getValue()).booleanValue()) {
            return;
        }
        if (((List) this.backStack.getValue()).size() > 1) {
            onUserBack();
        } else {
            onUserCancel();
        }
    }

    public final void onUserBack() {
        Object value;
        List mutableList;
        clearErrorMessages();
        MutableStateFlow<List<PaymentSheetScreen>> mutableStateFlow = this.backStack;
        do {
            value = mutableStateFlow.getValue();
            mutableList = CollectionsKt.toMutableList((List) value);
            onClose((PaymentSheetScreen) CollectionsKt.removeLast(mutableList));
        } while (!mutableStateFlow.compareAndSet(value, CollectionsKt.toList(mutableList)));
        PaymentOptionsItem selectedItem = ((PaymentOptionsState) this.paymentOptionsState.getValue()).getSelectedItem();
        updateSelection(selectedItem != null ? PaymentOptionsStateFactoryKt.toPaymentSelection(selectedItem) : null);
    }

    private final void resetTo(List<? extends PaymentSheetScreen> screens) {
        List<PaymentSheetScreen> list = (List) this.backStack.getValue();
        this.backStack.setValue(screens);
        for (PaymentSheetScreen paymentSheetScreen : list) {
            if (!screens.contains(paymentSheetScreen)) {
                onClose(paymentSheetScreen);
            }
        }
    }

    private final void onClose(PaymentSheetScreen paymentSheetScreen) {
        if (paymentSheetScreen instanceof Closeable) {
            ((Closeable) paymentSheetScreen).close();
        }
    }

    public final void reportAutofillEvent(String type) {
        Intrinsics.checkNotNullParameter(type, "type");
        this.eventReporter.onAutofill(type);
    }

    public static void onError$default(BaseSheetViewModel baseSheetViewModel, Integer num, int i2, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: onError");
        }
        if ((i2 & 1) != 0) {
            num = null;
        }
        baseSheetViewModel.onError(num);
    }

    public static void onError$default(BaseSheetViewModel baseSheetViewModel, String str, int i2, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: onError");
        }
        if ((i2 & 1) != 0) {
            str = null;
        }
        baseSheetViewModel.onError(str);
    }

    @Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\b\u0087\b\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\t\u0010\u0007\u001a\u00020\u0003HÆ\u0003J\u0013\u0010\b\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u0003HÆ\u0001J\u0013\u0010\t\u001a\u00020\n2\b\u0010\u000b\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\f\u001a\u00020\rHÖ\u0001J\t\u0010\u000e\u001a\u00020\u0003HÖ\u0001R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u000f"}, d2 = {"Lcom/stripe/android/paymentsheet/viewmodels/BaseSheetViewModel$UserErrorMessage;", "", RestAdapter.JSON_KEY_ERROR_MESSAGE, "", "(Ljava/lang/String;)V", "getMessage", "()Ljava/lang/String;", "component1", "copy", "equals", "", "other", "hashCode", "", "toString", "paymentsheet_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class UserErrorMessage {
        public static final int $stable = 0;
        private final String message;

        public static UserErrorMessage copy$default(UserErrorMessage userErrorMessage, String str, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                str = userErrorMessage.message;
            }
            return userErrorMessage.copy(str);
        }

        public final String getMessage() {
            return this.message;
        }

        public final UserErrorMessage copy(String message) {
            Intrinsics.checkNotNullParameter(message, RestAdapter.JSON_KEY_ERROR_MESSAGE);
            return new UserErrorMessage(message);
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            return (other instanceof UserErrorMessage) && Intrinsics.areEqual(this.message, ((UserErrorMessage) other).message);
        }

        public int hashCode() {
            return this.message.hashCode();
        }

        public String toString() {
            return "UserErrorMessage(message=" + this.message + ")";
        }

        public UserErrorMessage(String str) {
            Intrinsics.checkNotNullParameter(str, RestAdapter.JSON_KEY_ERROR_MESSAGE);
            this.message = str;
        }

        public final String getMessage() {
            return this.message;
        }
    }
}