<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright 2024 Signal Messenger, LLC
  ~ SPDX-License-Identifier: AGPL-3.0-only
  -->

<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/checkout_flow"
    app:startDestination="@id/donateToSignalFragment">

    <!-- region Unified Checkout -->

    <dialog
        android:id="@+id/stripePaymentInProgressFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.stripe.StripePaymentInProgressFragment"
        android:label="stripe_payment_in_progress_fragment"
        tools:layout="@layout/donation_in_progress_fragment">

        <argument
            android:name="action"
            app:argType="org.thoughtcrime.securesms.components.settings.app.subscription.donate.InAppPaymentProcessorAction"
            app:nullable="false" />

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="true" />

        <argument
            android:name="is_long_running"
            android:defaultValue="false"
            app:argType="boolean" />
        <action
            android:id="@+id/action_stripePaymentInProgressFragment_to_stripe3dsDialogFragment"
            app:destination="@id/stripe3dsDialogFragment" />
    </dialog>

    <fragment
        android:id="@+id/creditCardFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.card.CreditCardFragment"
        android:label="credit_card_fragment"
        tools:layout="@layout/credit_card_fragment">

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="false" />

        <action
            android:id="@+id/action_creditCardFragment_to_yourInformationIsPrivateBottomSheet"
            app:destination="@id/yourInformationIsPrivateBottomSheet" />
        <action
            android:id="@+id/action_creditCardFragment_to_stripePaymentInProgressFragment"
            app:destination="@id/stripePaymentInProgressFragment" />
    </fragment>

    <dialog
        android:id="@+id/stripe3dsDialogFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.stripe.Stripe3DSDialogFragment"
        android:label="stripe_3ds_dialog_fragment"
        tools:layout="@layout/donation_webview_fragment">

        <argument
            android:name="uri"
            app:argType="android.net.Uri"
            app:nullable="false" />

        <argument
            android:name="return_uri"
            app:argType="android.net.Uri"
            app:nullable="false" />

        <argument
            android:name="waiting_for_auth_payment"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPayment"
            app:nullable="false" />
    </dialog>

    <dialog
        android:id="@+id/yourInformationIsPrivateBottomSheet"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.card.YourInformationIsPrivateBottomSheet"
        android:label="your_information_is_private_bottom_sheet"
        tools:layout="@layout/dsl_settings_bottom_sheet" />

    <dialog
        android:id="@+id/paypalPaymentInProgressFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.paypal.PayPalPaymentInProgressFragment"
        android:label="paypal_payment_in_progress"
        tools:layout="@layout/donation_in_progress_fragment">

        <argument
            android:name="action"
            app:argType="org.thoughtcrime.securesms.components.settings.app.subscription.donate.InAppPaymentProcessorAction"
            app:nullable="false" />

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="true" />

        <action
            android:id="@+id/action_paypalPaymentInProgressFragment_to_paypalConfirmationFragment"
            app:destination="@id/paypalConfirmationFragment" />
        <action
            android:id="@+id/action_paypalPaymentInProgressFragment_to_paypalCompleteOrderBottomSheet"
            app:destination="@id/paypalCompleteOrderBottomSheet" />
    </dialog>

    <dialog
        android:id="@+id/paypalConfirmationFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.paypal.PayPalConfirmationDialogFragment"
        android:label="paypal_confirmation_dialog_fragment"
        tools:layout="@layout/donation_webview_fragment">

        <argument
            android:name="uri"
            app:argType="android.net.Uri"
            app:nullable="false" />

    </dialog>

    <dialog
        android:id="@+id/paypalCompleteOrderBottomSheet"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.paypal.PayPalCompleteOrderBottomSheet"
        android:label="paypal_complete_order_bottom_sheet"
        tools:layout="@layout/dsl_settings_bottom_sheet">

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="false" />
    </dialog>

    <fragment
        android:id="@+id/bankTransferMandateFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.transfer.mandate.BankTransferMandateFragment"
        android:label="bank_transfer_mandate_fragment">

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="false" />
        <action
            android:id="@+id/action_bankTransferMandateFragment_to_bankTransferDetailsFragment"
            app:destination="@id/bankTransferDetailsFragment" />
        <action
            android:id="@+id/action_bankTransferMandateFragment_to_yourInformationIsPrivateBottomSheet"
            app:destination="@id/yourInformationIsPrivateBottomSheet" />
        <action
            android:id="@+id/action_bankTransferMandateFragment_to_idealTransferDetailsFragment"
            app:destination="@id/idealTransferDetailsFragment" />
    </fragment>

    <fragment
        android:id="@+id/bankTransferDetailsFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.transfer.details.BankTransferDetailsFragment"
        android:label="bank_transfer_details_fragment">

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="false" />
        <action
            android:id="@+id/action_bankTransferDetailsFragment_to_stripePaymentInProgressFragment"
            app:destination="@id/stripePaymentInProgressFragment" />
        <action
            android:id="@+id/action_bankTransferDetailsFragment_to_yourInformationIsPrivateBottomSheet"
            app:destination="@id/yourInformationIsPrivateBottomSheet" />
    </fragment>

    <dialog
        android:id="@+id/donationPendingBottomSheet"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.DonationPendingBottomSheet"
        android:label="donation_pending_bottom_sheet"
        tools:layout="@layout/dsl_settings_bottom_sheet">

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="false" />
    </dialog>

    <fragment
        android:id="@+id/idealTransferDetailsFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.transfer.ideal.IdealTransferDetailsFragment"
        android:label="ideal_transfer_details_fragment">

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="false" />
        <action
            android:id="@+id/action_bankTransferDetailsFragment_to_stripePaymentInProgressFragment"
            app:destination="@id/stripePaymentInProgressFragment" />
        <action
            android:id="@+id/action_bankTransferDetailsFragment_to_yourInformationIsPrivateBottomSheet"
            app:destination="@id/yourInformationIsPrivateBottomSheet" />
        <action
            android:id="@+id/action_idealTransferDetailsFragment_to_idealTransferBankSelectionDialogFragment"
            app:destination="@id/idealTransferBankSelectionDialogFragment" />
    </fragment>

    <dialog
        android:id="@+id/idealTransferBankSelectionDialogFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.transfer.ideal.IdealTransferDetailsBankSelectionDialogFragment"
        android:label="ideal_transfer_bank_selection" />

    <!-- endregion -->

    <!-- region DonateToSignal -->

    <fragment
        android:id="@+id/donateToSignalFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.DonateToSignalFragment"
        android:label="donate_to_signal_fragment"
        tools:layout="@layout/dsl_settings_fragment">

        <argument
            android:name="start_type"
            app:argType="org.signal.donations.InAppPaymentType"
            app:nullable="false" />

        <action
            android:id="@+id/action_donateToSignalFragment_to_setCurrencyFragment"
            app:destination="@id/setCurrencyFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit" />

        <action
            android:id="@+id/action_donateToSignalFragment_to_gatewaySelectorBottomSheetDialog"
            app:destination="@id/gatewaySelectorBottomSheet" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_thanksForYourSupportBottomSheetDialog"
            app:destination="@id/thanksForYourSupportBottomSheetDialog" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_subscribeLearnMoreBottomSheetDialog"
            app:destination="@id/subscribeLearnMoreBottomSheetDialog" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_creditCardFragment"
            app:destination="@id/creditCardFragment" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_stripePaymentInProgressFragment"
            app:destination="@id/stripePaymentInProgressFragment" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_paypalPaymentInProgressFragment"
            app:destination="@id/paypalPaymentInProgressFragment" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_bankTransferMandateFragment"
            app:destination="@id/bankTransferMandateFragment" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_donationPendingBottomSheet"
            app:destination="@id/donationPendingBottomSheet" />
        <action
            android:id="@+id/action_donateToSignalFragment_to_idealTransferDetailsFragment"
            app:destination="@id/idealTransferDetailsFragment" />
    </fragment>

    <dialog
        android:id="@+id/gatewaySelectorBottomSheet"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.donate.gateway.GatewaySelectorBottomSheet"
        android:label="gateway_selector_bottom_sheet"
        tools:layout="@layout/dsl_settings_bottom_sheet">

        <argument
            android:name="in_app_payment_id"
            app:argType="org.thoughtcrime.securesms.database.InAppPaymentTable$InAppPaymentId"
            app:nullable="false" />

    </dialog>

    <dialog
        android:id="@+id/setCurrencyFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.currency.SetCurrencyFragment"
        android:label="set_currency_fragment"
        tools:layout="@layout/dsl_settings_fragment">

        <argument
            android:name="inAppPaymentType"
            app:argType="org.signal.donations.InAppPaymentType" />

        <argument
            android:name="supportedCurrencyCodes"
            app:argType="string[]" />
    </dialog>

    <dialog
        android:id="@+id/thanksForYourSupportBottomSheetDialog"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.thanks.ThanksForYourSupportBottomSheetDialogFragment"
        android:label="thanks_for_your_support_bottom_sheet_dialog"
        tools:layout="@layout/thanks_for_your_support_bottom_sheet_dialog_fragment">

        <argument
            android:name="badge"
            app:argType="org.thoughtcrime.securesms.badges.models.Badge"
            app:nullable="false" />

    </dialog>

    <dialog
        android:id="@+id/subscribeLearnMoreBottomSheetDialog"
        android:name="org.thoughtcrime.securesms.components.settings.app.subscription.subscribe.SubscribeLearnMoreBottomSheetDialogFragment"
        android:label="subscribe_learn_more_bottom_sheet_dialog"
        tools:layout="@layout/subscribe_learn_more_bottom_sheet_dialog_fragment" />

    <!-- endregion -->

    <!-- region GiftFlow -->

    <!-- endregion -->
</navigation>