导航菜单

页面标题

页面副标题

Hopscotch v9.7.2 - RatingsActivity.java 源代码

正在查看: Hopscotch v9.7.2 应用的 RatingsActivity.java JAVA 源代码文件

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


package in.hopscotch.android.ui.ratings;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import in.hopscotch.android.activity.customerinfo.LoginActivity;
import in.hopscotch.android.application.a0;
import in.hopscotch.android.databinding.l2;
import in.hopscotch.android.domain.model.ratings.Product;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang3.CharEncoding;
import org.apache.commons.lang3.StringUtils;

public class RatingsActivity extends f implements in.hopscotch.android.ui.ratings.listeners.d {
    public static final int i = 0;
    private l2 binding;
    private String continueLabelText;
    private boolean firstOrder;
    private String fromLocation;
    private String fromScreen;
    private in.hopscotch.android.domain.request.ratings.a getRatingsParams;
    private boolean isComingFromOrderDetails;
    private boolean isCrossClick;
    private boolean isOnlyNPSPresent;
    private String nextRatingId;
    private String nextSku;
    private boolean postRequestFailed;
    private boolean rateOnlyNPS;
    private String ratingId;
    private String ratingLabelText;
    private int ratingThreshold;
    private in.hopscotch.android.domain.response.ratings.a ratingsGetResponse;
    private in.hopscotch.android.presentation.viewmodel.ratings.a ratingsViewModel;
    private in.hopscotch.android.domain.request.ratings.b sendNpsData;
    private boolean shouldCloseRatingsActivity;
    private boolean showNpsData;
    private String source;
    private String thankYouMessageText;
    private String thanksForTheFeedbackToast;
    private long orderId = 0;
    private int selectedRating = 0;
    private String selectedSku = "";

    public static void T0(RatingsActivity ratingsActivity, in.hopscotch.android.presentation.state.a aVar) {
        ratingsActivity.getClass();
        if (aVar != null && aVar.d() != null && aVar.d().name().equals(in.hopscotch.android.presentation.state.b.SUCCESS.name())) {
            ratingsActivity.ratingsViewModel.L((in.hopscotch.android.domain.request.ratings.c) aVar.a());
            new com.google.gson.k().h(aVar);
        } else {
            if (aVar == null || aVar.d() == null || !aVar.d().name().equals(in.hopscotch.android.presentation.state.b.ERROR.name())) {
                return;
            }
            ratingsActivity.shouldCloseRatingsActivity = true;
            ratingsActivity.d1();
        }
    }

    public static void U0(RatingsActivity ratingsActivity, in.hopscotch.android.presentation.state.a aVar) {
        ratingsActivity.getClass();
        if (aVar != null && aVar.d().name().equals(in.hopscotch.android.presentation.state.b.SUCCESS.name())) {
            ratingsActivity.e1(false);
            if (in.hopscotch.android.domain.response.base.b.FAILURE.equalsIgnoreCase(((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getAction()) && aVar.a() != null && ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getActionURI() != null && ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getActionURI().equals(ratingsActivity.getResources().getString(2132019153))) {
                in.hopscotch.android.domain.response.base.c messageBar = ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getMessageBar();
                Bundle bundle = new Bundle();
                bundle.putBoolean("signOutRequestForPRR", true);
                if (messageBar != null && in.hopscotch.android.common.util.t.a(messageBar.i())) {
                    bundle.putString("redirectMessage", messageBar.i());
                }
                LoginActivity.i.getClass();
                LoginActivity.a.e(ratingsActivity, "Product Rating", "Product Rating", "REDIRECT_PRODUCT_RATINGS", false, bundle, 3004);
                return;
            }
            if (in.hopscotch.android.domain.response.base.b.SUCCESS.equals(((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getAction()) && !((in.hopscotch.android.domain.response.ratings.a) aVar.a()).f() && ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).d() != null && ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).d().size() > 0) {
                in.hopscotch.android.domain.response.ratings.a aVar2 = (in.hopscotch.android.domain.response.ratings.a) aVar.a();
                ratingsActivity.ratingsGetResponse = aVar2;
                if (aVar2.d() != null && ratingsActivity.ratingsGetResponse.d().size() > 0) {
                    for (Product product : ratingsActivity.ratingsGetResponse.d()) {
                        if (product.getSku().equals(ratingsActivity.selectedSku)) {
                            product.setRated(true);
                            product.setRating(ratingsActivity.selectedRating);
                        }
                    }
                }
                if (ratingsActivity.ratingsGetResponse.c() != 0) {
                    ratingsActivity.orderId = ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).c();
                }
                ratingsActivity.ratingThreshold = ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).e();
                ratingsActivity.showNpsData = ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).i();
                ratingsActivity.isOnlyNPSPresent = false;
                ratingsActivity.firstOrder = ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).g();
                ratingsActivity.ratingsViewModel.N(ratingsActivity.ratingsGetResponse);
            } else if (in.hopscotch.android.domain.response.base.b.SUCCESS.equals(((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getAction()) && ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).f()) {
                ratingsActivity.a1();
            } else if (in.hopscotch.android.domain.response.base.b.SUCCESS.equals(((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getAction()) && ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).b() != null && !((in.hopscotch.android.domain.response.ratings.a) aVar.a()).i() && (((in.hopscotch.android.domain.response.ratings.a) aVar.a()).d() == null || ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).d().size() == 0)) {
                FragmentManager supportFragmentManager = ratingsActivity.getSupportFragmentManager();
                androidx.fragment.app.a f = android.support.v4.media.a.f(supportFragmentManager, supportFragmentManager);
                a aVar3 = new a();
                Bundle bundle2 = new Bundle();
                bundle2.putString("type", "already submitted");
                aVar3.setArguments(bundle2);
                f.l(2131364233, aVar3, "error");
                f.p(false);
            } else if (in.hopscotch.android.domain.response.base.b.FAILURE.equals(((in.hopscotch.android.domain.response.ratings.a) aVar.a()).getAction())) {
                ratingsActivity.a1();
            } else if ((((in.hopscotch.android.domain.response.ratings.a) aVar.a()).d() == null || ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).d().size() == 0) && ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).i()) {
                ratingsActivity.showNpsData = ((in.hopscotch.android.domain.response.ratings.a) aVar.a()).i();
                ratingsActivity.isOnlyNPSPresent = true;
                ratingsActivity.b1();
            } else {
                ratingsActivity.a1();
                ratingsActivity.c1();
            }
        } else if (aVar == null || !aVar.d().name().equals(in.hopscotch.android.presentation.state.b.LOADING.name())) {
            ratingsActivity.e1(false);
            ratingsActivity.a1();
        } else {
            ratingsActivity.e1(true);
        }
        new com.google.gson.k().h(aVar);
    }

    public static void V0(RatingsActivity ratingsActivity, in.hopscotch.android.presentation.state.a aVar) {
        ratingsActivity.getClass();
        if (aVar == null || aVar.d() == null || aVar.d().name() == null || aVar.d().name().equals(in.hopscotch.android.presentation.state.b.LOADING.name())) {
            return;
        }
        if (ratingsActivity.getSupportFragmentManager().R("thankyou") != null) {
            ratingsActivity.shouldCloseRatingsActivity = false;
        } else {
            if (aVar.a() != null && ((in.hopscotch.android.domain.response.base.b) aVar.a()).getMessage() != null && in.hopscotch.android.common.util.t.a(((in.hopscotch.android.domain.response.base.b) aVar.a()).getMessage())) {
                ratingsActivity.thanksForTheFeedbackToast = ((in.hopscotch.android.domain.response.base.b) aVar.a()).getMessage();
            }
            ratingsActivity.shouldCloseRatingsActivity = true;
        }
        ratingsActivity.c1();
    }

    public static void W0(RatingsActivity ratingsActivity, in.hopscotch.android.presentation.state.a aVar) {
        ratingsActivity.getClass();
        if (aVar == null || !aVar.d().name().equals(in.hopscotch.android.presentation.state.b.SUCCESS.name())) {
            if (aVar == null || !aVar.d().name().equals(in.hopscotch.android.presentation.state.b.LOADING.name())) {
                return;
            }
            ratingsActivity.e1(true);
            return;
        }
        ratingsActivity.e1(false);
        String str = ratingsActivity.selectedSku;
        List<Product> d = ratingsActivity.ratingsGetResponse.d();
        if (d != null && d.size() > 0) {
            Iterator<Product> it = d.iterator();
            while (it.hasNext()) {
                if (str.equals(it.next().getSku())) {
                    break;
                }
            }
        }
        ratingsActivity.selectedRating = 0;
        if (ratingsActivity.ratingsGetResponse.b() != null && in.hopscotch.android.common.util.t.a(ratingsActivity.ratingsGetResponse.b().getMessageText())) {
            in.hopscotch.android.components.toast.a.d(ratingsActivity.getApplicationContext(), 1, ratingsActivity.ratingsGetResponse.b().getMessageText());
        }
        ratingsActivity.ratingsViewModel.t();
        ratingsActivity.b1();
    }

    public static void X0(RatingsActivity ratingsActivity, in.hopscotch.android.presentation.state.a aVar) {
        ratingsActivity.getClass();
        if (aVar == null || aVar.d() == null || aVar.d().name() == null || !aVar.d().name().equals(in.hopscotch.android.presentation.state.b.SUCCESS.name())) {
            if (aVar == null || aVar.d() == null || aVar.d().name() == null || !aVar.d().name().equals(in.hopscotch.android.presentation.state.b.ERROR.name())) {
                return;
            }
            ratingsActivity.shouldCloseRatingsActivity = true;
            ratingsActivity.ratingsViewModel.s();
            return;
        }
        in.hopscotch.android.domain.response.ratings.b bVar = (in.hopscotch.android.domain.response.ratings.b) aVar.a();
        if (bVar.getAction().equals(in.hopscotch.android.domain.response.base.b.SUCCESS) && in.hopscotch.android.common.util.t.a(bVar.e())) {
            ratingsActivity.shouldCloseRatingsActivity = false;
            if (bVar.d() != null && in.hopscotch.android.common.util.t.a(bVar.d().getSku()) && in.hopscotch.android.common.util.t.a(bVar.d().getRatingId())) {
                ratingsActivity.nextSku = bVar.d().getSku();
                ratingsActivity.nextRatingId = bVar.d().getRatingId();
            } else {
                ratingsActivity.nextRatingId = "";
                ratingsActivity.nextSku = "";
            }
            ratingsActivity.ratingLabelText = bVar.c();
            ratingsActivity.continueLabelText = bVar.b();
            ratingsActivity.thankYouMessageText = bVar.e().replace(StringUtils.LF, "\n\n");
            FragmentManager supportFragmentManager = ratingsActivity.getSupportFragmentManager();
            androidx.fragment.app.a f = android.support.v4.media.a.f(supportFragmentManager, supportFragmentManager);
            String str = ratingsActivity.nextSku;
            String str2 = ratingsActivity.nextRatingId;
            String str3 = ratingsActivity.thankYouMessageText;
            String str4 = ratingsActivity.ratingLabelText;
            String str5 = ratingsActivity.continueLabelText;
            t tVar = new t();
            Bundle bundle = new Bundle();
            bundle.putString("nextSku", str);
            bundle.putString("nextRatingId", str2);
            bundle.putString("thankYouMessageText", str3);
            bundle.putString("ratingLabelText", str4);
            bundle.putString("continueLabelText", str5);
            tVar.setArguments(bundle);
            f.l(2131364233, tVar, "thankyou");
            f.p(false);
        } else if (!bVar.f() && bVar.getAction().equals(in.hopscotch.android.domain.response.base.b.SUCCESS)) {
            ratingsActivity.shouldCloseRatingsActivity = true;
            if (in.hopscotch.android.common.util.t.a(bVar.e())) {
                ratingsActivity.thanksForTheFeedbackToast = bVar.e();
            } else if (in.hopscotch.android.common.util.t.a(bVar.getMessage())) {
                ratingsActivity.thanksForTheFeedbackToast = bVar.getMessage();
            }
        } else if (bVar.getAction().equals(in.hopscotch.android.domain.response.base.b.FAILURE)) {
            ratingsActivity.shouldCloseRatingsActivity = true;
            ratingsActivity.postRequestFailed = true;
            if (bVar.getMessageBar() != null && in.hopscotch.android.common.util.t.a(bVar.getMessageBar().i())) {
                ratingsActivity.thanksForTheFeedbackToast = bVar.getMessageBar().i();
            }
        }
        ratingsActivity.ratingsViewModel.s();
    }

    public static void Y0(RatingsActivity ratingsActivity, in.hopscotch.android.presentation.state.a aVar) {
        ratingsActivity.getClass();
        if (aVar != null && aVar.d() != null && aVar.d().name() != null && aVar.d().name().equals(in.hopscotch.android.presentation.state.b.SUCCESS.name())) {
            in.hopscotch.android.domain.request.ratings.b bVar = (in.hopscotch.android.domain.request.ratings.b) aVar.a();
            ratingsActivity.sendNpsData = bVar;
            if (bVar.d() != 0) {
                ratingsActivity.ratingsViewModel.J((in.hopscotch.android.domain.request.ratings.b) aVar.a());
                return;
            } else {
                ratingsActivity.c1();
                return;
            }
        }
        if (aVar == null || aVar.d() == null || aVar.d().name() == null || !aVar.d().name().equals(in.hopscotch.android.presentation.state.b.ERROR.name())) {
            return;
        }
        ratingsActivity.sendNpsData = null;
        ratingsActivity.c1();
    }

    public static void Z0(RatingsActivity ratingsActivity, in.hopscotch.android.presentation.state.a aVar) {
        ratingsActivity.getClass();
        if (aVar != null && aVar.d().name().equals(in.hopscotch.android.presentation.state.b.SUCCESS.name()) && ratingsActivity.getSupportFragmentManager().R("review") == null) {
            String str = ratingsActivity.selectedSku;
            Fragment R = ratingsActivity.getSupportFragmentManager().R("review");
            if (R == null || !R.getClass().equals(q.class)) {
                FragmentManager supportFragmentManager = ratingsActivity.getSupportFragmentManager();
                androidx.fragment.app.a f = android.support.v4.media.a.f(supportFragmentManager, supportFragmentManager);
                f.m(2130772024, 2130772019, 0, 0);
                f.l(2131364233, q.T0(str, ratingsActivity.ratingThreshold, ratingsActivity.showNpsData, ratingsActivity.orderId, ratingsActivity.ratingId, ratingsActivity.fromScreen, ratingsActivity.fromLocation, ratingsActivity.source, ratingsActivity.isOnlyNPSPresent, ratingsActivity.firstOrder), "review");
                f.p(false);
            }
        }
    }

    @Override
    public final void A(boolean z) {
        this.isCrossClick = z;
        if (!z) {
            this.ratingsViewModel.s();
            return;
        }
        this.shouldCloseRatingsActivity = true;
        d1();
        super/*androidx.activity.j*/.onBackPressed();
        overridePendingTransition(0, 2130771985);
    }

    @Override
    public final void A0(int i2, boolean z) {
        this.isCrossClick = z;
        this.selectedRating = i2;
        if (!z) {
            this.ratingsViewModel.x();
            return;
        }
        this.shouldCloseRatingsActivity = true;
        d1();
        super/*androidx.activity.j*/.onBackPressed();
        overridePendingTransition(0, 2130771985);
    }

    @Override
    public final void X(String str, String str2) {
        in.hopscotch.android.presentation.viewmodel.ratings.a aVar = this.ratingsViewModel;
        this.ratingId = str2;
        this.selectedSku = str;
        this.selectedRating = 0;
        aVar.r(new in.hopscotch.android.domain.request.ratings.a(str2, str, this.source, 0, this.fromScreen, this.fromLocation, this.rateOnlyNPS));
    }

    @Override
    public final void Z(int i2, String str, int i3, Product product) {
        this.selectedRating = i3;
        this.selectedSku = str;
        this.ratingsViewModel.K(this.orderId, this.ratingId, this.isCrossClick, i2, str, "", i3, product, this.fromScreen, this.fromLocation, this.source, null);
    }

    public final void a1() {
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        androidx.fragment.app.a f = android.support.v4.media.a.f(supportFragmentManager, supportFragmentManager);
        a aVar = new a();
        Bundle bundle = new Bundle();
        bundle.putString("type", "error");
        aVar.setArguments(bundle);
        f.l(2131364233, aVar, "error");
        f.p(false);
    }

    public final void b1() {
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        androidx.fragment.app.a f = android.support.v4.media.a.f(supportFragmentManager, supportFragmentManager);
        if (this.selectedRating != 0 && !this.isOnlyNPSPresent) {
            f.m(2130772024, 2130772025, 0, 0);
            f.k(2131364233, new j(), "landing", 1);
            f.p(false);
        } else if (this.isOnlyNPSPresent) {
            f.m(2130772024, 2130772025, 0, 0);
            f.k(2131364233, q.T0(this.selectedSku, this.ratingThreshold, this.showNpsData, this.orderId, this.ratingId, this.fromScreen, this.fromLocation, this.source, this.isOnlyNPSPresent, this.firstOrder), "review", 1);
            f.p(false);
        } else if (getSupportFragmentManager().R("thankyou") != null) {
            f.l(2131364233, new j(), "landing");
            f.p(false);
        } else {
            f.k(2131364233, new j(), "landing", 1);
            f.p(false);
        }
    }

    public final void c1() {
        this.ratingsViewModel.M();
    }

    public final void d1() {
        if (this.shouldCloseRatingsActivity) {
            if (!this.isComingFromOrderDetails) {
                Intent a = a0.a(this);
                a.setFlags(268468224);
                a.putExtra("HOME_TAB", 0);
                if (in.hopscotch.android.common.util.t.a(this.thanksForTheFeedbackToast)) {
                    a.putExtra("ratingMessage", this.thanksForTheFeedbackToast);
                }
                startActivity(a);
                finish();
                return;
            }
            Intent intent = new Intent();
            if (this.isCrossClick || this.postRequestFailed) {
                intent.putExtra("selectedRating", 0);
            } else {
                intent.putExtra("selectedRating", this.selectedRating);
            }
            intent.putExtra("selectedSku", this.selectedSku);
            intent.putExtra("ratingId", this.ratingId);
            if (in.hopscotch.android.common.util.t.a(this.thanksForTheFeedbackToast)) {
                intent.putExtra("ratingMessage", this.thanksForTheFeedbackToast);
            }
            setResult(-1, intent);
            finish();
        }
    }

    public final void e1(boolean z) {
        if (z) {
            this.binding.d.setVisibility(0);
        } else {
            this.binding.d.setVisibility(8);
        }
    }

    @Override
    public final void k() {
        this.shouldCloseRatingsActivity = true;
        d1();
        super/*androidx.activity.j*/.onBackPressed();
        overridePendingTransition(0, 2130771985);
    }

    public final void onActivityResult(int i2, int i3, Intent intent) {
        super/*androidx.fragment.app.n*/.onActivityResult(i2, i3, intent);
        if (i2 == 3004) {
            if (intent == null || !intent.getBooleanExtra("isComingAfterSignInForPRR", false)) {
                this.shouldCloseRatingsActivity = true;
                d1();
            } else {
                this.ratingsViewModel.r(this.getRatingsParams);
            }
        }
    }

    public final void onBackPressed() {
        this.isCrossClick = true;
        this.shouldCloseRatingsActivity = true;
        d1();
        super/*androidx.activity.j*/.onBackPressed();
        overridePendingTransition(0, 2130771985);
    }

    @Override
    public final void onCreate(Bundle bundle) {
        final int i2 = 1;
        final int i3 = 0;
        super.onCreate(bundle);
        overridePendingTransition(2130771986, 2130771987);
        LayoutInflater layoutInflater = getLayoutInflater();
        int i4 = l2.f;
        in.hopscotch.android.domain.request.ratings.a aVar = null;
        l2 M = androidx.databinding.p.M(layoutInflater, 2131558502, (ViewGroup) null, false, androidx.databinding.g.e());
        this.binding = M;
        setContentView(M.E());
        e1(true);
        in.hopscotch.android.presentation.viewmodel.ratings.a aVar2 = (in.hopscotch.android.presentation.viewmodel.ratings.a) new ViewModelProvider(this).get(in.hopscotch.android.presentation.viewmodel.ratings.a.class);
        this.ratingsViewModel = aVar2;
        aVar2.w().observe(this, new Observer(this) {
            public final RatingsActivity b;

            {
                this.b = this;
            }

            public final void onChanged(Object obj) {
                switch (i2) {
                    case 0:
                        RatingsActivity.V0(this.b, (in.hopscotch.android.presentation.state.a) obj);
                        break;
                    default:
                        RatingsActivity.U0(this.b, (in.hopscotch.android.presentation.state.a) obj);
                        break;
                }
            }
        });
        this.ratingsViewModel.G().observe(this, new in.hopscotch.android.plpfilters.ui.activity.b(this, 5));
        this.ratingsViewModel.C().observe(this, new in.hopscotch.android.ui.base.a(this, 7));
        this.ratingsViewModel.E().observe(this, new in.hopscotch.android.plpfilters.ui.activity.a(this, 4));
        this.ratingsViewModel.y().observe(this, new Observer(this) {
            public final RatingsActivity b;

            {
                this.b = this;
            }

            public final void onChanged(Object obj) {
                RatingsActivity ratingsActivity = this.b;
                in.hopscotch.android.presentation.state.a aVar3 = (in.hopscotch.android.presentation.state.a) obj;
                switch (i2) {
                    case 0:
                        RatingsActivity.Y0(ratingsActivity, aVar3);
                        break;
                    default:
                        int i5 = RatingsActivity.i;
                        ratingsActivity.d1();
                        break;
                }
            }
        });
        this.ratingsViewModel.H().observe(this, new com.microsoft.clarity.f.a0(this, 3));
        this.ratingsViewModel.A().observe(this, new Observer(this) {
            public final RatingsActivity b;

            {
                this.b = this;
            }

            public final void onChanged(Object obj) {
                RatingsActivity ratingsActivity = this.b;
                in.hopscotch.android.presentation.state.a aVar3 = (in.hopscotch.android.presentation.state.a) obj;
                switch (i3) {
                    case 0:
                        RatingsActivity.Y0(ratingsActivity, aVar3);
                        break;
                    default:
                        int i5 = RatingsActivity.i;
                        ratingsActivity.d1();
                        break;
                }
            }
        });
        this.ratingsViewModel.F().observe(this, new Observer(this) {
            public final RatingsActivity b;

            {
                this.b = this;
            }

            public final void onChanged(Object obj) {
                switch (i3) {
                    case 0:
                        RatingsActivity.V0(this.b, (in.hopscotch.android.presentation.state.a) obj);
                        break;
                    default:
                        RatingsActivity.U0(this.b, (in.hopscotch.android.presentation.state.a) obj);
                        break;
                }
            }
        });
        if (getIntent() != null) {
            try {
                HashMap hashMap = (HashMap) getIntent().getSerializableExtra("INTENT_EXTRA_PARAM");
                if (hashMap.containsKey("deepLink") && hashMap.get("deepLink") != null) {
                    com.google.firebase.crashlytics.c.a().d("deepLink", (String) hashMap.get("deepLink"));
                }
                if (hashMap.containsKey("ratingId")) {
                    this.ratingId = URLDecoder.decode((String) hashMap.get("ratingId"), CharEncoding.UTF_8);
                }
                if (hashMap.containsKey("id")) {
                    this.ratingId = URLDecoder.decode((String) hashMap.get("id"), CharEncoding.UTF_8);
                }
                if (hashMap.containsKey("selectedSku")) {
                    this.selectedSku = (String) hashMap.get("selectedSku");
                }
                if (hashMap.containsKey("rateOnlyNPS")) {
                    this.rateOnlyNPS = ((String) hashMap.get("rateOnlyNPS")).equalsIgnoreCase("true");
                }
                if (hashMap.containsKey("selectedRating")) {
                    this.selectedRating = Integer.parseInt((String) hashMap.get("selectedRating"));
                }
                this.source = "";
                if (hashMap.containsKey("source") && in.hopscotch.android.common.util.t.a((String) hashMap.get("source"))) {
                    this.source = (String) hashMap.get("source");
                }
                boolean booleanExtra = getIntent().getBooleanExtra("isComingFromOrderDetails", false);
                this.isComingFromOrderDetails = booleanExtra;
                if (booleanExtra) {
                    this.orderId = Long.parseLong(getIntent().getStringExtra("ORDER_ID"));
                }
                if ("email".equals(this.source)) {
                    this.fromScreen = "Delivery email";
                    this.fromLocation = "Rate items";
                } else if ("orderDetails".equals(this.source)) {
                    this.fromScreen = "Order details";
                    this.fromLocation = "Rate items";
                } else {
                    this.fromScreen = this.source;
                    this.fromLocation = "Rate items";
                }
                aVar = new in.hopscotch.android.domain.request.ratings.a(this.ratingId, this.selectedSku, this.source, this.selectedRating, this.fromScreen, this.fromLocation, this.rateOnlyNPS);
            } catch (Exception e) {
                in.hopscotch.android.util.g.b(e);
            }
        }
        this.getRatingsParams = aVar;
        if (this.rateOnlyNPS) {
            this.showNpsData = true;
            this.isOnlyNPSPresent = true;
            e1(false);
            c1();
            this.ratingsViewModel.r(this.getRatingsParams);
            return;
        }
        if (aVar == null) {
            a1();
            return;
        }
        c1();
        this.ratingsViewModel.r(this.getRatingsParams);
    }
}