(function(h){var n=window.AmazonUIPageJS||window.P,q=n._namespace||n.attributeErrors,p=q?q("DetailPageWirelessPromotionsAssets","DetailPageWirelessPromotionsAssets"):n;p.guardFatal?p.guardFatal(h)(p,window):p.execute(function(){h(p,window)})})(function(h,n,q){h.when("A","cc-manager","wireless-promotions-constants").register("wireless-promotions-add-to-cart-actions",function(e,b,d){function c(c){b.ccSelectionsClear(a);b.ccSelectionUpdate(a,c)}var a=d.featureRegistration.featureName;return{updateWirelessPromotionSelection:function(a){c({selectionType:"add",
enableIA:!1,formData:[{inputType:"hidden",inputName:"wirelessPromotionId",inputValue:a}]})},clearWirelessPromotionSelection:function(){b.ccSelectionsClear(a)},setSelection:c}});"use strict";h.when("A","cc-manager","wireless-promotions-constants","wireless-promotions-metrics").register("wireless-promotions-expander-actions",function(e,b,d,c){var a=d.featureRegistration,f=d.classes,g=d.selectors,k=e.$;return{displayExpanderIcon:function(){k(g.expanderIcon).removeClass(f.hide)},hideExpanderIcon:function(){k(g.expanderIcon).addClass(f.hide)},
notifyCardExpanded:function(){b.cardExpanded(a.featureName);c.increment(c.metricNames.ccExpanded);c.expandedTimer.start()},toggleWirelessPromotions:function(a){k(g.expanderIcon).toggleClass(f.rotate,a);k(g.expanderContent).toggleClass(f.wirelessPromotionsExpand,a)}}});"use strict";h.when("A","a-alert","wireless-promotions-constants").register("wireless-promotions-header-actions",function(e,b,d){var c=d.classes,a=d.selectors,f=e.$;return{displayHeaderSubtitle:function(){f(a.headerSubtitleContainer).removeClass(c.hide);
f(a.unavailableMessage).addClass(c.hide)},displayUnavailableMessage:function(){f(a.headerSubtitleContainer).addClass(c.hide);f(a.unavailableMessage).removeClass(c.hide)},updateHeaderSubtitleToSelected:function(g){f(a.headerSubtitleDefault).addClass(c.hide);b(a.headerSubtitleMobileCarrierSelected).text(g).show()},updateHeaderSubtitleToDefault:function(){b(a.headerSubtitleMobileCarrierSelected).hide();f(a.headerSubtitleDefault).removeClass(c.hide)}}});"use strict";h.when("A","wireless-promotions-constants").register("wireless-promotions-plan-details-actions",
function(e,b){var d=b.classes,c=b.selectors,a=e.$;return{displaySelectedPlanDetails:function(f){a(c.planDetails).each(function(g,c){a(c).toggleClass(d.hide,g!==f)})},hidePlanDetails:function(){a(c.planDetails).addClass(d.hide)}}});"use strict";h.when("A","wireless-promotions-constants").register("wireless-promotions-scroller-actions",function(e,b){function d(a,c){a.scrollLeft()!==c&&a.animate({scrollLeft:c},{duration:300})}var c=b.selectors,a=e.$;return{scrollToDefaultOption:function(){var b=a(c.swatchScroller);
d(b,0)},scrollToMobileCarrier:function(b){var g=a(c.swatchScroller),e=g.find(c.swatchList),f=g.find(c.swatch).eq(b);b=g.innerWidth();var l=f.outerWidth();e=-e.position().left;var r=f.position().left;f=g.get(0).scrollWidth-b;b=Math.floor(e-b/2+(r+l/2));b=Math.min(b,f);b=Math.max(b,0);d(g,b)}}});"use strict";h.when("A","wireless-promotions-constants").register("wireless-promotions-swatch-actions",function(e,b){function d(a,b){f(a).each(function(a,g){f(g).toggleClass(c.selected,a===b)})}var c=b.classes,
a=b.selectors,f=e.$,g=[a.swatch,a.swatchBox,a.swatchBoxHeader],k=b.constants.defaultOption;return{clearMobileCarrierSelection:function(){g.forEach(function(a){f(a).toggleClass(c.selected,!1)})},toggleDefaultOption:function(b){f(a.defaultOption).toggleClass(c.selected,b);f(a.defaultOptionBox).toggleClass(c.selected,b)},updateSwatchToSelected:function(a){g.forEach(function(b){d(b,a)})},updateSelectedCarrierId:function(a){k=a},getSelectedCarrierId:function(){return k}}});"use strict";h.when("A","wireless-promotions-constants",
"wireless-promotions-swatch-actions","wireless-promotions-metrics").execute(function(e,b,d,c){var a=b.actions;b=b.events;e.declarative(a.addToCart,b.click,function(){c.increment(c.metricNames.carrierIdAddToCartCount(d.getSelectedCarrierId()))});e.declarative(a.addToCartUbb,b.click,function(){c.increment(c.metricNames.carrierIdAddToCartUbbCount(d.getSelectedCarrierId()))})});"use strict";h.when("A","wireless-promotions-constants","wireless-promotions-swatch-actions","wireless-promotions-metrics").execute(function(e,
b,d,c){e.declarative(b.actions.buyNow,b.events.click,function(){c.increment(c.metricNames.carrierIdBuyNowCount(d.getSelectedCarrierId()))})});"use strict";h.when("A","cc-manager","wireless-promotions-expander-actions","wireless-promotions-constants","wireless-promotions-metrics").execute(function(e,b,d,c,a){var f=c.featureRegistration,g=c.actions,k=c.classes,h=c.selectors,l=e.$;e.declarative(g.toggleExpander,c.events.click,function(){var a=!l(h.expanderIcon).hasClass(k.hide),b=l(h.expanderContent).hasClass(k.wirelessPromotionsExpand);
a&&(b?e.trigger(g.cardCollapse):e.trigger(g.cardExpand))});e.on(g.cardCollapse,function(){d.toggleWirelessPromotions(!1);a.expandedTimer.stop()});e.on(g.cardExpand,function(){d.toggleWirelessPromotions(!0);b.cardExpanded(f.featureName);a.increment(a.metricNames.ccExpanded);a.expandedTimer.start()})});"use strict";"use strict";h.when("A","wireless-promotions-header-actions","wireless-promotions-swatch-actions","wireless-promotions-plan-details-actions","wireless-promotions-add-to-cart-actions","wireless-promotions-constants",
"wireless-promotions-metrics").execute(function(e,b,d,c,a,f,g){var k=f.actions,h=f.events,l=f.constants;e.declarative(k.selectDefaultOption,h.click,function(){d.toggleDefaultOption(!0);d.updateSelectedCarrierId(l.defaultOption);b.updateHeaderSubtitleToDefault();d.clearMobileCarrierSelection();c.hidePlanDetails();a.clearWirelessPromotionSelection();g.increment(g.metricNames.carrierIdSelectedCount(l.defaultOption))});e.declarative(k.selectMobileCarrier,h.click,function(e){d.toggleDefaultOption(!1);
b.updateHeaderSubtitleToSelected(e.data.selectedMessage);d.updateSwatchToSelected(e.data.selectedIndex);d.updateSelectedCarrierId(e.data.carrierId);c.displaySelectedPlanDetails(e.data.selectedIndex);a.updateWirelessPromotionSelection(e.data.promotionId);g.increment(g.metricNames.ccItemsSelectCount);g.increment(g.metricNames.carrierIdSelectedCount(e.data.carrierId))})});"use strict";h.when("A").register("wireless-promotions-constants",function(){return{featureRegistration:{featureName:"wirelessPromotions",
featureAttribution:"Retail/JP-InTech/Wireless Promotions"},actions:{addToCart:"wireless-promotions-add-to-cart",addToCartUbb:"wireless-promotions-add-to-cart-ubb",buyNow:"wireless-promotions-buy-now",toggleExpander:"toggle-wireless-promotions-expander",cardCollapse:"wireless-promotions-card:collapse",cardExpand:"wireless-promotions-card:expand",selectDefaultOption:"wireless-promotions-select-default-option",selectMobileCarrier:"wireless-promotions-select-mobile-carrier"},events:{click:"click"},classes:{hide:"aok-hidden",
rotate:"rotate",selected:"selected",wirelessPromotionsExpand:"wireless-promotions-expander-content-expand"},selectors:{addToCartButton:"#add-to-cart-button",addToCartButtonInPickUpView:"#pickup-add-to-cart-button",addToCartButtonUbb:"#add-to-cart-button-ubb",addToCartButtonUbbOnMobile:"#add-to-cart-button-ubb-mobile",buyNowButton:"#buy-now-button",buyNowFeatureInPickUpView:"#pickupBuyNow_feature_div",defaultOption:".wireless-promotions-swatch-default-option",defaultOptionBox:".wireless-promotions-swatch-default-option-box",
expanderContent:".wireless-promotions-expander-content",expanderIcon:".wireless-promotions-expander-icon",featureContainer:".wireless-promotions-container",header:".wireless-promotions-header",headerSubtitleContainer:".wireless-promotions-header-subtitle",headerSubtitleDefault:".wireless-promotions-header-subtitle-default",headerSubtitleMobileCarrierSelected:".wireless-promotions-header-subtitle-mobile-carrier-selected",swatch:".wireless-promotions-swatch",swatchBox:".wireless-promotions-swatch-box",
swatchBoxHeader:".wireless-promotions-swatch-box-header",swatchList:".wireless-promotions-swatch-list",swatchListItem:".wireless-promotions-swatch-list-item",swatchScroller:".wireless-promotions-swatch-scroller",planDetails:".wireless-promotions-plan-details",unavailableMessage:".wireless-promotions-unavailable-message"},constants:{allowlistedBuyingOptions:["NEW","PICKUP"],defaultOption:"defaultOption"}}});"use strict";h.when("A","cc-manager","wireless-promotions-constants","wireless-promotions-swatch-actions",
"wireless-promotions-expander-actions","wireless-promotions-header-actions","wireless-promotions-add-to-cart-actions").execute(function(e,b,d,c,a,f,g){function h(a,b){a.forEach(function(a){t(a)&&(e.declarative.remove(t(a),b),e.declarative.create(t(a),b))})}function p(a){a=a&&a[0]||{};a.orderSummaryDisplayString=document.querySelector(m.header).textContent;return a}var l=d.featureRegistration,r=d.actions,m=d.selectors,n=d.constants,t=e.$,q=!0;b.registerFeature(l,{init:function(){0<t(m.featureContainer).length&&
(h([m.addToCartButton,m.addToCartButtonInPickUpView],r.addToCart),h([m.addToCartButtonUbb,m.addToCartButtonUbbOnMobile],r.addToCartUbb),h([m.buyNowButton,m.buyNowFeatureInPickUpView],r.buyNow),c.updateSelectedCarrierId(n.defaultOption))},validateInputParams:function(){return!0},cardCollapse:function(){e.trigger(r.cardCollapse)},switchBuyingOption:function(d,h,k,m){(d=n.allowlistedBuyingOptions.includes(m))?q||(b.ccRemovedSelectionsClear(l.featureName),a.displayExpanderIcon(),f.displayHeaderSubtitle(),
k&&k[0].formData&&g.setSelection(k[0])):(e.trigger(r.cardCollapse),g.clearWirelessPromotionSelection(),c.getSelectedCarrierId()!==n.defaultOption&&b.ccRemovedSelectionUpdate(l.featureName,p(h)),q&&(a.hideExpanderIcon(),f.displayUnavailableMessage()));q=d}})});"use strict";var p=function(){function e(b,d){for(var c=0;c<d.length;c++){var a=d[c];a.enumerable=a.enumerable||!1;a.configurable=!0;"value"in a&&(a.writable=!0);Object.defineProperty(b,a.key,a)}}return function(b,d,c){d&&e(b.prototype,d);c&&
e(b,c);return b}}();h.when("A","wireless-promotions-constants").register("wireless-promotions-metrics",function(e,b){function d(a,b){var c=n.ue,g=/[a-zA-Z0-9.:_-]/g;c&&c.count&&a&&(a=a.match(g).join(""),c.count(a,(c.count(a)||0)+b))}var c=b.selectors,a=b.featureRegistration.featureName,f={ccExpanded:"twisterPlus.ccExpanded."+a,ccExpandedTime:"twisterPlus.ccExpandedTime."+a,ccItemsCount:"twisterPlus.ccItemsCount."+a,ccItemsSelectCount:"twisterPlus.ccItemsSelectCount."+a,carrierIdSelectedCount:function(b){return a+
"."+b+".selected"},carrierIdAddToCartCount:function(b){return a+"."+b+".addToCart"},carrierIdAddToCartUbbCount:function(b){return a+"."+b+".addToCartUbb"},carrierIdBuyNowCount:function(b){return a+"."+b+".buyNow"}};b=new (function(){function a(b){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");if(b)this.timerName=b,this.isStarted=!1;else throw Error("timerName must be non empty string");}p(a,[{key:"start",value:function(){this.isStarted||(this.startTime=Date.now(),
this.isStarted=!0)}},{key:"stop",value:function(){this.isStarted&&(d(this.timerName,Date.now()-this.startTime),this.isStarted=!1)}}]);return a}())(f.ccExpandedTime);(function(){var a=e.$(c.swatchListItem).length;0<a&&d(f.ccItemsCount,a)})();return{expandedTimer:b,metricNames:f,increment:function(a){d(a,1)}}})});