window.i18njs&&(i18n.t("msg_promotion__delta__percentage"),i18n.t("msg_promotion__delta__capped"),i18n.t("msg_promotion__delta__capped__up_to"),i18n.t("msg_promotion__delta__flat_rate"),i18n.t("msg_promotion__delta__free_shipping"),i18n.t("msg_promotion__delta__discounted_amount"),i18n.t("msg_promotion__delta__percentage_with_cap"),i18n.t("msg_promotion__delta__qualified_for_shipping_subsidy"),i18n.t("msg_promotion__rule__order_total"),i18n.t("msg_promotion__rule__order_total__location_group"),i18n.t("msg_promotion__rule__order_total__location_group__simple"),i18n.t("msg_promotion__rule__order_total__TH"),i18n.t("msg_promotion__rule__order_total__PH"),i18n.t("msg_promotion__rule__order_total__SG"),i18n.t("msg_promotion__rule__order_total__simple"),i18n.t("msg_promotion__rule__order_total__simple__TH"),i18n.t("msg_promotion__rule__order_total__simple__PH"),i18n.t("msg_promotion__rule__order_total__simple__SG"),i18n.t("msg_promotion__ruleset"),i18n.t("msg_promotion__ruleset__fsv"),i18n.t("msg_promotion__ruleset__VN"),i18n.t("msg_promotion__ruleset__simple"),i18n.t("msg_promotion__ruleset__fsv__simple"),i18n.t("msg_promotion__ruleset__simple__VN"),i18n.t("msg_promotion__ruleset__capped__simple__VN"),i18n.t("msg_promotion__ruleset__capped__simple"),i18n.t("msg_promotion__rule__channel_names"),i18n.t("msg_promotion_min_order_total__rule__channel_names"),i18n.t("msg_promotion__rule__order_total__simple__VN"),i18n.t("msg_promotion__ruleset__min_spend__icon__simple__VN"),i18n.t("msg_promotion__rule__simple"),i18n.t("msg_promotion__hint__order_total__TW"),i18n.t("msg_promotion__hint__order_total__TW__cb"),i18n.t("msg_promotion__hint__order_total__VN"),i18n.t("msg_promotion__hint__order_total__MY"),i18n.t("msg_promotion__hint__order_total__MY__cb"),i18n.t("msg_promotion__hint__order_total__PH"),i18n.t("msg_promotion__hint__order_total__PH__cb"),i18n.t("msg_promotion__cart__order_total__ID"),i18n.t("msg_promotion__prompt__order_total__TW"),i18n.t("msg_promotion__prompt__order_total__TW__cb"),i18n.t("msg_promotion__prompt__order_total__MY"),i18n.t("msg_promotion__prompt__order_total__MY__cb"),i18n.t("msg_promotion__prompt__order_total__PH"),i18n.t("msg_promotion__prompt__order_total__PH__cb"),i18n.t("msg_promotion__prompt__order_total__SG"),i18n.t("msg_promotion__prompt__order_total__SG__cb"),i18n.t("msg_promotion__rule__from_min_order_total__simple_id"),i18n.t("msg_promotion__rule__from_min_order_total__simple_my"),i18n.t("msg_promotion__rule__from_min_order_total__simple_ph"),i18n.t("msg_promotion__rule__from_min_order_total__simple_th"),i18n.t("msg_promotion__rule__from_min_order_total__simple"),i18n.t("label_tap_for_more_shipping_promotion"));var ShippingFeeCollectionController=function(){var p={},o=new BJCacher("/api/v1/logistics/channels/"),s=null,a=null,m=(t.prototype.reloadView=function(_,o,t){var i;this.$view.off("click"),_?(i=i18n.t("label_tap_for_more_shipping_promotion"),_="<div>"+_+"</div>","tw"===window.LOCALE.toLowerCase()&&(_+="<div>"+i+"</div>"),this.$view.find(".shipping-fee-free-description").html(_),o?(this.$view.find(".shipping-fee-icon-nonfree").hide(),this.$view.find(".shipping-fee-icon-free").show(),this.$view.addClass("free")):(this.$view.find(".shipping-fee-icon-nonfree").show(),this.$view.find(".shipping-fee-icon-free").hide(),this.$view.removeClass("free")),this.$view.show(),void 0!==t&&this.$view.on("tap",t)):this.$view.hide()},t.prototype.updateDisplayWithCartData=function(_){for(var t=this,i={},o=0;o<_.length;o++){var e=s.channels[_[o]];i[_[o]]={estimatedShippingFee:e?e.minimum_cost:0}}var n=a.generateCartDiscountString({promotionRules:t.promotionRules,shopName:t.shopName,shopEnabledChannelsData:i,crossBorder:t.crossBorder,showFreeShippingVoucherRequired:t.showFreeShippingVoucherRequired,orderTotal:t.orderTotal}),r=a.shouldShowFreeShippingIconBesideCartText(t.promotionRules);t.reloadView(n,r,function(){window.BI_ANALYTICS&&window.BI_ANALYTICS.trackCartVoucherInformationClick();var _=a.generateDetailedCartDiscountInfo({promotionRules:t.promotionRules,shopName:t.shopName,shopEnabledChannelsData:i,crossBorder:t.crossBorder}),o=(_.shippingDiscountTitle=t.hasWelcomePackageItem?i18n.t("label_welcome_package_shipping_discount"):i18n.t("label_shipping_discount"),$("#detailed-shipping-fee-info-wrapper").text()),o=new BJDjangofy(o).render(_);return bridgeCallHandler("dimNavbar",{isDim:!0,color:"000000",alpha:.54},function(_){}),$("#second-layer").html(o).show().velocity({bottom:0},200,"easeInOutCubic"),$(".detailed-shipping-fee-info-wrapper .info-table .option").each(function(){var _=$(this);_.data("names")&&_.html(new BJDjangofy($("#detailed-shipping-fee-info-channel-name").text()).render({channelNames:_.data("names").split(",")}))}),$("#cover").show(),$("#second-layer #ok-button").off("tap").on("tap",function(){bridgeCallHandler("dimNavbar",{isDim:!1},function(_){}),$("#second-layer").velocity({bottom:"-350px"},200,"easeInOutCubic",function(){$("#second-layer").hide()}),$("#cover").hide()}),!1})},t.prototype.updateDisplayWithSelectedShippingData=function(_,o,t){_=a.generateDiscountPrompt(this.promotionRules,this.shopName,_,o,t,this.crossBorder),o=a.shouldShowFreeShippingIconBesidePrompt(this.promotionRules,this.orderTotal);this.reloadView(_,o)},t);function t(_,o,t,i,e,n,r,p){this.$view=_,this.shopName=o,this.crossBorder=t,this.promotionRules=i,this.displayMode=e,this.showFreeShippingVoucherRequired=n,this.hasWelcomePackageItem=!!r,this.orderTotal=p}return{init:function(t){o.get(function(o){s=o,a=ShopeeLib.ShippingFeeInfoService().create(window.LOCALE,window.LANGUAGE,o.channels,function(o,t){o=i18n.t(o);return o=_.isEmpty(t)?o:o.tf(t)},Config.PromotionRuleDisplayConfig[window.LOCALE]),t()})},addController:function(_,o,t,i,e,n,r){0<(i=i.find(".shipping-fee-wrapper")).length&&(p[_]=new m(i,o,t,e,n,r))},updateDisplayWithCartData:function(_,o){_ in p&&p[_].updateDisplayWithCartData(o)},updateDisplayWithSelectedShippingData:function(_,o,t,i){_ in p&&p[_].updateDisplayWithSelectedShippingData(o,t,i)}}}();
//# sourceMappingURL=../../../../source_maps/buyer/cart/module/shipping_fee_v2.js.map
