导航菜单

页面标题

页面副标题

Brevistay v5.8.2 - BookingDetailsHolidaFragment.java 源代码

正在查看: Brevistay v5.8.2 应用的 BookingDetailsHolidaFragment.java JAVA 源代码文件

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


package com.brevistay.app.view.booking.fragments.holida;

import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.text.Editable;
import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextWatcher;
import android.util.Log;
import android.util.Patterns;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.navigation.NavArgsLazy;
import androidx.navigation.fragment.FragmentKt;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.brevistay.app.databinding.FragmentBookingDetails2Binding;
import com.brevistay.app.models.booking_model.hotel_availabilty.BillSummaryTotal;
import com.brevistay.app.models.booking_model.hotel_availabilty.BillSummaryV2;
import com.brevistay.app.models.booking_model.hotel_availabilty.HotelAvailabiltyBody;
import com.brevistay.app.models.booking_model.hotel_availabilty.HotelAvailabiltyRes;
import com.brevistay.app.models.booking_model.hotel_availabilty.OvernightAvailableRoomsArray;
import com.brevistay.app.models.booking_model.hotel_availabilty.RatePlan;
import com.brevistay.app.models.booking_model.pre_booking_check.body.preBookingCheckBody;
import com.brevistay.app.models.booking_model.pre_booking_check.response.RoomData;
import com.brevistay.app.models.booking_model.pre_booking_check.response.preBookingCheckRes;
import com.brevistay.app.models.login_model.login.LoginResFromPass;
import com.brevistay.app.models.user_profile.UserProfileRes;
import com.brevistay.app.repositories.HotelAvailabiltyRepo;
import com.brevistay.app.view.booking.BillSummaryAdapter;
import com.brevistay.app.view.booking.CouponTncAdapter;
import com.brevistay.app.view.booking.bottom_sheet.RatePlanDetailsBottomSheet;
import com.brevistay.app.view.booking.fragments.holida.BookingDetailsHolidaFragmentDirections;
import com.brevistay.app.view.utils.CheckInternet;
import com.brevistay.app.view.utils.TimeUtils;
import com.brevistay.app.viewmodels.booking_viewmodel.BookingViewModel;
import com.bumptech.glide.Glide;
import com.facebook.appevents.AppEventsConstants;
import com.facebook.appevents.internal.ViewHierarchyConstants;
import com.facebook.internal.ServerProtocol;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import in.juspay.services.HyperServices;
import j$.time.LocalDateTime;
import j$.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.LazyThreadSafetyMode;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.Reflection;
import kotlin.text.Regex;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Dispatchers;
import org.json.JSONObject;
import org.koin.android.ext.android.AndroidKoinScopeExtKt;
import org.koin.core.qualifier.Qualifier;
import org.koin.viewmodel.GetViewModelKt;

@Metadata(d1 = {"\u0000¦\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\u001f\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0010\n\u0002\u0018\u0002\n\u0002\b\u000e\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0012\u0010i\u001a\u00020j2\b\u0010k\u001a\u0004\u0018\u00010lH\u0016J$\u0010m\u001a\u00020n2\u0006\u0010o\u001a\u00020p2\b\u0010q\u001a\u0004\u0018\u00010r2\b\u0010k\u001a\u0004\u0018\u00010lH\u0016J\u001a\u0010s\u001a\u00020j2\u0006\u0010t\u001a\u00020n2\b\u0010k\u001a\u0004\u0018\u00010lH\u0017J\b\u0010u\u001a\u00020jH\u0002J\b\u0010v\u001a\u00020jH\u0016J\b\u0010w\u001a\u00020jH\u0016J\b\u0010x\u001a\u00020\u0012H\u0002J\b\u0010y\u001a\u00020jH\u0003J \u0010z\u001a\u00020D2\u0006\u0010{\u001a\u00020D2\u0006\u0010|\u001a\u00020\n2\u0006\u0010}\u001a\u00020\nH\u0002J\b\u0010~\u001a\u00020jH\u0002J\b\u0010\u007f\u001a\u00020DH\u0002J\t\u0010\u0080\u0001\u001a\u00020jH\u0016J\t\u0010\u0081\u0001\u001a\u00020jH\u0016J\f\u0010\u0082\u0001\u001a\u00020j*\u00030\u0083\u0001J\t\u0010\u0084\u0001\u001a\u00020\u0012H\u0002J\t\u0010\u0085\u0001\u001a\u00020\u0012H\u0002J\t\u0010\u0086\u0001\u001a\u00020\u0012H\u0002J\u0010\u0010\u0087\u0001\u001a\u00020D2\u0007\u0010\u0088\u0001\u001a\u00020DJ\u0010\u0010\u0089\u0001\u001a\u00020D2\u0007\u0010\u008a\u0001\u001a\u00020DJ\u0010\u0010\u008b\u0001\u001a\u00020D2\u0007\u0010\u008a\u0001\u001a\u00020DJ\u0010\u0010\u008c\u0001\u001a\u00020D2\u0007\u0010\u008d\u0001\u001a\u00020DJ\u0010\u0010\u008e\u0001\u001a\u00020D2\u0007\u0010\u008d\u0001\u001a\u00020DJ\u0018\u0010\u008f\u0001\u001a\u00020j2\r\u0010\u0090\u0001\u001a\b\u0012\u0004\u0012\u00020D0eH\u0002R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0006\u001a\u00020\u00058BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0007\u0010\bR\u001a\u0010\t\u001a\u00020\nX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u000e\u0010\u000f\u001a\u00020\u0010X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0012X\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u0013\u001a\u00020\u00148BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0017\u0010\u0018\u001a\u0004\b\u0015\u0010\u0016R\u000e\u0010\u0019\u001a\u00020\u0014X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001a\u001a\u00020\u001bX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001c\u001a\u00020\u001bX\u0082.¢\u0006\u0002\n\u0000R\u001a\u0010\u001d\u001a\u00020\u001eX\u0086.¢\u0006\u000e\n\u0000\u001a\u0004\b\u001f\u0010 \"\u0004\b!\u0010\"R\u001a\u0010#\u001a\u00020\nX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b$\u0010\f\"\u0004\b%\u0010\u000eR\u001b\u0010&\u001a\u00020'8FX\u0086\u0084\u0002¢\u0006\f\n\u0004\b*\u0010+\u001a\u0004\b(\u0010)R\u0010\u0010,\u001a\u0004\u0018\u00010-X\u0082\u000e¢\u0006\u0002\n\u0000R\u001c\u0010.\u001a\u0004\u0018\u00010/X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b0\u00101\"\u0004\b2\u00103R\u001c\u00104\u001a\u0004\u0018\u000105X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b6\u00107\"\u0004\b8\u00109R\u001a\u0010:\u001a\u00020\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b;\u0010<\"\u0004\b=\u0010>R\u000e\u0010?\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010@\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010A\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R*\u0010B\u001a\u0012\u0012\u0004\u0012\u00020D0Cj\b\u0012\u0004\u0012\u00020D`EX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bF\u0010G\"\u0004\bH\u0010IR\u001a\u0010J\u001a\u00020\nX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bK\u0010\f\"\u0004\bL\u0010\u000eR\u001a\u0010M\u001a\u00020DX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bN\u0010O\"\u0004\bP\u0010QR\u001a\u0010R\u001a\u00020DX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bS\u0010O\"\u0004\bT\u0010QR\u001a\u0010U\u001a\u00020\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bV\u0010<\"\u0004\bW\u0010>R\u001a\u0010X\u001a\u00020\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bY\u0010<\"\u0004\bZ\u0010>R\u001a\u0010[\u001a\u00020DX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\\\u0010O\"\u0004\b]\u0010QR\u001a\u0010^\u001a\u00020\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b_\u0010<\"\u0004\b`\u0010>R\u000e\u0010a\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010b\u001a\u00020DX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010c\u001a\u00020DX\u0082.¢\u0006\u0002\n\u0000R\u0014\u0010d\u001a\b\u0012\u0004\u0012\u00020f0eX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010g\u001a\u00020hX\u0082.¢\u0006\u0002\n\u0000¨\u0006\u0091\u0001"}, d2 = {"Lcom/brevistay/app/view/booking/fragments/holida/BookingDetailsHolidaFragment;", "Landroidx/fragment/app/Fragment;", "<init>", "()V", "_binding", "Lcom/brevistay/app/databinding/FragmentBookingDetails2Binding;", "binding", "getBinding", "()Lcom/brevistay/app/databinding/FragmentBookingDetails2Binding;", "scrollflag", "", "getScrollflag", "()I", "setScrollflag", "(I)V", "sharedPreferences", "Landroid/content/SharedPreferences;", "editVisible", "", "viewmodel", "Lcom/brevistay/app/viewmodels/booking_viewmodel/BookingViewModel;", "getViewmodel", "()Lcom/brevistay/app/viewmodels/booking_viewmodel/BookingViewModel;", "viewmodel$delegate", "Lkotlin/Lazy;", "viewmodel2", "repository2", "Lcom/brevistay/app/repositories/HotelAvailabiltyRepo;", "repository3", "dialog", "Lcom/google/android/material/bottomsheet/BottomSheetDialog;", "getDialog", "()Lcom/google/android/material/bottomsheet/BottomSheetDialog;", "setDialog", "(Lcom/google/android/material/bottomsheet/BottomSheetDialog;)V", "previousPack", "getPreviousPack", "setPreviousPack", "args", "Lcom/brevistay/app/view/booking/fragments/holida/BookingDetailsHolidaFragmentArgs;", "getArgs", "()Lcom/brevistay/app/view/booking/fragments/holida/BookingDetailsHolidaFragmentArgs;", "args$delegate", "Landroidx/navigation/NavArgsLazy;", "preBookingCheckBody", "Lcom/brevistay/app/models/booking_model/pre_booking_check/body/preBookingCheckBody;", "hyperServicesHolder", "Lin/juspay/services/HyperServices;", "getHyperServicesHolder", "()Lin/juspay/services/HyperServices;", "setHyperServicesHolder", "(Lin/juspay/services/HyperServices;)V", "initiatePayload", "Lorg/json/JSONObject;", "getInitiatePayload", "()Lorg/json/JSONObject;", "setInitiatePayload", "(Lorg/json/JSONObject;)V", "firstcall_to_coupon", "getFirstcall_to_coupon", "()Z", "setFirstcall_to_coupon", "(Z)V", "rooms", "adults", "child", "timeArr", "Ljava/util/ArrayList;", "", "Lkotlin/collections/ArrayList;", "getTimeArr", "()Ljava/util/ArrayList;", "setTimeArr", "(Ljava/util/ArrayList;)V", "use_wallet", "getUse_wallet", "setUse_wallet", "token", "getToken", "()Ljava/lang/String;", "setToken", "(Ljava/lang/String;)V", "DateStr", "getDateStr", "setDateStr", "Call", "getCall", "setCall", "flag", "getFlag", "setFlag", "refundable", "getRefundable", "setRefundable", "CTAClicked", "getCTAClicked", "setCTAClicked", "whatsappOptIn", "tempName", "wallet_pre_applicable", "billItems", "", "Lcom/brevistay/app/models/booking_model/hotel_availabilty/BillSummaryV2;", "mBillSummaryAdapter", "Lcom/brevistay/app/view/booking/BillSummaryAdapter;", "onCreate", "", "savedInstanceState", "Landroid/os/Bundle;", "onCreateView", "Landroid/view/View;", "inflater", "Landroid/view/LayoutInflater;", "container", "Landroid/view/ViewGroup;", "onViewCreated", ViewHierarchyConstants.VIEW_KEY, "updateWhatsAppSwitch", "onResume", "onPause", "checkIsUserDeleted", "vibrate", "getCheckOutDate", "value", "pack", "time", "setCheckInOutTime", "getcheckinStr", "onDestroyView", "onDestroy", "scrollToBottom", "Landroidx/core/widget/NestedScrollView;", "checkName", "checkNumber", "checkEmail", "extractLastWord", "input", "extractDate", "dateTime", "extractTime", "formatToShortDate", "dateTimeString", "formatTo12HourTime", "showCancellationPolicyBottomSheet", "policies", "app_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class BookingDetailsHolidaFragment extends Fragment {
    private boolean CTAClicked;
    private boolean Call;
    private String DateStr;
    private FragmentBookingDetails2Binding _binding;
    private int adults;

    private final NavArgsLazy args;
    private List<BillSummaryV2> billItems;
    private int child;
    public BottomSheetDialog dialog;
    private boolean editVisible;
    private boolean firstcall_to_coupon;
    private boolean flag;
    private HyperServices hyperServicesHolder;
    private JSONObject initiatePayload;
    private BillSummaryAdapter mBillSummaryAdapter;
    private preBookingCheckBody preBookingCheckBody;
    private int previousPack;
    private String refundable;
    private HotelAvailabiltyRepo repository2;
    private HotelAvailabiltyRepo repository3;
    private int rooms;
    private int scrollflag;
    private SharedPreferences sharedPreferences;
    private String tempName;
    private ArrayList<String> timeArr;
    private String token;
    private int use_wallet;

    private final Lazy viewmodel;
    private BookingViewModel viewmodel2;
    private String wallet_pre_applicable;
    private int whatsappOptIn;

    private final void setCheckInOutTime() {
    }

    public BookingDetailsHolidaFragment() {
        final BookingDetailsHolidaFragment bookingDetailsHolidaFragment = this;
        final Function0<FragmentActivity> function0 = new Function0<FragmentActivity>() {
            public final FragmentActivity m116invoke() {
                return bookingDetailsHolidaFragment.requireActivity();
            }
        };
        final Qualifier qualifier = null;
        final Function0 function02 = null;
        final Function0 function03 = null;
        this.viewmodel = LazyKt.lazy(LazyThreadSafetyMode.NONE, new Function0<BookingViewModel>() {
            public final BookingViewModel m117invoke() {
                CreationExtras defaultViewModelCreationExtras;
                ComponentCallbacks componentCallbacks = bookingDetailsHolidaFragment;
                Qualifier qualifier2 = qualifier;
                Function0 function04 = function0;
                Function0 function05 = function02;
                Function0 function06 = function03;
                ComponentActivity componentActivity = (ViewModelStoreOwner) function04.invoke();
                ViewModelStore viewModelStore = componentActivity.getViewModelStore();
                if (function05 == null || (defaultViewModelCreationExtras = (CreationExtras) function05.invoke()) == null) {
                    ComponentActivity componentActivity2 = componentActivity instanceof ComponentActivity ? componentActivity : null;
                    if (componentActivity2 != null) {
                        defaultViewModelCreationExtras = componentActivity2.getDefaultViewModelCreationExtras();
                    } else {
                        defaultViewModelCreationExtras = componentCallbacks.getDefaultViewModelCreationExtras();
                        Intrinsics.checkNotNullExpressionValue(defaultViewModelCreationExtras, "<get-defaultViewModelCreationExtras>(...)");
                    }
                }
                return GetViewModelKt.resolveViewModel$default(Reflection.getOrCreateKotlinClass(BookingViewModel.class), viewModelStore, (String) null, defaultViewModelCreationExtras, qualifier2, AndroidKoinScopeExtKt.getKoinScope(componentCallbacks), function06, 4, (Object) null);
            }
        });
        this.args = new NavArgsLazy(Reflection.getOrCreateKotlinClass(BookingDetailsHolidaFragmentArgs.class), new Function0<Bundle>() {
            {
                super(0);
            }

            public final Bundle m118invoke() {
                Bundle arguments = bookingDetailsHolidaFragment.getArguments();
                if (arguments != null) {
                    return arguments;
                }
                throw new IllegalStateException("Fragment " + bookingDetailsHolidaFragment + " has null arguments");
            }
        });
        this.firstcall_to_coupon = true;
        this.rooms = 1;
        this.adults = 2;
        this.timeArr = new ArrayList<>();
        this.token = "";
        this.DateStr = "";
        this.refundable = "";
        this.whatsappOptIn = 1;
    }

    private final FragmentBookingDetails2Binding getBinding() {
        FragmentBookingDetails2Binding fragmentBookingDetails2Binding = this._binding;
        Intrinsics.checkNotNull(fragmentBookingDetails2Binding);
        return fragmentBookingDetails2Binding;
    }

    public final int getScrollflag() {
        return this.scrollflag;
    }

    public final void setScrollflag(int i) {
        this.scrollflag = i;
    }

    public final BookingViewModel getViewmodel() {
        return (BookingViewModel) this.viewmodel.getValue();
    }

    public final BottomSheetDialog getDialog() {
        BottomSheetDialog bottomSheetDialog = this.dialog;
        if (bottomSheetDialog != null) {
            return bottomSheetDialog;
        }
        Intrinsics.throwUninitializedPropertyAccessException("dialog");
        return null;
    }

    public final void setDialog(BottomSheetDialog bottomSheetDialog) {
        Intrinsics.checkNotNullParameter(bottomSheetDialog, "<set-?>");
        this.dialog = bottomSheetDialog;
    }

    public final int getPreviousPack() {
        return this.previousPack;
    }

    public final void setPreviousPack(int i) {
        this.previousPack = i;
    }

    public final BookingDetailsHolidaFragmentArgs getArgs() {
        return (BookingDetailsHolidaFragmentArgs) this.args.getValue();
    }

    public final HyperServices getHyperServicesHolder() {
        return this.hyperServicesHolder;
    }

    public final void setHyperServicesHolder(HyperServices hyperServices) {
        this.hyperServicesHolder = hyperServices;
    }

    public final JSONObject getInitiatePayload() {
        return this.initiatePayload;
    }

    public final void setInitiatePayload(JSONObject jSONObject) {
        this.initiatePayload = jSONObject;
    }

    public final boolean getFirstcall_to_coupon() {
        return this.firstcall_to_coupon;
    }

    public final void setFirstcall_to_coupon(boolean z) {
        this.firstcall_to_coupon = z;
    }

    public final ArrayList<String> getTimeArr() {
        return this.timeArr;
    }

    public final void setTimeArr(ArrayList<String> arrayList) {
        Intrinsics.checkNotNullParameter(arrayList, "<set-?>");
        this.timeArr = arrayList;
    }

    public final int getUse_wallet() {
        return this.use_wallet;
    }

    public final void setUse_wallet(int i) {
        this.use_wallet = i;
    }

    public final String getToken() {
        return this.token;
    }

    public final void setToken(String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.token = str;
    }

    public final String getDateStr() {
        return this.DateStr;
    }

    public final void setDateStr(String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.DateStr = str;
    }

    public final boolean getCall() {
        return this.Call;
    }

    public final void setCall(boolean z) {
        this.Call = z;
    }

    public final boolean getFlag() {
        return this.flag;
    }

    public final void setFlag(boolean z) {
        this.flag = z;
    }

    public final String getRefundable() {
        return this.refundable;
    }

    public final void setRefundable(String str) {
        Intrinsics.checkNotNullParameter(str, "<set-?>");
        this.refundable = str;
    }

    public final boolean getCTAClicked() {
        return this.CTAClicked;
    }

    public final void setCTAClicked(boolean z) {
        this.CTAClicked = z;
    }

    public void onCreate(Bundle savedInstanceState) {
        int intValue;
        super.onCreate(savedInstanceState);
        SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext().getApplicationContext());
        this.sharedPreferences = defaultSharedPreferences;
        if (defaultSharedPreferences == null) {
            Intrinsics.throwUninitializedPropertyAccessException("sharedPreferences");
            defaultSharedPreferences = null;
        }
        this.wallet_pre_applicable = String.valueOf(defaultSharedPreferences.getString("wallet_pre_applicable", AppEventsConstants.EVENT_PARAM_VALUE_YES));
        SharedPreferences sharedPreferences = this.sharedPreferences;
        if (sharedPreferences == null) {
            Intrinsics.throwUninitializedPropertyAccessException("sharedPreferences");
            sharedPreferences = null;
        }
        this.token = String.valueOf(sharedPreferences.getString("token", ""));
        String str = this.wallet_pre_applicable;
        if (str == null) {
            Intrinsics.throwUninitializedPropertyAccessException("wallet_pre_applicable");
            str = null;
        }
        if (Intrinsics.areEqual(str, "false")) {
            intValue = 0;
        } else {
            if (!Intrinsics.areEqual(str, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE)) {
                String str2 = this.wallet_pre_applicable;
                if (str2 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("wallet_pre_applicable");
                    str2 = null;
                }
                Integer intOrNull = StringsKt.toIntOrNull(str2);
                if (intOrNull != null) {
                    intValue = intOrNull.intValue();
                }
            }
            intValue = 1;
        }
        getViewmodel().is_wallet().setValue(Integer.valueOf(intValue));
        LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this).launchWhenResumed(new BookingDetailsHolidaFragment$onCreate$1(this, null));
    }

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        Intrinsics.checkNotNullParameter(inflater, "inflater");
        this._binding = FragmentBookingDetails2Binding.inflate(inflater, container, false);
        View root = getBinding().getRoot();
        Intrinsics.checkNotNullExpressionValue(root, "getRoot(...)");
        return root;
    }

    public void onViewCreated(View view, Bundle savedInstanceState) {
        Intrinsics.checkNotNullParameter(view, ViewHierarchyConstants.VIEW_KEY);
        super.onViewCreated(view, savedInstanceState);
        final Ref.IntRef intRef = new Ref.IntRef();
        SharedPreferences sharedPreferences = this.sharedPreferences;
        if (sharedPreferences == null) {
            Intrinsics.throwUninitializedPropertyAccessException("sharedPreferences");
            sharedPreferences = null;
        }
        intRef.element = sharedPreferences.getInt("wallet_balance", 0);
        if (Intrinsics.areEqual(getViewmodel().getShould_apply_wallet_after_coupon().getValue(), true)) {
            getBinding().walletLayout.performClick();
        }
        if (isAdded()) {
            setDialog(new BottomSheetDialog(requireContext()));
            updateWhatsAppSwitch();
            getBinding().whatsappCont.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$0(BookingDetailsHolidaFragment.this, view2);
                }
            });
            final String str = "https://www.brevistay.com/privacy-app-load";
            getBinding().privacyPolicy.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$1(str, this, view2);
                }
            });
            final String str2 = "https://www.brevistay.com/terms-app-load";
            getBinding().termsAndCond.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$2(str2, this, view2);
                }
            });
            final String str3 = "https://staging.sandbox.brevistay.com/contact";
            getBinding().helpandsupp.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$3(str3, this, view2);
                }
            });
            getBinding().tvViewPolicy.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$6(BookingDetailsHolidaFragment.this, view2);
                }
            });
            getBinding().holidaHotelDetails.setVisibility(0);
            getBinding().roomCategoryLayout.setVisibility(8);
            getBinding().bookingRoomSlot.setVisibility(8);
            getBinding().bookingViewCancPolicy.setVisibility(8);
            getBinding().selectSlotContainer.setVisibility(8);
            getBinding().checkinCont.setVisibility(8);
            getBinding().guestCountCont.setVisibility(8);
            getViewmodel().getUserDetails().observe(requireActivity(), new BookingDetailsHolidaFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
                public final Object invoke(Object obj) {
                    Unit onViewCreated$lambda$7;
                    onViewCreated$lambda$7 = BookingDetailsHolidaFragment.onViewCreated$lambda$7(BookingDetailsHolidaFragment.this, (LoginResFromPass) obj);
                    return onViewCreated$lambda$7;
                }
            }));
            getViewmodel().getPreBookingCheck().observe(requireActivity(), new BookingDetailsHolidaFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
                public final Object invoke(Object obj) {
                    Unit onViewCreated$lambda$10;
                    onViewCreated$lambda$10 = BookingDetailsHolidaFragment.onViewCreated$lambda$10(BookingDetailsHolidaFragment.this, (preBookingCheckRes) obj);
                    return onViewCreated$lambda$10;
                }
            }));
            getViewmodel().getPreBookingCheckBody().observe(requireActivity(), new BookingDetailsHolidaFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
                public final Object invoke(Object obj) {
                    Unit onViewCreated$lambda$11;
                    onViewCreated$lambda$11 = BookingDetailsHolidaFragment.onViewCreated$lambda$11(BookingDetailsHolidaFragment.this, (preBookingCheckBody) obj);
                    return onViewCreated$lambda$11;
                }
            }));
            EditText editText = getBinding().bookingNameEditText;
            Intrinsics.checkNotNullExpressionValue(editText, "bookingNameEditText");
            editText.addTextChangedListener(new TextWatcher() {
                @Override
                public void afterTextChanged(Editable s) {
                }

                @Override
                public void beforeTextChanged(CharSequence text, int start, int count, int after) {
                }

                @Override
                public void onTextChanged(CharSequence text, int start, int before, int count) {
                    if (Intrinsics.areEqual(text, "")) {
                        text.length();
                    }
                }
            });
            EditText editText2 = getBinding().bookingPhnEdittext;
            Intrinsics.checkNotNullExpressionValue(editText2, "bookingPhnEdittext");
            editText2.addTextChangedListener(new TextWatcher() {
                @Override
                public void afterTextChanged(Editable s) {
                }

                @Override
                public void beforeTextChanged(CharSequence text, int start, int count, int after) {
                }

                @Override
                public void onTextChanged(CharSequence text, int start, int before, int count) {
                    if (Intrinsics.areEqual(text, "")) {
                        text.length();
                    }
                }
            });
            EditText editText3 = getBinding().bookingEmailEdittext;
            Intrinsics.checkNotNullExpressionValue(editText3, "bookingEmailEdittext");
            editText3.addTextChangedListener(new TextWatcher() {
                @Override
                public void afterTextChanged(Editable s) {
                }

                @Override
                public void beforeTextChanged(CharSequence text, int start, int count, int after) {
                }

                @Override
                public void onTextChanged(CharSequence text, int start, int before, int count) {
                    if (Intrinsics.areEqual(text, "")) {
                        text.length();
                    }
                }
            });
            getBinding().bookingNameEditText.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$15(BookingDetailsHolidaFragment.this, view2);
                }
            });
            getBinding().bookingNameEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public final void onFocusChange(View view2, boolean z) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$17(BookingDetailsHolidaFragment.this, view2, z);
                }
            });
            getBinding().bookingPhnEdittext.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$18(BookingDetailsHolidaFragment.this, view2);
                }
            });
            getBinding().bookingPhnEdittext.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public final void onFocusChange(View view2, boolean z) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$20(BookingDetailsHolidaFragment.this, view2, z);
                }
            });
            getBinding().bookingEmailEdittext.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$21(BookingDetailsHolidaFragment.this, view2);
                }
            });
            getBinding().bookingEmailEdittext.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public final void onFocusChange(View view2, boolean z) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$23(BookingDetailsHolidaFragment.this, view2, z);
                }
            });
            getViewmodel().getCheckInDate().observe(requireActivity(), new BookingDetailsHolidaFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
                public final Object invoke(Object obj) {
                    Unit onViewCreated$lambda$24;
                    onViewCreated$lambda$24 = BookingDetailsHolidaFragment.onViewCreated$lambda$24(BookingDetailsHolidaFragment.this, (String) obj);
                    return onViewCreated$lambda$24;
                }
            }));
            getBinding().couponSuccessRemove.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$25(BookingDetailsHolidaFragment.this, view2);
                }
            });
            getBinding().ApplyCouponLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$26(BookingDetailsHolidaFragment.this, view2);
                }
            });
            if (this.use_wallet == 0) {
                getBinding().WalletCheckAnimation.setVisibility(8);
                getBinding().bookingUseWalletCheckBox.setVisibility(0);
            } else {
                getBinding().WalletCheckAnimation.setVisibility(0);
                getBinding().bookingUseWalletCheckBox.setVisibility(8);
            }
            if (intRef.element == 0) {
                getBinding().bookingWalletLayout0credits.setVisibility(0);
                getBinding().bookingWalletLayout.setVisibility(8);
                getBinding().constraintLayout20.setVisibility(8);
            } else {
                getBinding().bookingWalletLayout0credits.setVisibility(8);
                getBinding().bookingWalletLayout.setVisibility(0);
                getBinding().bookingWalletLayout.setText("Apply " + intRef.element + " Wallet Credits");
                getBinding().constraintLayout20.setVisibility(0);
            }
            getBinding().walletLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$27(BookingDetailsHolidaFragment.this, intRef, view2);
                }
            });
            getBinding().toolbar.setNavigationOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view2) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$28(BookingDetailsHolidaFragment.this, view2);
                }
            });
            getBinding().bookingNameEditText.setFilters(new InputFilter[]{new InputFilter() {
                @Override
                public final CharSequence filter(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
                    CharSequence onViewCreated$lambda$29;
                    onViewCreated$lambda$29 = BookingDetailsHolidaFragment.onViewCreated$lambda$29(charSequence, i, i2, spanned, i3, i4);
                    return onViewCreated$lambda$29;
                }
            }});
        }
    }

    public static final void onViewCreated$lambda$0(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        bookingDetailsHolidaFragment.whatsappOptIn = bookingDetailsHolidaFragment.whatsappOptIn == 1 ? 0 : 1;
        bookingDetailsHolidaFragment.updateWhatsAppSwitch();
    }

    public static final void onViewCreated$lambda$1(String str, BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        try {
            BookingDetailsHolidaFragmentDirections.ActionBookingDetailsHolidaFragmentToWebFragment2 actionBookingDetailsHolidaFragmentToWebFragment2 = BookingDetailsHolidaFragmentDirections.actionBookingDetailsHolidaFragmentToWebFragment2(str, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
            Intrinsics.checkNotNullExpressionValue(actionBookingDetailsHolidaFragmentToWebFragment2, "actionBookingDetailsHoli…agmentToWebFragment2(...)");
            FragmentKt.findNavController(bookingDetailsHolidaFragment).navigate(actionBookingDetailsHolidaFragmentToWebFragment2);
        } catch (Exception unused) {
        }
    }

    public static final void onViewCreated$lambda$2(String str, BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        try {
            BookingDetailsHolidaFragmentDirections.ActionBookingDetailsHolidaFragmentToWebFragment2 actionBookingDetailsHolidaFragmentToWebFragment2 = BookingDetailsHolidaFragmentDirections.actionBookingDetailsHolidaFragmentToWebFragment2(str, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
            Intrinsics.checkNotNullExpressionValue(actionBookingDetailsHolidaFragmentToWebFragment2, "actionBookingDetailsHoli…agmentToWebFragment2(...)");
            FragmentKt.findNavController(bookingDetailsHolidaFragment).navigate(actionBookingDetailsHolidaFragmentToWebFragment2);
        } catch (Exception unused) {
        }
    }

    public static final void onViewCreated$lambda$3(String str, BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        try {
            BookingDetailsHolidaFragmentDirections.ActionBookingDetailsHolidaFragmentToWebFragment2 actionBookingDetailsHolidaFragmentToWebFragment2 = BookingDetailsHolidaFragmentDirections.actionBookingDetailsHolidaFragmentToWebFragment2(str, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
            Intrinsics.checkNotNullExpressionValue(actionBookingDetailsHolidaFragmentToWebFragment2, "actionBookingDetailsHoli…agmentToWebFragment2(...)");
            FragmentKt.findNavController(bookingDetailsHolidaFragment).navigate(actionBookingDetailsHolidaFragmentToWebFragment2);
        } catch (Exception unused) {
        }
    }

    public static final void onViewCreated$lambda$6(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        RatePlan ratePlan;
        OvernightAvailableRoomsArray overnightAvailableRoomsArray = (OvernightAvailableRoomsArray) bookingDetailsHolidaFragment.getViewmodel().getOvernightAvailableRoomsArray().getValue();
        if (overnightAvailableRoomsArray == null || (ratePlan = (RatePlan) bookingDetailsHolidaFragment.getViewmodel().getRatePlan().getValue()) == null) {
            return;
        }
        new RatePlanDetailsBottomSheet(overnightAvailableRoomsArray, ratePlan).show(bookingDetailsHolidaFragment.getChildFragmentManager(), "ratePlanDetails");
    }

    public static final Unit onViewCreated$lambda$7(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, LoginResFromPass loginResFromPass) {
        String str = null;
        if (loginResFromPass != null) {
            bookingDetailsHolidaFragment.token = String.valueOf(loginResFromPass.getToken());
            String str2 = loginResFromPass.getUser_first_name() + " " + loginResFromPass.getUser_last_name();
            bookingDetailsHolidaFragment.tempName = str2;
            if (str2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("tempName");
                str2 = null;
            }
            Log.d("tempName", str2);
            EditText editText = bookingDetailsHolidaFragment.getBinding().bookingNameEditText;
            String str3 = bookingDetailsHolidaFragment.tempName;
            if (str3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("tempName");
            } else {
                str = str3;
            }
            editText.setText(str, TextView.BufferType.EDITABLE);
            bookingDetailsHolidaFragment.getBinding().bookingPhnEdittext.setText(loginResFromPass.getUser_mobile_number(), TextView.BufferType.EDITABLE);
            bookingDetailsHolidaFragment.getBinding().bookingEmailEdittext.setText(loginResFromPass.getUser_email_id(), TextView.BufferType.EDITABLE);
        } else {
            BuildersKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getIO()), (CoroutineContext) null, (CoroutineStart) null, new BookingDetailsHolidaFragment$onViewCreated$6$1(bookingDetailsHolidaFragment, null), 3, (Object) null);
        }
        return Unit.INSTANCE;
    }

    public static final Unit onViewCreated$lambda$10(final BookingDetailsHolidaFragment bookingDetailsHolidaFragment, final preBookingCheckRes prebookingcheckres) {
        BillSummaryTotal billSummaryTotal;
        BillSummaryTotal billSummaryTotal2;
        BillSummaryTotal billSummaryTotal3;
        BillSummaryTotal billSummaryTotal4;
        BillSummaryTotal billSummaryTotal5;
        BillSummaryTotal billSummaryTotal6;
        if (prebookingcheckres != null) {
            bookingDetailsHolidaFragment.getBinding().bookingProgress.setVisibility(8);
            bookingDetailsHolidaFragment.getBinding().bookingContinueTxt.setVisibility(0);
            Log.d("preBookingCheck observe", String.valueOf(prebookingcheckres));
            Log.d("preBookingCheck observe cp", String.valueOf(prebookingcheckres.getData().getCoupon_code()));
            bookingDetailsHolidaFragment.getBinding().bookingHotelName.setText(prebookingcheckres.getData().getProperty_data().getP_data().getHotelName());
            Glide.with(bookingDetailsHolidaFragment.getBinding().bookingHotlDetailImg).load((String) prebookingcheckres.getData().getProperty_data().getProperty_images().get(0)).into(bookingDetailsHolidaFragment.getBinding().bookingHotlDetailImg);
            bookingDetailsHolidaFragment.getBinding().bookingHotelAdd.setText(prebookingcheckres.getData().getProperty_data().getP_data().getHotelAddress());
            bookingDetailsHolidaFragment.getBinding().tvNights.setText(prebookingcheckres.getData().getNight_count());
            bookingDetailsHolidaFragment.getBinding().tvRoomType.setText(((RoomData) prebookingcheckres.getData().getRoom_data().get(0)).getR_data().getOb_rc_room_name());
            bookingDetailsHolidaFragment.getBinding().tvRoomDesc.setText(((com.brevistay.app.models.booking_model.pre_booking_check.response.RatePlan) ((RoomData) prebookingcheckres.getData().getRoom_data().get(0)).getR_data().getRate_plans().get(0)).getOb_rp_name());
            bookingDetailsHolidaFragment.getBinding().tvCheckInDate.setText(bookingDetailsHolidaFragment.formatToShortDate(prebookingcheckres.getData().getCheckin()));
            bookingDetailsHolidaFragment.getBinding().tvCheckInTime.setText(bookingDetailsHolidaFragment.formatTo12HourTime(prebookingcheckres.getData().getCheckin()));
            bookingDetailsHolidaFragment.getBinding().tvCheckOutDate.setText(bookingDetailsHolidaFragment.formatToShortDate(prebookingcheckres.getData().getCheckout()));
            bookingDetailsHolidaFragment.getBinding().tvCheckOutTime.setText(bookingDetailsHolidaFragment.formatTo12HourTime(prebookingcheckres.getData().getCheckout()));
            String hotel_category = prebookingcheckres.getData().getProperty_data().getP_data().getHotel_category();
            if (Intrinsics.areEqual(hotel_category, "premium")) {
                bookingDetailsHolidaFragment.getBinding().premiumHotelTag.setVisibility(0);
            } else if (Intrinsics.areEqual(hotel_category, "luxury")) {
                bookingDetailsHolidaFragment.getBinding().luxuryHotelTag.setVisibility(0);
            }
            Integer num = (Integer) bookingDetailsHolidaFragment.getViewmodel().getRoomCount().getValue();
            int intValue = num != null ? num.intValue() : prebookingcheckres.getData().getRoom_data().size();
            Integer num2 = (Integer) bookingDetailsHolidaFragment.getViewmodel().getGuestCount().getValue();
            int intValue2 = num2 != null ? num2.intValue() : ((RoomData) prebookingcheckres.getData().getRoom_data().get(0)).getAdults();
            bookingDetailsHolidaFragment.getBinding().tvRoomGuest.setText(intValue + " Rooms, " + intValue2 + " Guests");
            if (prebookingcheckres.getData().getProperty_data().getP_data().getRating() != null) {
                bookingDetailsHolidaFragment.getBinding().badgeRating.rating.setText(prebookingcheckres.getData().getProperty_data().getP_data().getRating().toString());
                if (prebookingcheckres.getData().getProperty_data().getP_data().getHar_review_count() != null) {
                    bookingDetailsHolidaFragment.getBinding().badgeRating.rating.setText(prebookingcheckres.getData().getProperty_data().getP_data().getHar_review_count().toString());
                }
            } else {
                bookingDetailsHolidaFragment.getBinding().badgeRating.getRoot().setVisibility(8);
            }
            if (Intrinsics.areEqual(prebookingcheckres.getData().getProperty_data().getP_data().getApplicable_discounts_for_hotel(), "NO_DISCOUNT") || Intrinsics.areEqual(prebookingcheckres.getData().getProperty_data().getP_data().getApplicable_discounts_for_hotel(), "COUPON_CODE")) {
                bookingDetailsHolidaFragment.getBinding().bookingWalletLayout.setVisibility(8);
                bookingDetailsHolidaFragment.getBinding().bookingUseWalletCheckBox.setVisibility(8);
                bookingDetailsHolidaFragment.getBinding().WalletCheckAnimation.setVisibility(8);
                bookingDetailsHolidaFragment.getBinding().constraintLayout20.setVisibility(8);
                bookingDetailsHolidaFragment.getBinding().bookingWalletLayoutNotApplicable.setVisibility(0);
                bookingDetailsHolidaFragment.getBinding().bookingWalletLayout0credits.setVisibility(8);
            } else if (!Intrinsics.areEqual(prebookingcheckres.getData().getProperty_data().getP_data().getApplicable_discounts_for_hotel(), "COUPON_N_WALLET")) {
                Intrinsics.areEqual(prebookingcheckres.getData().getProperty_data().getP_data().getApplicable_discounts_for_hotel(), "WALLET_CREDITS");
            }
            bookingDetailsHolidaFragment.getBinding().rvBillItems.setLayoutManager(new LinearLayoutManager(bookingDetailsHolidaFragment.getContext()));
            List bill_summary_v2 = prebookingcheckres.getData().getBill_summary_v2();
            Context requireContext = bookingDetailsHolidaFragment.requireContext();
            Intrinsics.checkNotNullExpressionValue(requireContext, "requireContext(...)");
            bookingDetailsHolidaFragment.mBillSummaryAdapter = new BillSummaryAdapter(bill_summary_v2, requireContext, FragmentKt.findNavController(bookingDetailsHolidaFragment));
            RecyclerView recyclerView = bookingDetailsHolidaFragment.getBinding().rvBillItems;
            BillSummaryAdapter billSummaryAdapter = bookingDetailsHolidaFragment.mBillSummaryAdapter;
            String str = null;
            if (billSummaryAdapter == null) {
                Intrinsics.throwUninitializedPropertyAccessException("mBillSummaryAdapter");
                billSummaryAdapter = null;
            }
            recyclerView.setAdapter(billSummaryAdapter);
            bookingDetailsHolidaFragment.getBinding().rvBillItems.setVisibility(0);
            TextView textView = bookingDetailsHolidaFragment.getBinding().totalItemName;
            List bill_summary_total = prebookingcheckres.getData().getBill_summary_total();
            textView.setText((bill_summary_total == null || (billSummaryTotal6 = (BillSummaryTotal) bill_summary_total.get(0)) == null) ? null : billSummaryTotal6.getItem());
            TextView textView2 = bookingDetailsHolidaFragment.getBinding().totalItemName;
            List bill_summary_total2 = prebookingcheckres.getData().getBill_summary_total();
            textView2.setTextColor(Color.parseColor((bill_summary_total2 == null || (billSummaryTotal5 = (BillSummaryTotal) bill_summary_total2.get(0)) == null) ? null : billSummaryTotal5.getItem_text_colour()));
            TextView textView3 = bookingDetailsHolidaFragment.getBinding().totalItemValue;
            List bill_summary_total3 = prebookingcheckres.getData().getBill_summary_total();
            textView3.setText((bill_summary_total3 == null || (billSummaryTotal4 = (BillSummaryTotal) bill_summary_total3.get(0)) == null) ? null : billSummaryTotal4.getValue());
            TextView textView4 = bookingDetailsHolidaFragment.getBinding().totalItemValue;
            List bill_summary_total4 = prebookingcheckres.getData().getBill_summary_total();
            textView4.setTextColor(Color.parseColor((bill_summary_total4 == null || (billSummaryTotal3 = (BillSummaryTotal) bill_summary_total4.get(0)) == null) ? null : billSummaryTotal3.getValue_text_colour()));
            TextView textView5 = bookingDetailsHolidaFragment.getBinding().totalSubDesc;
            List bill_summary_total5 = prebookingcheckres.getData().getBill_summary_total();
            textView5.setText((bill_summary_total5 == null || (billSummaryTotal2 = (BillSummaryTotal) bill_summary_total5.get(0)) == null) ? null : billSummaryTotal2.getTotal_sub_desc());
            TextView textView6 = bookingDetailsHolidaFragment.getBinding().totalSubDesc;
            List bill_summary_total6 = prebookingcheckres.getData().getBill_summary_total();
            if (bill_summary_total6 != null && (billSummaryTotal = (BillSummaryTotal) bill_summary_total6.get(0)) != null) {
                str = billSummaryTotal.getTotal_sub_desc_text_colour();
            }
            textView6.setTextColor(Color.parseColor(str));
            if (prebookingcheckres.getData().getWallet_applied() == 1) {
                Log.d("walletfix", "it.wallet_applied == 1");
                bookingDetailsHolidaFragment.getBinding().WalletCheckAnimation.setVisibility(0);
                bookingDetailsHolidaFragment.use_wallet = 1;
            } else {
                bookingDetailsHolidaFragment.getBinding().WalletCheckAnimation.setVisibility(8);
                bookingDetailsHolidaFragment.getBinding().walletError.setVisibility(8);
                bookingDetailsHolidaFragment.use_wallet = 0;
            }
            bookingDetailsHolidaFragment.getBinding().countLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$10$lambda$9(BookingDetailsHolidaFragment.this, prebookingcheckres, view);
                }
            });
            if (prebookingcheckres.getData().is_wallet() == 1 && prebookingcheckres.getData().getWallet_applied() == 1) {
                bookingDetailsHolidaFragment.getBinding().bookingWalletLayout.setText(prebookingcheckres.getData().getWallet_amount() + " Wallet Credits Applied");
                bookingDetailsHolidaFragment.getBinding().bookingWalletLayout.setTextColor(Color.parseColor("#FF8502"));
            } else {
                bookingDetailsHolidaFragment.getBinding().bookingWalletLayout.setText("Apply " + prebookingcheckres.getData().getWallet_amount() + " Wallet Credits");
                bookingDetailsHolidaFragment.getBinding().bookingWalletLayout.setTextColor(Color.parseColor("#332E3D"));
            }
            if (prebookingcheckres.getData().getCoupon_success() == 1) {
                Log.d("available", "copon success");
                bookingDetailsHolidaFragment.getViewmodel().getCouponFlag().setValue(1);
                TextView textView7 = bookingDetailsHolidaFragment.getBinding().couponSuccessTitle;
                if (textView7 != null) {
                    textView7.setText(bookingDetailsHolidaFragment.getViewmodel().getCoupon().getValue() + " applied");
                }
                TextView textView8 = bookingDetailsHolidaFragment.getBinding().couponSuccessBenefit;
                if (textView8 != null) {
                    textView8.setText(prebookingcheckres.getData().getCoupon_msg());
                }
                LinearLayout linearLayout = bookingDetailsHolidaFragment.getBinding().couponLayoutBlank;
                if (linearLayout != null) {
                    linearLayout.setVisibility(8);
                }
                ConstraintLayout constraintLayout = bookingDetailsHolidaFragment.getBinding().couponLayoutSuccess;
                if (constraintLayout != null) {
                    constraintLayout.setVisibility(0);
                }
            } else {
                Log.d("available", "copon error");
                bookingDetailsHolidaFragment.getViewmodel().getCouponFlag().setValue(0);
                LinearLayout linearLayout2 = bookingDetailsHolidaFragment.getBinding().couponLayoutBlank;
                if (linearLayout2 != null) {
                    linearLayout2.setVisibility(0);
                }
                ConstraintLayout constraintLayout2 = bookingDetailsHolidaFragment.getBinding().couponLayoutSuccess;
                if (constraintLayout2 != null) {
                    constraintLayout2.setVisibility(8);
                }
            }
        }
        return Unit.INSTANCE;
    }

    public static final void onViewCreated$lambda$10$lambda$9(final BookingDetailsHolidaFragment bookingDetailsHolidaFragment, preBookingCheckRes prebookingcheckres, View view) {
        CharSequence trim;
        Integer num = null;
        String str = null;
        num = null;
        if (bookingDetailsHolidaFragment.checkName()) {
            if (bookingDetailsHolidaFragment.checkNumber()) {
                if (bookingDetailsHolidaFragment.checkEmail()) {
                    Intent intent = new Intent(bookingDetailsHolidaFragment.requireContext(), (Class<?>) HolidaJuspayActivity.class);
                    Integer num2 = (Integer) bookingDetailsHolidaFragment.getViewmodel().getAdult_count().getValue();
                    intent.putExtra("adults", num2 != null ? num2.intValue() : ((RoomData) prebookingcheckres.getData().getRoom_data().get(0)).getAdults());
                    String coupon_code = prebookingcheckres.getData().getCoupon_code();
                    if (coupon_code == null) {
                        coupon_code = (String) bookingDetailsHolidaFragment.getViewmodel().getCoupon().getValue();
                    }
                    intent.putExtra("coupon_code", coupon_code);
                    Integer num3 = (Integer) bookingDetailsHolidaFragment.getViewmodel().getChild_count().getValue();
                    intent.putExtra("children", num3 != null ? num3.intValue() : ((RoomData) prebookingcheckres.getData().getRoom_data().get(0)).getChildren().size());
                    intent.putExtra("checkin_date", bookingDetailsHolidaFragment.extractDate(prebookingcheckres.getData().getCheckin()));
                    intent.putExtra("checkout_date", bookingDetailsHolidaFragment.extractDate(prebookingcheckres.getData().getCheckout()));
                    String obj = bookingDetailsHolidaFragment.getBinding().bookingEmailEdittext.getText().toString();
                    if (obj == null) {
                        LoginResFromPass loginResFromPass = (LoginResFromPass) bookingDetailsHolidaFragment.getViewmodel().getUserDetails().getValue();
                        obj = loginResFromPass != null ? loginResFromPass.getUser_email_id() : null;
                    }
                    intent.putExtra("email", obj);
                    String obj2 = bookingDetailsHolidaFragment.getBinding().bookingNameEditText.getText().toString();
                    if (obj2 == null) {
                        LoginResFromPass loginResFromPass2 = (LoginResFromPass) bookingDetailsHolidaFragment.getViewmodel().getUserDetails().getValue();
                        obj2 = loginResFromPass2 != null ? loginResFromPass2.getUser_first_name() : null;
                    }
                    intent.putExtra("fullname", obj2);
                    String obj3 = bookingDetailsHolidaFragment.getBinding().bookingPhnEdittext.getText().toString();
                    if (obj3 == null) {
                        LoginResFromPass loginResFromPass3 = (LoginResFromPass) bookingDetailsHolidaFragment.getViewmodel().getUserDetails().getValue();
                        if (loginResFromPass3 != null) {
                            str = loginResFromPass3.getUser_mobile_number();
                        }
                    } else {
                        str = obj3;
                    }
                    intent.putExtra("mobile_number", str);
                    intent.putExtra("hotel_id", prebookingcheckres.getData().getProperty_data().getP_data().getHotelId());
                    intent.putExtra("is_wallet", bookingDetailsHolidaFragment.use_wallet);
                    String arrays = Arrays.toString(bookingDetailsHolidaFragment.getArgs().getRoomObj());
                    Intrinsics.checkNotNullExpressionValue(arrays, "toString(...)");
                    Log.d("createBooking rooms intent 1", arrays);
                    intent.putExtra("rooms", (Parcelable[]) bookingDetailsHolidaFragment.getArgs().getRoomObj());
                    intent.putExtra("opt_for_whatsapp", bookingDetailsHolidaFragment.whatsappOptIn);
                    intent.putExtra("token", bookingDetailsHolidaFragment.token);
                    bookingDetailsHolidaFragment.startActivity(intent);
                    return;
                }
                bookingDetailsHolidaFragment.getBinding().bookingEmailEdittext.setError("Enter a valid email");
                bookingDetailsHolidaFragment.getBinding().bookingEmailEdittext.requestFocus();
                bookingDetailsHolidaFragment.vibrate();
                return;
            }
            bookingDetailsHolidaFragment.getBinding().bookingPhnEdittext.setEnabled(true);
            bookingDetailsHolidaFragment.getBinding().bookingPhnEdittext.setError("Enter a valid mobile number");
            bookingDetailsHolidaFragment.vibrate();
            bookingDetailsHolidaFragment.getBinding().bookingPhnEdittext.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$10$lambda$9$lambda$8(BookingDetailsHolidaFragment.this);
                }
            }, 100L);
            return;
        }
        Editable text = bookingDetailsHolidaFragment.getBinding().bookingNameEditText.getText();
        if (text != null && (trim = StringsKt.trim(text)) != null) {
            num = Integer.valueOf(trim.length());
        }
        Intrinsics.checkNotNull(num);
        if (num.intValue() > 2) {
            bookingDetailsHolidaFragment.getBinding().bookingNameEditText.setError("Enter a valid name");
        } else {
            bookingDetailsHolidaFragment.getBinding().bookingNameEditText.setError("Name must have three letters");
        }
        bookingDetailsHolidaFragment.getBinding().bookingNameEditText.requestFocus();
        bookingDetailsHolidaFragment.vibrate();
    }

    public static final void onViewCreated$lambda$10$lambda$9$lambda$8(BookingDetailsHolidaFragment bookingDetailsHolidaFragment) {
        bookingDetailsHolidaFragment.getBinding().bookingPhnEdittext.requestFocus();
    }

    public static final Unit onViewCreated$lambda$11(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, preBookingCheckBody prebookingcheckbody) {
        if (prebookingcheckbody != null) {
            BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) bookingDetailsHolidaFragment), Dispatchers.getIO(), (CoroutineStart) null, new BookingDetailsHolidaFragment$onViewCreated$8$1(bookingDetailsHolidaFragment, prebookingcheckbody, null), 2, (Object) null);
        }
        return Unit.INSTANCE;
    }

    public static final void onViewCreated$lambda$15(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        int top = bookingDetailsHolidaFragment.getBinding().guestInfoCardView.getTop();
        bookingDetailsHolidaFragment.getBinding().scrollView.fling(0);
        bookingDetailsHolidaFragment.getBinding().scrollView.smoothScrollTo(0, top);
    }

    public static final void onViewCreated$lambda$17(final BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view, boolean z) {
        if (z) {
            bookingDetailsHolidaFragment.getBinding().scrollView.post(new Runnable() {
                @Override
                public final void run() {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$17$lambda$16(BookingDetailsHolidaFragment.this);
                }
            });
        }
    }

    public static final void onViewCreated$lambda$17$lambda$16(BookingDetailsHolidaFragment bookingDetailsHolidaFragment) {
        bookingDetailsHolidaFragment.getBinding().scrollView.smoothScrollTo(0, bookingDetailsHolidaFragment.getBinding().guestInfoCardView.getTop());
    }

    public static final void onViewCreated$lambda$18(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        int top = bookingDetailsHolidaFragment.getBinding().guestInfoCardView.getTop();
        bookingDetailsHolidaFragment.getBinding().scrollView.fling(0);
        bookingDetailsHolidaFragment.getBinding().scrollView.smoothScrollTo(0, top);
    }

    public static final void onViewCreated$lambda$20(final BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view, boolean z) {
        if (z) {
            bookingDetailsHolidaFragment.getBinding().scrollView.post(new Runnable() {
                @Override
                public final void run() {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$20$lambda$19(BookingDetailsHolidaFragment.this);
                }
            });
        }
    }

    public static final void onViewCreated$lambda$20$lambda$19(BookingDetailsHolidaFragment bookingDetailsHolidaFragment) {
        bookingDetailsHolidaFragment.getBinding().scrollView.smoothScrollTo(0, bookingDetailsHolidaFragment.getBinding().guestInfoCardView.getTop());
    }

    public static final void onViewCreated$lambda$21(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        int top = bookingDetailsHolidaFragment.getBinding().guestInfoCardView.getTop();
        bookingDetailsHolidaFragment.getBinding().scrollView.fling(0);
        bookingDetailsHolidaFragment.getBinding().scrollView.smoothScrollTo(0, top);
    }

    public static final void onViewCreated$lambda$23(final BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view, boolean z) {
        if (z) {
            bookingDetailsHolidaFragment.getBinding().scrollView.post(new Runnable() {
                @Override
                public final void run() {
                    BookingDetailsHolidaFragment.onViewCreated$lambda$23$lambda$22(BookingDetailsHolidaFragment.this);
                }
            });
        }
    }

    public static final void onViewCreated$lambda$23$lambda$22(BookingDetailsHolidaFragment bookingDetailsHolidaFragment) {
        bookingDetailsHolidaFragment.getBinding().scrollView.smoothScrollTo(0, bookingDetailsHolidaFragment.getBinding().guestInfoCardView.getTop());
    }

    public static final Unit onViewCreated$lambda$24(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, String str) {
        HotelAvailabiltyBody hotelAvailabiltyBody;
        if (str != null) {
            try {
                bookingDetailsHolidaFragment.Call = true;
                Log.d("dateSelected", str);
                TextView textView = bookingDetailsHolidaFragment.getBinding().bookingDayStr;
                TimeUtils.Companion companion = TimeUtils.INSTANCE;
                Object value = bookingDetailsHolidaFragment.getViewmodel().getCheckInDate().getValue();
                Intrinsics.checkNotNull(value);
                String date = companion.getDate((String) value);
                TimeUtils.Companion companion2 = TimeUtils.INSTANCE;
                Object value2 = bookingDetailsHolidaFragment.getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value2);
                textView.setText(date + ", " + TimeUtils.Companion.get12HrTime$default(companion2, ((Number) value2).intValue(), 0, 2, null));
                MutableLiveData<String> dateStr = bookingDetailsHolidaFragment.getViewmodel().getDateStr();
                TimeUtils.Companion companion3 = TimeUtils.INSTANCE;
                Object value3 = bookingDetailsHolidaFragment.getViewmodel().getCheckInDate().getValue();
                Intrinsics.checkNotNull(value3);
                dateStr.setValue(companion3.getDate((String) value3));
                bookingDetailsHolidaFragment.getcheckinStr();
                MutableLiveData<HotelAvailabiltyBody> hotelAvailabiltyBody_BD = bookingDetailsHolidaFragment.getViewmodel().getHotelAvailabiltyBody_BD();
                if (hotelAvailabiltyBody_BD != null && (hotelAvailabiltyBody = (HotelAvailabiltyBody) hotelAvailabiltyBody_BD.getValue()) != null) {
                    Object value4 = bookingDetailsHolidaFragment.getViewmodel().getCheckInDate().getValue();
                    Intrinsics.checkNotNull(value4);
                    hotelAvailabiltyBody.setCheckin_date((String) value4);
                }
                Object value5 = bookingDetailsHolidaFragment.getViewmodel().getCheckInDate().getValue();
                Intrinsics.checkNotNull(value5);
                Object value6 = bookingDetailsHolidaFragment.getViewmodel().getPack().getValue();
                Intrinsics.checkNotNull(value6);
                int intValue = ((Number) value6).intValue();
                Object value7 = bookingDetailsHolidaFragment.getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value7);
                String checkOutDate = bookingDetailsHolidaFragment.getCheckOutDate((String) value5, intValue, ((Number) value7).intValue());
                TextView textView2 = bookingDetailsHolidaFragment.getBinding().bookingDayStr2;
                String date2 = TimeUtils.INSTANCE.getDate(checkOutDate);
                TimeUtils.Companion companion4 = TimeUtils.INSTANCE;
                Object value8 = bookingDetailsHolidaFragment.getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value8);
                int intValue2 = ((Number) value8).intValue();
                Object value9 = bookingDetailsHolidaFragment.getViewmodel().getPack().getValue();
                Intrinsics.checkNotNull(value9);
                textView2.setText(date2 + ", " + companion4.getNextDayTime(intValue2, ((Number) value9).intValue()));
            } catch (Exception unused) {
            }
        }
        return Unit.INSTANCE;
    }

    public static final void onViewCreated$lambda$25(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        MutableLiveData<preBookingCheckBody> preBookingCheckBody = bookingDetailsHolidaFragment.getViewmodel().getPreBookingCheckBody();
        preBookingCheckBody prebookingcheckbody = preBookingCheckBody != null ? (preBookingCheckBody) preBookingCheckBody.getValue() : null;
        if (prebookingcheckbody != null) {
            prebookingcheckbody.setCoupon_code("");
        }
        bookingDetailsHolidaFragment.getViewmodel().getCoupon().setValue("");
        MutableLiveData<preBookingCheckBody> preBookingCheckBody2 = bookingDetailsHolidaFragment.getViewmodel().getPreBookingCheckBody();
        if (preBookingCheckBody2 != null) {
            preBookingCheckBody2.setValue(prebookingcheckbody);
        }
        ConstraintLayout constraintLayout = bookingDetailsHolidaFragment.getBinding().couponLayoutSuccess;
        if (constraintLayout != null) {
            constraintLayout.setVisibility(8);
        }
        LinearLayout linearLayout = bookingDetailsHolidaFragment.getBinding().couponLayoutBlank;
        if (linearLayout != null) {
            linearLayout.setVisibility(0);
        }
        bookingDetailsHolidaFragment.Call = true;
    }

    public static final void onViewCreated$lambda$26(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        View view2 = bookingDetailsHolidaFragment.getBinding().couponLayoutSuccess;
        Intrinsics.checkNotNullExpressionValue(view2, "couponLayoutSuccess");
        if (view2.getVisibility() == 0) {
            bookingDetailsHolidaFragment.getBinding().couponSuccessRemove.performClick();
            return;
        }
        try {
            Integer num = (Integer) bookingDetailsHolidaFragment.getViewmodel().getRoomCount().getValue();
            int intValue = num != null ? num.intValue() : 1;
            Integer num2 = (Integer) bookingDetailsHolidaFragment.getViewmodel().getGuestCount().getValue();
            int intValue2 = num2 != null ? num2.intValue() : 2;
            Integer num3 = (Integer) bookingDetailsHolidaFragment.getViewmodel().getAdult_count().getValue();
            int intValue3 = num3 != null ? num3.intValue() : 2;
            Integer num4 = (Integer) bookingDetailsHolidaFragment.getViewmodel().getChild_count().getValue();
            BookingDetailsHolidaFragmentDirections.ActionBookingDetailsHolidaFragmentToApplyCouponFragment actionBookingDetailsHolidaFragmentToApplyCouponFragment = BookingDetailsHolidaFragmentDirections.actionBookingDetailsHolidaFragmentToApplyCouponFragment(bookingDetailsHolidaFragment.token, bookingDetailsHolidaFragment.getArgs().getPropertyId(), intValue, intValue2, intValue3, num4 != null ? num4.intValue() : 0, "holida");
            Intrinsics.checkNotNullExpressionValue(actionBookingDetailsHolidaFragmentToApplyCouponFragment, "actionBookingDetailsHoli…oApplyCouponFragment(...)");
            FragmentKt.findNavController(bookingDetailsHolidaFragment).navigate(actionBookingDetailsHolidaFragmentToApplyCouponFragment);
        } catch (Exception unused) {
        }
    }

    public static final void onViewCreated$lambda$27(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, Ref.IntRef intRef, View view) {
        if (CheckInternet.Companion.isInternetAvailable$default(CheckInternet.INSTANCE, null, 0, 0, 7, null)) {
            LinearLayout linearLayout = bookingDetailsHolidaFragment.getBinding().bookingWalletLayoutNotApplicable;
            Intrinsics.checkNotNullExpressionValue(linearLayout, "bookingWalletLayoutNotApplicable");
            if (linearLayout.getVisibility() == 0 || intRef.element == 0) {
                return;
            }
            if (bookingDetailsHolidaFragment.use_wallet == 1) {
                bookingDetailsHolidaFragment.getBinding().WalletCheckAnimation.setVisibility(8);
                bookingDetailsHolidaFragment.getBinding().bookingUseWalletCheckBox.setVisibility(0);
                bookingDetailsHolidaFragment.use_wallet = 0;
                bookingDetailsHolidaFragment.getViewmodel().is_wallet().setValue(0);
            } else {
                bookingDetailsHolidaFragment.use_wallet = 1;
                bookingDetailsHolidaFragment.getBinding().WalletCheckAnimation.setVisibility(0);
                bookingDetailsHolidaFragment.getBinding().bookingUseWalletCheckBox.setVisibility(8);
                bookingDetailsHolidaFragment.getBinding().WalletCheckAnimation.playAnimation();
                bookingDetailsHolidaFragment.getViewmodel().is_wallet().setValue(1);
                bookingDetailsHolidaFragment.getBinding().walletError.setVisibility(0);
            }
            bookingDetailsHolidaFragment.Call = true;
            MutableLiveData<preBookingCheckBody> preBookingCheckBody = bookingDetailsHolidaFragment.getViewmodel().getPreBookingCheckBody();
            preBookingCheckBody prebookingcheckbody = preBookingCheckBody != null ? (preBookingCheckBody) preBookingCheckBody.getValue() : null;
            bookingDetailsHolidaFragment.preBookingCheckBody = prebookingcheckbody;
            if (prebookingcheckbody != null) {
                prebookingcheckbody.set_wallet(bookingDetailsHolidaFragment.use_wallet);
            }
            MutableLiveData<preBookingCheckBody> preBookingCheckBody2 = bookingDetailsHolidaFragment.getViewmodel().getPreBookingCheckBody();
            if (preBookingCheckBody2 != null) {
                preBookingCheckBody2.setValue(bookingDetailsHolidaFragment.preBookingCheckBody);
            }
        }
    }

    public static final void onViewCreated$lambda$28(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        if (CheckInternet.Companion.isInternetAvailable$default(CheckInternet.INSTANCE, null, 0, 0, 7, null)) {
            FragmentKt.findNavController(bookingDetailsHolidaFragment).navigateUp();
        }
    }

    public static final CharSequence onViewCreated$lambda$29(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
        int length = spanned.length();
        if (((length + i2) - i) - (i4 - i3) > 40) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        while (i < i2) {
            char charAt = charSequence.charAt(i);
            if (charAt != ' ' || i3 == 0 || spanned.charAt(i3 - 1) != ' ') {
                sb.append(charAt);
            }
            i++;
        }
        if (length > 0 && sb.length() > 0 && sb.charAt(0) == ' ') {
            sb.deleteCharAt(0);
        }
        return sb.toString();
    }

    private final void updateWhatsAppSwitch() {
        if (this.whatsappOptIn == 1) {
            getBinding().whatsappOptINImg.setVisibility(8);
            getBinding().whatsappOptINAnim.setVisibility(0);
            getBinding().whatsappOptINAnim.playAnimation();
        } else {
            getBinding().whatsappOptINAnim.cancelAnimation();
            getBinding().whatsappOptINAnim.setVisibility(8);
            getBinding().whatsappOptINImg.setVisibility(0);
        }
    }

    public void onResume() {
        super.onResume();
        this.Call = true;
        Log.d("temp", "onResume");
    }

    public void onPause() {
        super.onPause();
        Log.d("temp", "onPause");
    }

    private final boolean checkIsUserDeleted() {
        final Ref.BooleanRef booleanRef = new Ref.BooleanRef();
        getViewmodel().getUserProfile().observe(getViewLifecycleOwner(), new BookingDetailsHolidaFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
            public final Object invoke(Object obj) {
                Unit checkIsUserDeleted$lambda$30;
                checkIsUserDeleted$lambda$30 = BookingDetailsHolidaFragment.checkIsUserDeleted$lambda$30(booleanRef, (UserProfileRes) obj);
                return checkIsUserDeleted$lambda$30;
            }
        }));
        return booleanRef.element;
    }

    public static final Unit checkIsUserDeleted$lambda$30(Ref.BooleanRef booleanRef, UserProfileRes userProfileRes) {
        if (userProfileRes != null) {
            if (Intrinsics.areEqual(userProfileRes.getStatus(), "SUCCESS")) {
                booleanRef.element = false;
            } else if (Intrinsics.areEqual(userProfileRes.getStatus(), "ERROR")) {
                booleanRef.element = true;
            }
        }
        return Unit.INSTANCE;
    }

    private final void vibrate() {
        Vibrator vibrator;
        VibrationEffect createWaveform;
        if (Build.VERSION.SDK_INT < 26 || (vibrator = (Vibrator) requireContext().getSystemService("vibrator")) == null || !vibrator.hasVibrator()) {
            return;
        }
        createWaveform = VibrationEffect.createWaveform(new long[]{0, 200, 100, 300}, -1);
        vibrator.vibrate(createWaveform);
    }

    private final String getCheckOutDate(String value, int pack, int time) {
        if (time + pack < 24) {
            return value;
        }
        Calendar calendar = Calendar.getInstance();
        List split$default = StringsKt.split$default(value, new String[]{"-"}, false, 0, 6, (Object) null);
        calendar.set(Integer.parseInt((String) split$default.get(0)), Integer.parseInt((String) split$default.get(1)) - 1, Integer.parseInt((String) split$default.get(2)), pack, time);
        calendar.add(6, 1);
        return TimeUtils.INSTANCE.convertLongToTime(calendar.getTimeInMillis());
    }

    private final String getcheckinStr() {
        if (getViewmodel().getDateStr().getValue() != null && getViewmodel().getTime().getValue() != null) {
            Object value = getViewmodel().getDateStr().getValue();
            Intrinsics.checkNotNull(value);
            CharSequence subSequence = ((String) value).subSequence(4, 7);
            if (Intrinsics.areEqual(subSequence, "Jan")) {
                Object value2 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value2);
                int parseInt = Integer.parseInt(((String) value2).subSequence(8, 10).toString());
                Object value3 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value3);
                CharSequence subSequence2 = ((String) value3).subSequence(0, 4);
                TimeUtils.Companion companion = TimeUtils.INSTANCE;
                Object value4 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value4);
                return "January " + parseInt + ", " + ((Object) subSequence2) + "at " + TimeUtils.Companion.get12HrTime$default(companion, ((Number) value4).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Feb")) {
                Object value5 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value5);
                int parseInt2 = Integer.parseInt(((String) value5).subSequence(8, 10).toString());
                Object value6 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value6);
                CharSequence subSequence3 = ((String) value6).subSequence(0, 4);
                TimeUtils.Companion companion2 = TimeUtils.INSTANCE;
                Object value7 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value7);
                return "February " + parseInt2 + ", " + ((Object) subSequence3) + "at " + TimeUtils.Companion.get12HrTime$default(companion2, ((Number) value7).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Mar")) {
                Object value8 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value8);
                int parseInt3 = Integer.parseInt(((String) value8).subSequence(8, 10).toString());
                Object value9 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value9);
                CharSequence subSequence4 = ((String) value9).subSequence(0, 4);
                TimeUtils.Companion companion3 = TimeUtils.INSTANCE;
                Object value10 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value10);
                return "March " + parseInt3 + ", " + ((Object) subSequence4) + "at " + TimeUtils.Companion.get12HrTime$default(companion3, ((Number) value10).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Apr")) {
                Object value11 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value11);
                int parseInt4 = Integer.parseInt(((String) value11).subSequence(8, 10).toString());
                Object value12 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value12);
                CharSequence subSequence5 = ((String) value12).subSequence(0, 4);
                TimeUtils.Companion companion4 = TimeUtils.INSTANCE;
                Object value13 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value13);
                return "April " + parseInt4 + ", " + ((Object) subSequence5) + "at " + TimeUtils.Companion.get12HrTime$default(companion4, ((Number) value13).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "May")) {
                Object value14 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value14);
                int parseInt5 = Integer.parseInt(((String) value14).subSequence(8, 10).toString());
                Object value15 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value15);
                CharSequence subSequence6 = ((String) value15).subSequence(0, 4);
                TimeUtils.Companion companion5 = TimeUtils.INSTANCE;
                Object value16 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value16);
                return "May " + parseInt5 + ", " + ((Object) subSequence6) + "at " + TimeUtils.Companion.get12HrTime$default(companion5, ((Number) value16).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Jun")) {
                Object value17 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value17);
                int parseInt6 = Integer.parseInt(((String) value17).subSequence(8, 10).toString());
                Object value18 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value18);
                CharSequence subSequence7 = ((String) value18).subSequence(0, 4);
                TimeUtils.Companion companion6 = TimeUtils.INSTANCE;
                Object value19 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value19);
                return "June " + parseInt6 + ", " + ((Object) subSequence7) + "at " + TimeUtils.Companion.get12HrTime$default(companion6, ((Number) value19).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Jul")) {
                Object value20 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value20);
                int parseInt7 = Integer.parseInt(((String) value20).subSequence(8, 10).toString());
                Object value21 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value21);
                CharSequence subSequence8 = ((String) value21).subSequence(0, 4);
                TimeUtils.Companion companion7 = TimeUtils.INSTANCE;
                Object value22 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value22);
                return "July " + parseInt7 + ", " + ((Object) subSequence8) + "at " + TimeUtils.Companion.get12HrTime$default(companion7, ((Number) value22).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Aug")) {
                Object value23 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value23);
                int parseInt8 = Integer.parseInt(((String) value23).subSequence(8, 10).toString());
                Object value24 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value24);
                CharSequence subSequence9 = ((String) value24).subSequence(0, 4);
                TimeUtils.Companion companion8 = TimeUtils.INSTANCE;
                Object value25 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value25);
                return "August " + parseInt8 + ", " + ((Object) subSequence9) + "at " + TimeUtils.Companion.get12HrTime$default(companion8, ((Number) value25).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Sep")) {
                Object value26 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value26);
                int parseInt9 = Integer.parseInt(((String) value26).subSequence(8, 10).toString());
                Object value27 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value27);
                CharSequence subSequence10 = ((String) value27).subSequence(0, 4);
                TimeUtils.Companion companion9 = TimeUtils.INSTANCE;
                Object value28 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value28);
                return "September " + parseInt9 + ", " + ((Object) subSequence10) + "at " + TimeUtils.Companion.get12HrTime$default(companion9, ((Number) value28).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Oct")) {
                Object value29 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value29);
                int parseInt10 = Integer.parseInt(((String) value29).subSequence(8, 10).toString());
                Object value30 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value30);
                CharSequence subSequence11 = ((String) value30).subSequence(0, 4);
                TimeUtils.Companion companion10 = TimeUtils.INSTANCE;
                Object value31 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value31);
                return "October " + parseInt10 + ", " + ((Object) subSequence11) + "at " + TimeUtils.Companion.get12HrTime$default(companion10, ((Number) value31).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Nov")) {
                Object value32 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value32);
                int parseInt11 = Integer.parseInt(((String) value32).subSequence(8, 10).toString());
                Object value33 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value33);
                CharSequence subSequence12 = ((String) value33).subSequence(0, 4);
                TimeUtils.Companion companion11 = TimeUtils.INSTANCE;
                Object value34 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value34);
                return "November " + parseInt11 + ", " + ((Object) subSequence12) + "at " + TimeUtils.Companion.get12HrTime$default(companion11, ((Number) value34).intValue(), 0, 2, null);
            }
            if (Intrinsics.areEqual(subSequence, "Dec")) {
                Object value35 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value35);
                int parseInt12 = Integer.parseInt(((String) value35).subSequence(8, 10).toString());
                Object value36 = getViewmodel().getDateStr().getValue();
                Intrinsics.checkNotNull(value36);
                CharSequence subSequence13 = ((String) value36).subSequence(0, 4);
                TimeUtils.Companion companion12 = TimeUtils.INSTANCE;
                Object value37 = getViewmodel().getTime().getValue();
                Intrinsics.checkNotNull(value37);
                return "Dec " + parseInt12 + ", " + ((Object) subSequence13) + "at " + TimeUtils.Companion.get12HrTime$default(companion12, ((Number) value37).intValue(), 0, 2, null);
            }
            return "select a day or time";
        }
        return "select a day or time";
    }

    public void onDestroyView() {
        LiveData<HotelAvailabiltyRes> availabiltyLiveData_BD = getViewmodel().getAvailabiltyLiveData_BD();
        if (availabiltyLiveData_BD != null) {
            availabiltyLiveData_BD.removeObservers(requireActivity());
        }
        LiveData<preBookingCheckRes> preBookingCheck = getViewmodel().getPreBookingCheck();
        if (preBookingCheck != null) {
            preBookingCheck.removeObservers(requireActivity());
        }
        getViewmodel().makeAvailnull();
        String str = this.wallet_pre_applicable;
        String str2 = null;
        if (str == null) {
            Intrinsics.throwUninitializedPropertyAccessException("wallet_pre_applicable");
            str = null;
        }
        if (!Intrinsics.areEqual(str, "false") && !Intrinsics.areEqual(str, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE)) {
            String str3 = this.wallet_pre_applicable;
            if (str3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("wallet_pre_applicable");
            } else {
                str2 = str3;
            }
            Integer intOrNull = StringsKt.toIntOrNull(str2);
            if (intOrNull != null) {
                intOrNull.intValue();
            }
        }
        super.onDestroyView();
    }

    public void onDestroy() {
        Log.d("ondestView", "called");
        String str = this.wallet_pre_applicable;
        String str2 = null;
        if (str == null) {
            Intrinsics.throwUninitializedPropertyAccessException("wallet_pre_applicable");
            str = null;
        }
        if (!Intrinsics.areEqual(str, "false") && !Intrinsics.areEqual(str, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE)) {
            String str3 = this.wallet_pre_applicable;
            if (str3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("wallet_pre_applicable");
            } else {
                str2 = str3;
            }
            Integer intOrNull = StringsKt.toIntOrNull(str2);
            if (intOrNull != null) {
                intOrNull.intValue();
            }
        }
        super.onDestroy();
    }

    public final void scrollToBottom(NestedScrollView nestedScrollView) {
        Intrinsics.checkNotNullParameter(nestedScrollView, "<this>");
        Log.d("scrolled", "scrolled");
        nestedScrollView.smoothScrollBy(0, (nestedScrollView.getChildAt(nestedScrollView.getChildCount() - 1).getBottom() + nestedScrollView.getPaddingBottom()) - (nestedScrollView.getScrollY() + nestedScrollView.getHeight()));
        this.scrollflag = 0;
    }

    private final boolean checkName() {
        String obj = StringsKt.trim(getBinding().bookingNameEditText.getText().toString()).toString();
        if (Intrinsics.areEqual(obj, "") || obj.length() <= 2) {
            return false;
        }
        return !new Regex("[0-9!\\\"#$%&'()*+,-./:;\\\\\\\\<=>?@\\\\[\\\\]^_`{|}~]").containsMatchIn(obj);
    }

    private final boolean checkNumber() {
        String obj = StringsKt.trim(getBinding().bookingPhnEdittext.getText().toString()).toString();
        try {
            if (!Intrinsics.areEqual(StringsKt.replace$default(obj, " ", "", false, 4, (Object) null), "") && StringsKt.replace$default(obj, " ", "", false, 4, (Object) null).length() > 9 && !Intrinsics.areEqual(StringsKt.replace$default(obj, " ", "", false, 4, (Object) null), "0000000000")) {
                if (String.valueOf(Integer.parseInt(StringsKt.replace$default(obj, " ", "", false, 4, (Object) null))).length() > 9) {
                    return true;
                }
            }
            return false;
        } catch (Exception unused) {
            return true;
        }
    }

    private final boolean checkEmail() {
        String obj = StringsKt.trim(getBinding().bookingEmailEdittext.getText().toString()).toString();
        return !Intrinsics.areEqual(obj, "") && Patterns.EMAIL_ADDRESS.matcher(obj).matches();
    }

    public final String extractLastWord(String input) {
        Intrinsics.checkNotNullParameter(input, "input");
        List split = new Regex("\\s+").split(StringsKt.trim(input).toString(), 0);
        return !split.isEmpty() ? (String) CollectionsKt.last(split) : "";
    }

    public final String extractDate(String dateTime) {
        Intrinsics.checkNotNullParameter(dateTime, "dateTime");
        return StringsKt.substringBefore$default(dateTime, " ", (String) null, 2, (Object) null);
    }

    public final String extractTime(String dateTime) {
        Intrinsics.checkNotNullParameter(dateTime, "dateTime");
        return StringsKt.substringAfter$default(dateTime, " ", (String) null, 2, (Object) null);
    }

    public final String formatToShortDate(String dateTimeString) {
        Intrinsics.checkNotNullParameter(dateTimeString, "dateTimeString");
        String format = LocalDateTime.parse(dateTimeString, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss", Locale.getDefault())).format(DateTimeFormatter.ofPattern("dd MMM yy", Locale.getDefault()));
        Intrinsics.checkNotNullExpressionValue(format, "format(...)");
        return format;
    }

    public final String formatTo12HourTime(String dateTimeString) {
        Intrinsics.checkNotNullParameter(dateTimeString, "dateTimeString");
        String format = LocalDateTime.parse(dateTimeString, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss", Locale.getDefault())).format(DateTimeFormatter.ofPattern("hh:mm a", Locale.getDefault()));
        Intrinsics.checkNotNull(format);
        return StringsKt.replace$default(StringsKt.replace$default(format, "AM", "Am", false, 4, (Object) null), "PM", "Pm", false, 4, (Object) null);
    }

    private final void showCancellationPolicyBottomSheet(List<String> policies) {
        List<String> list;
        if (!isAdded() || getContext() == null || (list = policies) == null || list.isEmpty()) {
            return;
        }
        View inflate = getLayoutInflater().inflate(2131558446, (ViewGroup) null);
        inflate.setBackground(ContextCompat.getDrawable(requireContext(), 2131230969));
        BottomSheetDialog dialog = getDialog();
        if (dialog != null) {
            dialog.setContentView(inflate);
        }
        ((TextView) inflate.findViewById(2131364029)).setText("Cancelation Policies");
        RecyclerView findViewById = inflate.findViewById(2131363666);
        findViewById.setLayoutManager(new LinearLayoutManager(getContext()));
        findViewById.setAdapter(new CouponTncAdapter(policies));
        ((ImageView) inflate.findViewById(2131362501)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                BookingDetailsHolidaFragment.showCancellationPolicyBottomSheet$lambda$31(BookingDetailsHolidaFragment.this, view);
            }
        });
        Log.d("viewdetail", "clicked above");
        BottomSheetDialog dialog2 = getDialog();
        if (dialog2 != null) {
            dialog2.show();
        }
    }

    public static final void showCancellationPolicyBottomSheet$lambda$31(BookingDetailsHolidaFragment bookingDetailsHolidaFragment, View view) {
        BottomSheetDialog dialog = bookingDetailsHolidaFragment.getDialog();
        if (dialog != null) {
            dialog.dismiss();
        }
    }
}