导航菜单

页面标题

页面副标题

Rilo v2.0.21 - USBankAccountFormViewModel.java 源代码

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

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


package com.stripe.android.paymentsheet.paymentdatacollection.ach;

import android.app.Application;
import android.content.res.Resources;
import androidx.activity.result.ActivityResultRegistryOwner;
import androidx.lifecycle.SavedStateHandle;
import androidx.lifecycle.SavedStateHandleSupport;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelKt;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.viewmodel.CreationExtras;
import com.stripe.android.PaymentConfiguration;
import com.stripe.android.financialconnections.model.BankAccount;
import com.stripe.android.financialconnections.model.FinancialConnectionsAccount;
import com.stripe.android.model.Address;
import com.stripe.android.model.PaymentMethod;
import com.stripe.android.model.PaymentMethodCreateParams;
import com.stripe.android.model.PaymentMethodOptionsParams;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.payments.bankaccount.CollectBankAccountConfiguration;
import com.stripe.android.payments.bankaccount.CollectBankAccountLauncher;
import com.stripe.android.payments.bankaccount.navigation.CollectBankAccountResultInternal;
import com.stripe.android.paymentsheet.PaymentSheet;
import com.stripe.android.paymentsheet.R;
import com.stripe.android.paymentsheet.addresselement.AddressDetails;
import com.stripe.android.paymentsheet.addresselement.AddressDetailsKt;
import com.stripe.android.paymentsheet.model.PaymentSelection;
import com.stripe.android.paymentsheet.paymentdatacollection.FormArguments;
import com.stripe.android.paymentsheet.paymentdatacollection.ach.USBankAccountFormScreenState;
import com.stripe.android.paymentsheet.paymentdatacollection.ach.di.DaggerUSBankAccountFormComponent;
import com.stripe.android.ui.core.Amount;
import com.stripe.android.ui.core.elements.SaveForFutureUseElement;
import com.stripe.android.ui.core.elements.SaveForFutureUseSpec;
import com.stripe.android.uicore.address.AddressRepository;
import com.stripe.android.uicore.elements.AddressElement;
import com.stripe.android.uicore.elements.AddressType;
import com.stripe.android.uicore.elements.DropdownFieldController;
import com.stripe.android.uicore.elements.EmailConfig;
import com.stripe.android.uicore.elements.FormElement;
import com.stripe.android.uicore.elements.IdentifierSpec;
import com.stripe.android.uicore.elements.NameConfig;
import com.stripe.android.uicore.elements.PhoneNumberController;
import com.stripe.android.uicore.elements.SameAsShippingController;
import com.stripe.android.uicore.elements.SameAsShippingElement;
import com.stripe.android.uicore.elements.SimpleTextFieldController;
import com.stripe.android.uicore.elements.TextFieldController;
import com.stripe.android.uicore.forms.FormFieldEntry;
import com.stripe.android.utils.CreationExtrasKtxKt;
import com.tiktok.appevents.contents.TTContentsEventConstants;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Provider;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.MapsKt;
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.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.channels.BufferOverflow;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowCollector;
import kotlinx.coroutines.flow.FlowKt;
import kotlinx.coroutines.flow.MutableSharedFlow;
import kotlinx.coroutines.flow.MutableStateFlow;
import kotlinx.coroutines.flow.SharedFlowKt;
import kotlinx.coroutines.flow.SharingStarted;
import kotlinx.coroutines.flow.StateFlow;
import kotlinx.coroutines.flow.StateFlowKt;

@Metadata(d1 = {"\u0000Ê\u0001\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\u0002\u0018\u0002\n\u0000\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\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\u0002\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0006\b\u0000\u0018\u0000 \u007f2\u00020\u0001:\u0004~\u007f\u0080\u0001B5\b\u0001\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\b0\u0007\u0012\u0006\u0010\t\u001a\u00020\n\u0012\u0006\u0010\u000b\u001a\u00020\f¢\u0006\u0002\u0010\rJ\b\u0010g\u001a\u000208H\u0002J\b\u0010h\u001a\u000208H\u0002J\u0012\u0010i\u001a\u00020j2\b\u0010k\u001a\u0004\u0018\u000108H\u0002J \u0010l\u001a\u00020\u00152\u0006\u0010m\u001a\u0002082\u0006\u0010n\u001a\u0002082\u0006\u0010o\u001a\u000208H\u0002J\b\u0010p\u001a\u00020\u0013H\u0002J\u0006\u0010q\u001a\u000208J\u0010\u0010r\u001a\u00020j2\u0006\u0010X\u001a\u00020\u0010H\u0007J\u000e\u0010s\u001a\u00020j2\u0006\u0010t\u001a\u00020\u0013J\u0006\u0010u\u001a\u00020jJ\u000e\u0010v\u001a\u00020j2\u0006\u0010w\u001a\u00020xJ\u0017\u0010y\u001a\u00020j2\n\b\u0003\u0010z\u001a\u0004\u0018\u00010{¢\u0006\u0002\u0010|J$\u0010}\u001a\u00020j2\u0006\u0010o\u001a\u0002082\b\u0010n\u001a\u0004\u0018\u0001082\b\u0010m\u001a\u0004\u0018\u000108H\u0002R\u0016\u0010\u000e\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00100\u000fX\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u00130\u0012X\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\u0014\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00150\u000fX\u0082\u0004¢\u0006\u0002\n\u0000R\u0019\u0010\u0016\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00180\u0017¢\u0006\b\n\u0000\u001a\u0004\b\u0019\u0010\u001aR\u0011\u0010\u001b\u001a\u00020\u001c¢\u0006\b\n\u0000\u001a\u0004\b\u001d\u0010\u001eR\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R&\u0010\u001f\u001a\u0004\u0018\u00010 8\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0000\u0012\u0004\b!\u0010\"\u001a\u0004\b#\u0010$\"\u0004\b%\u0010&R\u0019\u0010'\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00100(¢\u0006\b\n\u0000\u001a\u0004\b)\u0010*R\u000e\u0010+\u001a\u00020,X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010-\u001a\u00020,X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010.\u001a\u00020,X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010/\u001a\u00020,X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u00100\u001a\u000201X\u0082\u0004¢\u0006\u0002\n\u0000R\u0017\u00102\u001a\b\u0012\u0004\u0012\u00020\u00130\u0017¢\u0006\b\n\u0000\u001a\u0004\b3\u0010\u001aR\u0010\u00104\u001a\u0004\u0018\u00010\u0018X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u00105\u001a\u0004\u0018\u000106X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u00107\u001a\u0004\u0018\u000108X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u00109\u001a\u0004\u0018\u000108X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010:\u001a\u0004\u0018\u000108X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010;\u001a\u0004\u0018\u000108X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010<\u001a\u00020,X\u0082\u0004¢\u0006\u0002\n\u0000R\u0019\u0010=\u001a\n\u0012\u0006\u0012\u0004\u0018\u0001080\u0017¢\u0006\b\n\u0000\u001a\u0004\b>\u0010\u001aR\u0011\u0010?\u001a\u00020@¢\u0006\b\n\u0000\u001a\u0004\bA\u0010BR$\u0010D\u001a\u00020,2\u0006\u0010C\u001a\u00020,8B@BX\u0082\u000e¢\u0006\f\u001a\u0004\bE\u0010F\"\u0004\bG\u0010HR\u0019\u0010I\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010J0(¢\u0006\b\n\u0000\u001a\u0004\bK\u0010*R\u0014\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\b0\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0017\u0010L\u001a\b\u0012\u0004\u0012\u0002080\u0017¢\u0006\b\n\u0000\u001a\u0004\bM\u0010\u001aR\u0011\u0010N\u001a\u00020@¢\u0006\b\n\u0000\u001a\u0004\bO\u0010BR\u0019\u0010P\u001a\n\u0012\u0006\u0012\u0004\u0018\u0001080\u0017¢\u0006\b\n\u0000\u001a\u0004\bQ\u0010\u001aR\u0011\u0010R\u001a\u00020S¢\u0006\b\n\u0000\u001a\u0004\bT\u0010UR\u0017\u0010V\u001a\b\u0012\u0004\u0012\u00020,0\u0017¢\u0006\b\n\u0000\u001a\u0004\bW\u0010\u001aR\u0019\u0010X\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00150(¢\u0006\b\n\u0000\u001a\u0004\bY\u0010*R\u0013\u0010Z\u001a\u0004\u0018\u00010[¢\u0006\b\n\u0000\u001a\u0004\b\\\u0010]R\u0017\u0010^\u001a\b\u0012\u0004\u0012\u00020,0\u0017¢\u0006\b\n\u0000\u001a\u0004\b_\u0010\u001aR\u0011\u0010`\u001a\u00020a¢\u0006\b\n\u0000\u001a\u0004\bb\u0010cR\u000e\u0010\t\u001a\u00020\nX\u0082\u0004¢\u0006\u0002\n\u0000R$\u0010d\u001a\u00020,2\u0006\u0010C\u001a\u00020,8B@BX\u0082\u000e¢\u0006\f\u001a\u0004\be\u0010F\"\u0004\bf\u0010H¨\u0006\u0081\u0001"}, d2 = {"Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormViewModel;", "Landroidx/lifecycle/ViewModel;", "args", "Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormViewModel$Args;", "application", "Landroid/app/Application;", "lazyPaymentConfig", "Ljavax/inject/Provider;", "Lcom/stripe/android/PaymentConfiguration;", "savedStateHandle", "Landroidx/lifecycle/SavedStateHandle;", "addressRepository", "Lcom/stripe/android/uicore/address/AddressRepository;", "(Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormViewModel$Args;Landroid/app/Application;Ljavax/inject/Provider;Landroidx/lifecycle/SavedStateHandle;Lcom/stripe/android/uicore/address/AddressRepository;)V", "_collectBankAccountResult", "Lkotlinx/coroutines/flow/MutableSharedFlow;", "Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountResultInternal;", "_currentScreenState", "Lkotlinx/coroutines/flow/MutableStateFlow;", "Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormScreenState;", "_result", "Lcom/stripe/android/paymentsheet/model/PaymentSelection$New$USBankAccount;", "address", "Lkotlinx/coroutines/flow/StateFlow;", "Lcom/stripe/android/model/Address;", "getAddress", "()Lkotlinx/coroutines/flow/StateFlow;", "addressElement", "Lcom/stripe/android/uicore/elements/AddressElement;", "getAddressElement", "()Lcom/stripe/android/uicore/elements/AddressElement;", "collectBankAccountLauncher", "Lcom/stripe/android/payments/bankaccount/CollectBankAccountLauncher;", "getCollectBankAccountLauncher$annotations", "()V", "getCollectBankAccountLauncher", "()Lcom/stripe/android/payments/bankaccount/CollectBankAccountLauncher;", "setCollectBankAccountLauncher", "(Lcom/stripe/android/payments/bankaccount/CollectBankAccountLauncher;)V", "collectBankAccountResult", "Lkotlinx/coroutines/flow/Flow;", "getCollectBankAccountResult", "()Lkotlinx/coroutines/flow/Flow;", "collectingAddress", "", "collectingEmail", "collectingName", "collectingPhone", "collectionConfiguration", "Lcom/stripe/android/paymentsheet/PaymentSheet$BillingDetailsCollectionConfiguration;", "currentScreenState", "getCurrentScreenState", "defaultAddress", "defaultBillingDetails", "Lcom/stripe/android/paymentsheet/PaymentSheet$BillingDetails;", "defaultEmail", "", "defaultName", "defaultPhone", "defaultPhoneCountry", "defaultSaveForFutureUse", "email", "getEmail", "emailController", "Lcom/stripe/android/uicore/elements/TextFieldController;", "getEmailController", "()Lcom/stripe/android/uicore/elements/TextFieldController;", TTContentsEventConstants.Params.EVENT_PROPERTY_VALUE, "hasLaunched", "getHasLaunched", "()Z", "setHasLaunched", "(Z)V", "lastTextFieldIdentifier", "Lcom/stripe/android/uicore/elements/IdentifierSpec;", "getLastTextFieldIdentifier", "name", "getName", "nameController", "getNameController", "phone", "getPhone", "phoneController", "Lcom/stripe/android/uicore/elements/PhoneNumberController;", "getPhoneController", "()Lcom/stripe/android/uicore/elements/PhoneNumberController;", "requiredFields", "getRequiredFields", "result", "getResult", "sameAsShippingElement", "Lcom/stripe/android/uicore/elements/SameAsShippingElement;", "getSameAsShippingElement", "()Lcom/stripe/android/uicore/elements/SameAsShippingElement;", "saveForFutureUse", "getSaveForFutureUse", "saveForFutureUseElement", "Lcom/stripe/android/ui/core/elements/SaveForFutureUseElement;", "getSaveForFutureUseElement", "()Lcom/stripe/android/ui/core/elements/SaveForFutureUseElement;", "shouldReset", "getShouldReset", "setShouldReset", "buildMandateText", "buildPrimaryButtonText", "collectBankAccount", "", "clientSecret", "createNewPaymentSelection", "last4", "bankName", "linkAccountId", "determineInitialState", "formattedMerchantName", "handleCollectBankAccountResult", "handlePrimaryButtonClick", "screenState", "onDestroy", "register", "activityResultRegistryOwner", "Landroidx/activity/result/ActivityResultRegistryOwner;", "reset", "error", "", "(Ljava/lang/Integer;)V", "updatePaymentSelection", "Args", "Companion", "Factory", "paymentsheet_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class USBankAccountFormViewModel extends ViewModel {
    private static final Companion Companion = new Companion(null);
    private static final String HAS_LAUNCHED_KEY = "has_launched";
    private static final String SHOULD_RESET_KEY = "should_reset";
    private final MutableSharedFlow<CollectBankAccountResultInternal> _collectBankAccountResult;
    private final MutableStateFlow<USBankAccountFormScreenState> _currentScreenState;
    private final MutableSharedFlow<PaymentSelection.New.USBankAccount> _result;
    private final StateFlow<Address> address;
    private final AddressElement addressElement;
    private final Application application;
    private final Args args;
    private CollectBankAccountLauncher collectBankAccountLauncher;
    private final Flow<CollectBankAccountResultInternal> collectBankAccountResult;
    private final boolean collectingAddress;
    private final boolean collectingEmail;
    private final boolean collectingName;
    private final boolean collectingPhone;
    private final PaymentSheet.BillingDetailsCollectionConfiguration collectionConfiguration;
    private final StateFlow<USBankAccountFormScreenState> currentScreenState;
    private final Address defaultAddress;
    private final PaymentSheet.BillingDetails defaultBillingDetails;
    private final String defaultEmail;
    private final String defaultName;
    private final String defaultPhone;
    private final String defaultPhoneCountry;
    private final boolean defaultSaveForFutureUse;
    private final StateFlow<String> email;
    private final TextFieldController emailController;
    private final Flow<IdentifierSpec> lastTextFieldIdentifier;
    private final Provider<PaymentConfiguration> lazyPaymentConfig;
    private final StateFlow<String> name;
    private final TextFieldController nameController;
    private final StateFlow<String> phone;
    private final PhoneNumberController phoneController;
    private final StateFlow<Boolean> requiredFields;
    private final Flow<PaymentSelection.New.USBankAccount> result;
    private final SameAsShippingElement sameAsShippingElement;
    private final StateFlow<Boolean> saveForFutureUse;
    private final SaveForFutureUseElement saveForFutureUseElement;
    private final SavedStateHandle savedStateHandle;

    public static void getCollectBankAccountLauncher$annotations() {
    }

    @Inject
    public USBankAccountFormViewModel(Args args, Application application, Provider<PaymentConfiguration> provider, SavedStateHandle savedStateHandle, AddressRepository addressRepository) {
        String name;
        String email;
        PaymentSheet.Address address;
        String country;
        String phone;
        PaymentSheet.Address address2;
        Address asAddressModel;
        StateFlow<Address> stateIn;
        Flow<IdentifierSpec> flowOf;
        PaymentSelection.New.USBankAccount.Input input;
        Map<IdentifierSpec, String> asFormFieldValues;
        Map<IdentifierSpec, String> identifierMap;
        String str;
        Boolean booleanStrictOrNull;
        PaymentSelection.New.USBankAccount.Input input2;
        String email2;
        Intrinsics.checkNotNullParameter(args, "args");
        Intrinsics.checkNotNullParameter(application, "application");
        Intrinsics.checkNotNullParameter(provider, "lazyPaymentConfig");
        Intrinsics.checkNotNullParameter(savedStateHandle, "savedStateHandle");
        Intrinsics.checkNotNullParameter(addressRepository, "addressRepository");
        this.args = args;
        this.application = application;
        this.lazyPaymentConfig = provider;
        this.savedStateHandle = savedStateHandle;
        PaymentSheet.BillingDetails billingDetails = args.getFormArgs().getBillingDetails();
        this.defaultBillingDetails = billingDetails;
        PaymentSheet.BillingDetailsCollectionConfiguration billingDetailsCollectionConfiguration = args.getFormArgs().getBillingDetailsCollectionConfiguration();
        this.collectionConfiguration = billingDetailsCollectionConfiguration;
        boolean z = args.getFormArgs().getBillingDetailsCollectionConfiguration().getAddress() == PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode.Full;
        this.collectingAddress = z;
        boolean z2 = args.getFormArgs().getBillingDetailsCollectionConfiguration().getPhone() == PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode.Always;
        this.collectingPhone = z2;
        boolean z3 = args.getFormArgs().getBillingDetailsCollectionConfiguration().getName() != PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode.Never;
        this.collectingName = z3;
        boolean z4 = args.getFormArgs().getBillingDetailsCollectionConfiguration().getEmail() != PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode.Never;
        this.collectingEmail = z4;
        if (args.getSavedPaymentMethod() != null) {
            name = args.getSavedPaymentMethod().getInput().getName();
        } else {
            name = ((z3 || billingDetailsCollectionConfiguration.getAttachDefaultsToPaymentMethod()) && billingDetails != null) ? billingDetails.getName() : null;
        }
        this.defaultName = name;
        SimpleTextFieldController createController = NameConfig.INSTANCE.createController(name);
        this.nameController = createController;
        final Flow<FormFieldEntry> formFieldValue = createController.getFormFieldValue();
        USBankAccountFormViewModel uSBankAccountFormViewModel = this;
        this.name = FlowKt.stateIn(new Flow<String>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = formFieldValue.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$1$2", f = "USBankAccountFormViewModel.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        }, ViewModelKt.getViewModelScope(uSBankAccountFormViewModel), SharingStarted.Companion.getEagerly(), name == null ? "" : name);
        if (args.getSavedPaymentMethod() != null) {
            email = args.getSavedPaymentMethod().getInput().getEmail();
        } else {
            email = ((z4 || billingDetailsCollectionConfiguration.getAttachDefaultsToPaymentMethod()) && billingDetails != null) ? billingDetails.getEmail() : null;
        }
        this.defaultEmail = email;
        EmailConfig.Companion companion = EmailConfig.INSTANCE;
        PaymentSelection.New.USBankAccount savedPaymentMethod = args.getSavedPaymentMethod();
        SimpleTextFieldController createController2 = companion.createController((savedPaymentMethod == null || (input2 = savedPaymentMethod.getInput()) == null || (email2 = input2.getEmail()) == null) ? email : email2);
        this.emailController = createController2;
        final Flow<FormFieldEntry> formFieldValue2 = createController2.getFormFieldValue();
        this.email = FlowKt.stateIn(new Flow<String>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = formFieldValue2.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$2$2", f = "USBankAccountFormViewModel.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 r6, kotlin.coroutines.Continuation r7) {
                    throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$2.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        }, ViewModelKt.getViewModelScope(uSBankAccountFormViewModel), SharingStarted.Companion.getEagerly(), email);
        if (args.getSavedPaymentMethod() != null) {
            Address address3 = args.getSavedPaymentMethod().getInput().getAddress();
            if (address3 != null) {
                country = address3.getCountry();
            }
            country = null;
        } else {
            if ((z2 || billingDetailsCollectionConfiguration.getAttachDefaultsToPaymentMethod()) && billingDetails != null && (address = billingDetails.getAddress()) != null) {
                country = address.getCountry();
            }
            country = null;
        }
        this.defaultPhoneCountry = country;
        if (args.getSavedPaymentMethod() != null) {
            phone = args.getSavedPaymentMethod().getInput().getPhone();
        } else {
            phone = ((z2 || billingDetailsCollectionConfiguration.getAttachDefaultsToPaymentMethod()) && billingDetails != null) ? billingDetails.getPhone() : null;
        }
        this.defaultPhone = phone;
        PhoneNumberController phoneNumberController = new PhoneNumberController(phone == null ? "" : phone, country, null, false, 12, null);
        this.phoneController = phoneNumberController;
        final Flow<FormFieldEntry> formFieldValue3 = phoneNumberController.getFormFieldValue();
        this.phone = FlowKt.stateIn(new Flow<String>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = formFieldValue3.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$3$2", f = "USBankAccountFormViewModel.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 r6, kotlin.coroutines.Continuation r7) {
                    throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$3.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        }, ViewModelKt.getViewModelScope(uSBankAccountFormViewModel), SharingStarted.Companion.getEagerly(), phone);
        if (args.getSavedPaymentMethod() != null) {
            asAddressModel = args.getSavedPaymentMethod().getInput().getAddress();
        } else {
            asAddressModel = ((!z && !billingDetailsCollectionConfiguration.getAttachDefaultsToPaymentMethod()) || billingDetails == null || (address2 = billingDetails.getAddress()) == null) ? null : USBankAccountFormViewModelKt.asAddressModel(address2);
        }
        this.defaultAddress = asAddressModel;
        AddressDetails shippingDetails = args.getFormArgs().getShippingDetails();
        SameAsShippingElement sameAsShippingElement = (shippingDetails == null || (identifierMap = AddressDetailsKt.toIdentifierMap(shippingDetails, billingDetails)) == null || (str = identifierMap.get(IdentifierSpec.INSTANCE.getSameAsShipping())) == null || (booleanStrictOrNull = StringsKt.toBooleanStrictOrNull(str)) == null) ? null : new SameAsShippingElement(IdentifierSpec.INSTANCE.getSameAsShipping(), new SameAsShippingController(booleanStrictOrNull.booleanValue()));
        this.sameAsShippingElement = sameAsShippingElement;
        IdentifierSpec Generic = IdentifierSpec.INSTANCE.Generic("billing_details[address]");
        Map<IdentifierSpec, String> emptyMap = (asAddressModel == null || (asFormFieldValues = USBankAccountFormViewModelKt.asFormFieldValues(asAddressModel)) == null) ? MapsKt.emptyMap() : asFormFieldValues;
        AddressType addressType = null;
        Set set = null;
        DropdownFieldController dropdownFieldController = null;
        AddressDetails shippingDetails2 = args.getFormArgs().getShippingDetails();
        IdentifierSpec identifierSpec = null;
        boolean z5 = z4;
        boolean z6 = z3;
        AddressElement addressElement = new AddressElement(Generic, addressRepository, emptyMap, addressType, set, dropdownFieldController, sameAsShippingElement, shippingDetails2 != null ? AddressDetailsKt.toIdentifierMap(shippingDetails2, args.getFormArgs().getBillingDetails()) : null, null, false, 824, null);
        this.addressElement = addressElement;
        if (asAddressModel == null) {
            stateIn = (StateFlow) StateFlowKt.MutableStateFlow((Object) null);
        } else {
            final Flow<List<Pair<IdentifierSpec, FormFieldEntry>>> formFieldValueFlow = addressElement.getFormFieldValueFlow();
            stateIn = FlowKt.stateIn(new Flow<Address>() {
                public Object collect(FlowCollector flowCollector, Continuation continuation) {
                    Object collect = formFieldValueFlow.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$4$2", f = "USBankAccountFormViewModel.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 r7, kotlin.coroutines.Continuation r8) {
                        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$4.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                    }
                }
            }, ViewModelKt.getViewModelScope(uSBankAccountFormViewModel), SharingStarted.Companion.getEagerly(), asAddressModel);
        }
        this.address = stateIn;
        if (z) {
            final Flow<List<IdentifierSpec>> textFieldIdentifiers = addressElement.getTextFieldIdentifiers();
            flowOf = new Flow<IdentifierSpec>() {
                public Object collect(FlowCollector flowCollector, Continuation continuation) {
                    Object collect = textFieldIdentifiers.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$5$2", f = "USBankAccountFormViewModel.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$5.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                    }
                }
            };
        } else if (z2) {
            flowOf = FlowKt.flowOf(IdentifierSpec.INSTANCE.getPhone());
        } else if (z5) {
            flowOf = FlowKt.flowOf(IdentifierSpec.INSTANCE.getEmail());
        } else if (z6) {
            flowOf = FlowKt.flowOf(IdentifierSpec.INSTANCE.getName());
        } else {
            flowOf = FlowKt.flowOf((Object) null);
        }
        this.lastTextFieldIdentifier = flowOf;
        int i2 = 1;
        Flow<PaymentSelection.New.USBankAccount> MutableSharedFlow$default = SharedFlowKt.MutableSharedFlow$default(1, 0, (BufferOverflow) null, 6, (Object) null);
        this._result = MutableSharedFlow$default;
        this.result = MutableSharedFlow$default;
        Flow<CollectBankAccountResultInternal> MutableSharedFlow$default2 = SharedFlowKt.MutableSharedFlow$default(1, 0, (BufferOverflow) null, 6, (Object) null);
        this._collectBankAccountResult = MutableSharedFlow$default2;
        this.collectBankAccountResult = MutableSharedFlow$default2;
        PaymentSelection.New.USBankAccount savedPaymentMethod2 = args.getSavedPaymentMethod();
        boolean saveForFutureUse = (savedPaymentMethod2 == null || (input = savedPaymentMethod2.getInput()) == null) ? false : input.getSaveForFutureUse();
        this.defaultSaveForFutureUse = saveForFutureUse;
        FormElement transform = new SaveForFutureUseSpec(identifierSpec, i2, (DefaultConstructorMarker) identifierSpec).transform(saveForFutureUse, args.getFormArgs().getMerchantName());
        Intrinsics.checkNotNull(transform, "null cannot be cast to non-null type com.stripe.android.ui.core.elements.SaveForFutureUseElement");
        SaveForFutureUseElement saveForFutureUseElement = (SaveForFutureUseElement) transform;
        this.saveForFutureUseElement = saveForFutureUseElement;
        this.saveForFutureUse = FlowKt.stateIn(saveForFutureUseElement.getController().getSaveForFutureUse(), ViewModelKt.getViewModelScope(uSBankAccountFormViewModel), SharingStarted.Companion.getLazily(), Boolean.valueOf(saveForFutureUse));
        StateFlow<USBankAccountFormScreenState> MutableStateFlow = StateFlowKt.MutableStateFlow(determineInitialState());
        this._currentScreenState = MutableStateFlow;
        this.currentScreenState = MutableStateFlow;
        final Flow<FormFieldEntry> formFieldValue4 = createController.getFormFieldValue();
        Flow<Boolean> flow = new Flow<Boolean>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = formFieldValue4.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$6$2", f = "USBankAccountFormViewModel.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$6.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        };
        final Flow<FormFieldEntry> formFieldValue5 = createController2.getFormFieldValue();
        Flow<Boolean> flow2 = new Flow<Boolean>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = formFieldValue5.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$7$2", f = "USBankAccountFormViewModel.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$7.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        };
        final Flow<FormFieldEntry> formFieldValue6 = phoneNumberController.getFormFieldValue();
        Flow<Boolean> flow3 = new Flow<Boolean>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = formFieldValue6.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$8$2", f = "USBankAccountFormViewModel.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$8.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        };
        final Flow<List<Pair<IdentifierSpec, FormFieldEntry>>> formFieldValueFlow2 = addressElement.getFormFieldValueFlow();
        this.requiredFields = FlowKt.stateIn(FlowKt.combine(flow, flow2, flow3, new Flow<Boolean>() {
            public Object collect(FlowCollector flowCollector, Continuation continuation) {
                Object collect = formFieldValueFlow2.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$9$2", f = "USBankAccountFormViewModel.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.paymentdatacollection.ach.USBankAccountFormViewModel$special$$inlined$map$9.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }
        }, new USBankAccountFormViewModel$requiredFields$5(this, null)), ViewModelKt.getViewModelScope(uSBankAccountFormViewModel), SharingStarted.Companion.WhileSubscribed$default(SharingStarted.Companion, 0L, 0L, 3, (Object) null), false);
        BuildersKt.launch$default(ViewModelKt.getViewModelScope(uSBankAccountFormViewModel), (CoroutineContext) null, (CoroutineStart) null, new AnonymousClass1(null), 3, (Object) null);
        PaymentSheet.BillingDetails billingDetails2 = args.getFormArgs().getBillingDetails();
        if ((billingDetails2 != null ? billingDetails2.getName() : null) != null) {
            args.getFormArgs().getBillingDetailsCollectionConfiguration().getAttachDefaultsToPaymentMethod();
        }
        PaymentSheet.BillingDetails billingDetails3 = args.getFormArgs().getBillingDetails();
        if ((billingDetails3 != null ? billingDetails3.getEmail() : null) != null) {
            args.getFormArgs().getBillingDetailsCollectionConfiguration().getAttachDefaultsToPaymentMethod();
        }
    }

    public final TextFieldController getNameController() {
        return this.nameController;
    }

    public final StateFlow<String> getName() {
        return this.name;
    }

    public final TextFieldController getEmailController() {
        return this.emailController;
    }

    public final StateFlow<String> getEmail() {
        return this.email;
    }

    public final PhoneNumberController getPhoneController() {
        return this.phoneController;
    }

    public final StateFlow<String> getPhone() {
        return this.phone;
    }

    public final SameAsShippingElement getSameAsShippingElement() {
        return this.sameAsShippingElement;
    }

    public final AddressElement getAddressElement() {
        return this.addressElement;
    }

    public final StateFlow<Address> getAddress() {
        return this.address;
    }

    public final Flow<IdentifierSpec> getLastTextFieldIdentifier() {
        return this.lastTextFieldIdentifier;
    }

    public final Flow<PaymentSelection.New.USBankAccount> getResult() {
        return this.result;
    }

    public final Flow<CollectBankAccountResultInternal> getCollectBankAccountResult() {
        return this.collectBankAccountResult;
    }

    public final SaveForFutureUseElement getSaveForFutureUseElement() {
        return this.saveForFutureUseElement;
    }

    public final StateFlow<Boolean> getSaveForFutureUse() {
        return this.saveForFutureUse;
    }

    public final StateFlow<USBankAccountFormScreenState> getCurrentScreenState() {
        return this.currentScreenState;
    }

    public final StateFlow<Boolean> getRequiredFields() {
        return this.requiredFields;
    }

    public final CollectBankAccountLauncher getCollectBankAccountLauncher() {
        return this.collectBankAccountLauncher;
    }

    public final void setCollectBankAccountLauncher(CollectBankAccountLauncher collectBankAccountLauncher) {
        this.collectBankAccountLauncher = collectBankAccountLauncher;
    }

    @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.paymentdatacollection.ach.USBankAccountFormViewModel$1", f = "USBankAccountFormViewModel.kt", i = {}, l = {237}, 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 USBankAccountFormViewModel.this.new AnonymousClass1(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);
                Flow<String> rawFieldValue = USBankAccountFormViewModel.this.getAddressElement().getCountryElement().getController().getRawFieldValue();
                final USBankAccountFormViewModel uSBankAccountFormViewModel = USBankAccountFormViewModel.this;
                this.label = 1;
                if (rawFieldValue.collect(new FlowCollector<String>() {
                    public Object emit(Object obj2, Continuation continuation) {
                        return emit((String) obj2, (Continuation<? super Unit>) continuation);
                    }

                    public final Object emit(String str, Continuation<? super Unit> continuation) {
                        if (str != null) {
                            USBankAccountFormViewModel.this.getPhoneController().getCountryDropdownController().onRawValueChange(str);
                        }
                        return Unit.INSTANCE;
                    }
                }, (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;
        }
    }

    private final boolean getHasLaunched() {
        return Intrinsics.areEqual(this.savedStateHandle.get("has_launched"), true);
    }

    private final void setHasLaunched(boolean z) {
        this.savedStateHandle.set("has_launched", Boolean.valueOf(z));
    }

    private final boolean getShouldReset() {
        return Intrinsics.areEqual(this.savedStateHandle.get(SHOULD_RESET_KEY), true);
    }

    private final void setShouldReset(boolean z) {
        this.savedStateHandle.set(SHOULD_RESET_KEY, Boolean.valueOf(z));
    }

    public final void register(ActivityResultRegistryOwner activityResultRegistryOwner) {
        Intrinsics.checkNotNullParameter(activityResultRegistryOwner, "activityResultRegistryOwner");
        this.collectBankAccountLauncher = CollectBankAccountLauncher.INSTANCE.create(activityResultRegistryOwner, new USBankAccountFormViewModel$register$1(this));
    }

    public final void handleCollectBankAccountResult(CollectBankAccountResultInternal result) {
        Object value;
        FinancialConnectionsAccount financialConnectionsAccount;
        String id;
        StripeIntent intent;
        Object value2;
        BankAccount bankAccount;
        String id2;
        StripeIntent intent2;
        Intrinsics.checkNotNullParameter(result, "result");
        setHasLaunched(false);
        this._collectBankAccountResult.tryEmit(result);
        if (result instanceof CollectBankAccountResultInternal.Completed) {
            CollectBankAccountResultInternal.Completed completed = (CollectBankAccountResultInternal.Completed) result;
            BankAccount paymentAccount = completed.getResponse().getFinancialConnectionsSession().getPaymentAccount();
            if (paymentAccount instanceof BankAccount) {
                MutableStateFlow<USBankAccountFormScreenState> mutableStateFlow = this._currentScreenState;
                do {
                    value2 = mutableStateFlow.getValue();
                    bankAccount = paymentAccount;
                    id2 = completed.getResponse().getFinancialConnectionsSession().getId();
                    intent2 = completed.getResponse().getIntent();
                } while (!mutableStateFlow.compareAndSet(value2, new USBankAccountFormScreenState.VerifyWithMicrodeposits(bankAccount, id2, intent2 != null ? intent2.getId() : null, buildPrimaryButtonText(), buildMandateText())));
                return;
            }
            if (!(paymentAccount instanceof FinancialConnectionsAccount)) {
                if (paymentAccount == null) {
                    reset(Integer.valueOf(R.string.stripe_paymentsheet_ach_something_went_wrong));
                    return;
                }
                return;
            }
            MutableStateFlow<USBankAccountFormScreenState> mutableStateFlow2 = this._currentScreenState;
            do {
                value = mutableStateFlow2.getValue();
                financialConnectionsAccount = (FinancialConnectionsAccount) paymentAccount;
                id = completed.getResponse().getFinancialConnectionsSession().getId();
                intent = completed.getResponse().getIntent();
            } while (!mutableStateFlow2.compareAndSet(value, new USBankAccountFormScreenState.MandateCollection(financialConnectionsAccount, id, intent != null ? intent.getId() : null, buildPrimaryButtonText(), buildMandateText())));
            return;
        }
        if (result instanceof CollectBankAccountResultInternal.Failed) {
            reset(Integer.valueOf(R.string.stripe_paymentsheet_ach_something_went_wrong));
        } else if (result instanceof CollectBankAccountResultInternal.Cancelled) {
            reset$default(this, null, 1, null);
        }
    }

    public final void handlePrimaryButtonClick(USBankAccountFormScreenState screenState) {
        USBankAccountFormScreenState.SavedAccount savedAccount;
        String financialConnectionsSessionId;
        Object value;
        Intrinsics.checkNotNullParameter(screenState, "screenState");
        if (screenState instanceof USBankAccountFormScreenState.BillingDetailsCollection) {
            MutableStateFlow<USBankAccountFormScreenState> mutableStateFlow = this._currentScreenState;
            do {
                value = mutableStateFlow.getValue();
            } while (!mutableStateFlow.compareAndSet(value, USBankAccountFormScreenState.BillingDetailsCollection.copy$default((USBankAccountFormScreenState.BillingDetailsCollection) screenState, null, null, true, 3, null)));
            collectBankAccount(this.args.getClientSecret());
            return;
        }
        if (screenState instanceof USBankAccountFormScreenState.MandateCollection) {
            USBankAccountFormScreenState.MandateCollection mandateCollection = (USBankAccountFormScreenState.MandateCollection) screenState;
            updatePaymentSelection(mandateCollection.getFinancialConnectionsSessionId(), mandateCollection.getPaymentAccount().getInstitutionName(), mandateCollection.getPaymentAccount().getLast4());
        } else if (screenState instanceof USBankAccountFormScreenState.VerifyWithMicrodeposits) {
            USBankAccountFormScreenState.VerifyWithMicrodeposits verifyWithMicrodeposits = (USBankAccountFormScreenState.VerifyWithMicrodeposits) screenState;
            updatePaymentSelection(verifyWithMicrodeposits.getFinancialConnectionsSessionId(), verifyWithMicrodeposits.getPaymentAccount().getBankName(), verifyWithMicrodeposits.getPaymentAccount().getLast4());
        } else {
            if (!(screenState instanceof USBankAccountFormScreenState.SavedAccount) || (financialConnectionsSessionId = (savedAccount = (USBankAccountFormScreenState.SavedAccount) screenState).getFinancialConnectionsSessionId()) == null) {
                return;
            }
            updatePaymentSelection(financialConnectionsSessionId, savedAccount.getBankName(), savedAccount.getLast4());
        }
    }

    public static void reset$default(USBankAccountFormViewModel uSBankAccountFormViewModel, Integer num, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            num = null;
        }
        uSBankAccountFormViewModel.reset(num);
    }

    public final void reset(Integer error) {
        Object value;
        String string;
        setHasLaunched(false);
        setShouldReset(false);
        this.saveForFutureUseElement.getController().onValueChange(true);
        this._collectBankAccountResult.tryEmit((Object) null);
        MutableStateFlow<USBankAccountFormScreenState> mutableStateFlow = this._currentScreenState;
        do {
            value = mutableStateFlow.getValue();
            string = this.application.getString(com.stripe.android.ui.core.R.string.stripe_continue_button_label);
            Intrinsics.checkNotNullExpressionValue(string, "application.getString(\n …n_label\n                )");
        } while (!mutableStateFlow.compareAndSet(value, new USBankAccountFormScreenState.BillingDetailsCollection(error, string, false)));
    }

    public final void onDestroy() {
        if (getShouldReset()) {
            reset$default(this, null, 1, null);
        }
        this._result.tryEmit((Object) null);
        this._collectBankAccountResult.tryEmit((Object) null);
        CollectBankAccountLauncher collectBankAccountLauncher = this.collectBankAccountLauncher;
        if (collectBankAccountLauncher != null) {
            collectBankAccountLauncher.unregister();
        }
        this.collectBankAccountLauncher = null;
    }

    public final String formattedMerchantName() {
        String str;
        String merchantName = this.args.getFormArgs().getMerchantName();
        int length = merchantName.length() - 1;
        if (length >= 0) {
            while (true) {
                int i2 = length - 1;
                if (!(merchantName.charAt(length) == '.')) {
                    str = merchantName.subSequence(0, length + 1);
                    break;
                }
                if (i2 < 0) {
                    break;
                }
                length = i2;
            }
        }
        return str.toString();
    }

    private final USBankAccountFormScreenState determineInitialState() {
        if (this.args.getSavedPaymentMethod() != null) {
            return this.args.getSavedPaymentMethod().getScreenState();
        }
        String string = this.application.getString(com.stripe.android.ui.core.R.string.stripe_continue_button_label);
        Intrinsics.checkNotNullExpressionValue(string, "application.getString(\n …n_label\n                )");
        return new USBankAccountFormScreenState.BillingDetailsCollection(null, string, false, 1, null);
    }

    private final void collectBankAccount(String clientSecret) {
        if (getHasLaunched()) {
            return;
        }
        setHasLaunched(true);
        if (clientSecret != null) {
            if (this.args.isPaymentFlow()) {
                CollectBankAccountLauncher collectBankAccountLauncher = this.collectBankAccountLauncher;
                if (collectBankAccountLauncher != null) {
                    collectBankAccountLauncher.presentWithPaymentIntent(this.lazyPaymentConfig.get().getPublishableKey(), this.lazyPaymentConfig.get().getStripeAccountId(), clientSecret, new CollectBankAccountConfiguration.USBankAccount((String) this.name.getValue(), (String) this.email.getValue()));
                    return;
                }
                return;
            }
            CollectBankAccountLauncher collectBankAccountLauncher2 = this.collectBankAccountLauncher;
            if (collectBankAccountLauncher2 != null) {
                collectBankAccountLauncher2.presentWithSetupIntent(this.lazyPaymentConfig.get().getPublishableKey(), this.lazyPaymentConfig.get().getStripeAccountId(), clientSecret, new CollectBankAccountConfiguration.USBankAccount((String) this.name.getValue(), (String) this.email.getValue()));
                return;
            }
            return;
        }
        String stripeIntentId = this.args.getStripeIntentId();
        if (stripeIntentId != null) {
            if (this.args.isPaymentFlow()) {
                CollectBankAccountLauncher collectBankAccountLauncher3 = this.collectBankAccountLauncher;
                if (collectBankAccountLauncher3 != null) {
                    String publishableKey = this.lazyPaymentConfig.get().getPublishableKey();
                    String stripeAccountId = this.lazyPaymentConfig.get().getStripeAccountId();
                    CollectBankAccountConfiguration.USBankAccount uSBankAccount = new CollectBankAccountConfiguration.USBankAccount((String) this.name.getValue(), (String) this.email.getValue());
                    String onBehalfOf = this.args.getOnBehalfOf();
                    Amount amount = this.args.getFormArgs().getAmount();
                    Integer valueOf = amount != null ? Integer.valueOf((int) amount.getValue()) : null;
                    Amount amount2 = this.args.getFormArgs().getAmount();
                    collectBankAccountLauncher3.presentWithDeferredPayment(publishableKey, stripeAccountId, uSBankAccount, stripeIntentId, null, onBehalfOf, valueOf, amount2 != null ? amount2.getCurrencyCode() : null);
                    return;
                }
                return;
            }
            CollectBankAccountLauncher collectBankAccountLauncher4 = this.collectBankAccountLauncher;
            if (collectBankAccountLauncher4 != null) {
                collectBankAccountLauncher4.presentWithDeferredSetup(this.lazyPaymentConfig.get().getPublishableKey(), this.lazyPaymentConfig.get().getStripeAccountId(), new CollectBankAccountConfiguration.USBankAccount((String) this.name.getValue(), (String) this.email.getValue()), stripeIntentId, null, this.args.getOnBehalfOf());
            }
        }
    }

    private final void updatePaymentSelection(String linkAccountId, String bankName, String last4) {
        if (bankName == null || last4 == null) {
            return;
        }
        this._result.tryEmit(createNewPaymentSelection(last4, bankName, linkAccountId));
        setShouldReset(true);
    }

    private final PaymentSelection.New.USBankAccount createNewPaymentSelection(String last4, String bankName, String linkAccountId) {
        PaymentSelection.CustomerRequestedSave customerRequestedSave = USBankAccountFormViewModelKt.customerRequestedSave(this.args.getFormArgs().getShowCheckbox(), ((Boolean) this.saveForFutureUse.getValue()).booleanValue());
        String string = this.application.getString(R.string.stripe_paymentsheet_payment_method_item_card_number, new Object[]{last4});
        int invoke = TransformToBankIcon.INSTANCE.invoke(bankName);
        PaymentMethodCreateParams create$default = PaymentMethodCreateParams.Companion.create$default(PaymentMethodCreateParams.INSTANCE, new PaymentMethodCreateParams.USBankAccount(linkAccountId), new PaymentMethod.BillingDetails((Address) this.address.getValue(), (String) this.email.getValue(), (String) this.name.getValue(), (String) this.phone.getValue()), (Map) null, 4, (Object) null);
        PaymentMethodOptionsParams.USBankAccount uSBankAccount = new PaymentMethodOptionsParams.USBankAccount(customerRequestedSave.getSetupFutureUsage());
        USBankAccountFormScreenState uSBankAccountFormScreenState = (USBankAccountFormScreenState) this.currentScreenState.getValue();
        PaymentSelection.New.USBankAccount.Input input = new PaymentSelection.New.USBankAccount.Input((String) this.name.getValue(), (String) this.email.getValue(), (String) this.phone.getValue(), (Address) this.address.getValue(), ((Boolean) this.saveForFutureUse.getValue()).booleanValue());
        Intrinsics.checkNotNullExpressionValue(string, "getString(\n             …      last4\n            )");
        return new PaymentSelection.New.USBankAccount(string, invoke, input, uSBankAccountFormScreenState, create$default, customerRequestedSave, uSBankAccount, null, 128, null);
    }

    private final String buildPrimaryButtonText() {
        if (this.args.isCompleteFlow()) {
            if (this.args.isPaymentFlow()) {
                Amount amount = this.args.getFormArgs().getAmount();
                Intrinsics.checkNotNull(amount);
                Resources resources = this.application.getResources();
                Intrinsics.checkNotNullExpressionValue(resources, "application.resources");
                return amount.buildPayButtonLabel(resources);
            }
            String string = this.application.getString(com.stripe.android.ui.core.R.string.stripe_setup_button_label);
            Intrinsics.checkNotNullExpressionValue(string, "{\n                    ap…      )\n                }");
            return string;
        }
        String string2 = this.application.getString(com.stripe.android.ui.core.R.string.stripe_continue_button_label);
        Intrinsics.checkNotNullExpressionValue(string2, "application.getString(\n …utton_label\n            )");
        return string2;
    }

    private final String buildMandateText() {
        return ACHText.INSTANCE.getContinueMandateText(this.application, formattedMerchantName(), ((Boolean) this.saveForFutureUse.getValue()).booleanValue(), !this.args.isPaymentFlow());
    }

    @Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B\u0013\u0012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\u0002\u0010\u0005J-\u0010\u0006\u001a\u0002H\u0007\"\b\b\u0000\u0010\u0007*\u00020\b2\f\u0010\t\u001a\b\u0012\u0004\u0012\u0002H\u00070\n2\u0006\u0010\u000b\u001a\u00020\fH\u0016¢\u0006\u0002\u0010\rR\u0014\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormViewModel$Factory;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "argsSupplier", "Lkotlin/Function0;", "Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormViewModel$Args;", "(Lkotlin/jvm/functions/Function0;)V", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "extras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Ljava/lang/Class;Landroidx/lifecycle/viewmodel/CreationExtras;)Landroidx/lifecycle/ViewModel;", "paymentsheet_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Factory implements ViewModelProvider.Factory {
        private final Function0<Args> argsSupplier;

        public Factory(Function0<Args> function0) {
            Intrinsics.checkNotNullParameter(function0, "argsSupplier");
            this.argsSupplier = function0;
        }

        public <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras) {
            Intrinsics.checkNotNullParameter(modelClass, "modelClass");
            Intrinsics.checkNotNullParameter(extras, "extras");
            USBankAccountFormViewModel viewModel = DaggerUSBankAccountFormComponent.builder().application(CreationExtrasKtxKt.requireApplication(extras)).build().getSubComponentBuilderProvider().get().configuration((Args) this.argsSupplier.invoke()).savedStateHandle(SavedStateHandleSupport.createSavedStateHandle(extras)).build().getViewModel();
            Intrinsics.checkNotNull(viewModel, "null cannot be cast to non-null type T of com.stripe.android.paymentsheet.paymentdatacollection.ach.USBankAccountFormViewModel.Factory.create");
            return viewModel;
        }
    }

    @Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0018\n\u0002\u0010\b\n\u0002\b\u0002\b\u0087\b\u0018\u00002\u00020\u0001BO\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0005\u0012\b\u0010\u0007\u001a\u0004\u0018\u00010\b\u0012\b\u0010\t\u001a\u0004\u0018\u00010\b\u0012\b\u0010\n\u001a\u0004\u0018\u00010\b\u0012\b\u0010\u000b\u001a\u0004\u0018\u00010\f\u0012\b\u0010\r\u001a\u0004\u0018\u00010\u000e¢\u0006\u0002\u0010\u000fJ\t\u0010\u001b\u001a\u00020\u0003HÆ\u0003J\t\u0010\u001c\u001a\u00020\u0005HÆ\u0003J\t\u0010\u001d\u001a\u00020\u0005HÆ\u0003J\u000b\u0010\u001e\u001a\u0004\u0018\u00010\bHÆ\u0003J\u000b\u0010\u001f\u001a\u0004\u0018\u00010\bHÆ\u0003J\u000b\u0010 \u001a\u0004\u0018\u00010\bHÆ\u0003J\u000b\u0010!\u001a\u0004\u0018\u00010\fHÆ\u0003J\u000b\u0010\"\u001a\u0004\u0018\u00010\u000eHÆ\u0003Jc\u0010#\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00052\n\b\u0002\u0010\u0007\u001a\u0004\u0018\u00010\b2\n\b\u0002\u0010\t\u001a\u0004\u0018\u00010\b2\n\b\u0002\u0010\n\u001a\u0004\u0018\u00010\b2\n\b\u0002\u0010\u000b\u001a\u0004\u0018\u00010\f2\n\b\u0002\u0010\r\u001a\u0004\u0018\u00010\u000eHÆ\u0001J\u0013\u0010$\u001a\u00020\u00052\b\u0010%\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010&\u001a\u00020'HÖ\u0001J\t\u0010(\u001a\u00020\bHÖ\u0001R\u0013\u0010\t\u001a\u0004\u0018\u00010\b¢\u0006\b\n\u0000\u001a\u0004\b\u0010\u0010\u0011R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0012\u0010\u0013R\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0004\u0010\u0014R\u0011\u0010\u0006\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0014R\u0013\u0010\n\u001a\u0004\u0018\u00010\b¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010\u0011R\u0013\u0010\u000b\u001a\u0004\u0018\u00010\f¢\u0006\b\n\u0000\u001a\u0004\b\u0016\u0010\u0017R\u0013\u0010\r\u001a\u0004\u0018\u00010\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u0018\u0010\u0019R\u0013\u0010\u0007\u001a\u0004\u0018\u00010\b¢\u0006\b\n\u0000\u001a\u0004\b\u001a\u0010\u0011¨\u0006)"}, d2 = {"Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormViewModel$Args;", "", "formArgs", "Lcom/stripe/android/paymentsheet/paymentdatacollection/FormArguments;", "isCompleteFlow", "", "isPaymentFlow", "stripeIntentId", "", "clientSecret", "onBehalfOf", "savedPaymentMethod", "Lcom/stripe/android/paymentsheet/model/PaymentSelection$New$USBankAccount;", "shippingDetails", "Lcom/stripe/android/paymentsheet/addresselement/AddressDetails;", "(Lcom/stripe/android/paymentsheet/paymentdatacollection/FormArguments;ZZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/paymentsheet/model/PaymentSelection$New$USBankAccount;Lcom/stripe/android/paymentsheet/addresselement/AddressDetails;)V", "getClientSecret", "()Ljava/lang/String;", "getFormArgs", "()Lcom/stripe/android/paymentsheet/paymentdatacollection/FormArguments;", "()Z", "getOnBehalfOf", "getSavedPaymentMethod", "()Lcom/stripe/android/paymentsheet/model/PaymentSelection$New$USBankAccount;", "getShippingDetails", "()Lcom/stripe/android/paymentsheet/addresselement/AddressDetails;", "getStripeIntentId", "component1", "component2", "component3", "component4", "component5", "component6", "component7", "component8", "copy", "equals", "other", "hashCode", "", "toString", "paymentsheet_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Args {
        public static final int $stable = 8;
        private final String clientSecret;
        private final FormArguments formArgs;
        private final boolean isCompleteFlow;
        private final boolean isPaymentFlow;
        private final String onBehalfOf;
        private final PaymentSelection.New.USBankAccount savedPaymentMethod;
        private final AddressDetails shippingDetails;
        private final String stripeIntentId;

        public final FormArguments getFormArgs() {
            return this.formArgs;
        }

        public final boolean getIsCompleteFlow() {
            return this.isCompleteFlow;
        }

        public final boolean getIsPaymentFlow() {
            return this.isPaymentFlow;
        }

        public final String getStripeIntentId() {
            return this.stripeIntentId;
        }

        public final String getClientSecret() {
            return this.clientSecret;
        }

        public final String getOnBehalfOf() {
            return this.onBehalfOf;
        }

        public final PaymentSelection.New.USBankAccount getSavedPaymentMethod() {
            return this.savedPaymentMethod;
        }

        public final AddressDetails getShippingDetails() {
            return this.shippingDetails;
        }

        public final Args copy(FormArguments formArgs, boolean isCompleteFlow, boolean isPaymentFlow, String stripeIntentId, String clientSecret, String onBehalfOf, PaymentSelection.New.USBankAccount savedPaymentMethod, AddressDetails shippingDetails) {
            Intrinsics.checkNotNullParameter(formArgs, "formArgs");
            return new Args(formArgs, isCompleteFlow, isPaymentFlow, stripeIntentId, clientSecret, onBehalfOf, savedPaymentMethod, shippingDetails);
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if (!(other instanceof Args)) {
                return false;
            }
            Args args = (Args) other;
            return Intrinsics.areEqual(this.formArgs, args.formArgs) && this.isCompleteFlow == args.isCompleteFlow && this.isPaymentFlow == args.isPaymentFlow && Intrinsics.areEqual(this.stripeIntentId, args.stripeIntentId) && Intrinsics.areEqual(this.clientSecret, args.clientSecret) && Intrinsics.areEqual(this.onBehalfOf, args.onBehalfOf) && Intrinsics.areEqual(this.savedPaymentMethod, args.savedPaymentMethod) && Intrinsics.areEqual(this.shippingDetails, args.shippingDetails);
        }

        public int hashCode() {
            int hashCode = this.formArgs.hashCode() * 31;
            boolean z = this.isCompleteFlow;
            int i2 = z;
            if (z != 0) {
                i2 = 1;
            }
            int i3 = (hashCode + i2) * 31;
            boolean z2 = this.isPaymentFlow;
            int i4 = (i3 + (z2 ? 1 : z2 ? 1 : 0)) * 31;
            String str = this.stripeIntentId;
            int hashCode2 = (i4 + (str == null ? 0 : str.hashCode())) * 31;
            String str2 = this.clientSecret;
            int hashCode3 = (hashCode2 + (str2 == null ? 0 : str2.hashCode())) * 31;
            String str3 = this.onBehalfOf;
            int hashCode4 = (hashCode3 + (str3 == null ? 0 : str3.hashCode())) * 31;
            PaymentSelection.New.USBankAccount uSBankAccount = this.savedPaymentMethod;
            int hashCode5 = (hashCode4 + (uSBankAccount == null ? 0 : uSBankAccount.hashCode())) * 31;
            AddressDetails addressDetails = this.shippingDetails;
            return hashCode5 + (addressDetails != null ? addressDetails.hashCode() : 0);
        }

        public String toString() {
            return "Args(formArgs=" + this.formArgs + ", isCompleteFlow=" + this.isCompleteFlow + ", isPaymentFlow=" + this.isPaymentFlow + ", stripeIntentId=" + this.stripeIntentId + ", clientSecret=" + this.clientSecret + ", onBehalfOf=" + this.onBehalfOf + ", savedPaymentMethod=" + this.savedPaymentMethod + ", shippingDetails=" + this.shippingDetails + ")";
        }

        public Args(FormArguments formArguments, boolean z, boolean z2, String str, String str2, String str3, PaymentSelection.New.USBankAccount uSBankAccount, AddressDetails addressDetails) {
            Intrinsics.checkNotNullParameter(formArguments, "formArgs");
            this.formArgs = formArguments;
            this.isCompleteFlow = z;
            this.isPaymentFlow = z2;
            this.stripeIntentId = str;
            this.clientSecret = str2;
            this.onBehalfOf = str3;
            this.savedPaymentMethod = uSBankAccount;
            this.shippingDetails = addressDetails;
        }

        public final FormArguments getFormArgs() {
            return this.formArgs;
        }

        public final boolean isCompleteFlow() {
            return this.isCompleteFlow;
        }

        public final boolean isPaymentFlow() {
            return this.isPaymentFlow;
        }

        public final String getStripeIntentId() {
            return this.stripeIntentId;
        }

        public final String getClientSecret() {
            return this.clientSecret;
        }

        public final String getOnBehalfOf() {
            return this.onBehalfOf;
        }

        public final PaymentSelection.New.USBankAccount getSavedPaymentMethod() {
            return this.savedPaymentMethod;
        }

        public final AddressDetails getShippingDetails() {
            return this.shippingDetails;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\b\u0082\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000¨\u0006\u0006"}, d2 = {"Lcom/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountFormViewModel$Companion;", "", "()V", "HAS_LAUNCHED_KEY", "", "SHOULD_RESET_KEY", "paymentsheet_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    private static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }
    }
}