KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
System : Windows NT SERVER-PC 10.0 build 26200 (Windows 11) AMD64
User : ServerPC ( 0)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  C:/Users/ServerPC/AppData/Local/Microsoft/Edge/User Data/Edge Shopping/2.0.6893.0/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : C:/Users/ServerPC/AppData/Local/Microsoft/Edge/User Data/Edge Shopping/2.0.6893.0/product_page.js
!function(){"use strict";var e={56005:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"timeStamp",void 0),(0,i.Z)(this,"allowed",void 0)}static GetAAConsentStorageKey(e){return"AAConsentData_"+e}}},51329:function(e,t,o){var i=o(72370);t.Z=class{constructor(e){(0,i.Z)(this,"year",void 0),(0,i.Z)(this,"make",void 0),(0,i.Z)(this,"model",void 0),(0,i.Z)(this,"isValid",!1),e&&(this.make=e.make,this.model=e.model,this.year=e.year,this.isValid=void 0!==this.make&&void 0!==this.model&&void 0!==this.year)}}},66933:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"commissionType",void 0),(0,i.Z)(this,"commissionValue",void 0),(0,i.Z)(this,"category",void 0),(0,i.Z)(this,"isRebatesSupportedDomain",void 0),(0,i.Z)(this,"isRebatesUser",void 0),(0,i.Z)(this,"merchantName",void 0),(0,i.Z)(this,"highestCashbackCategory",void 0)}static Create(e){const t=new r;return t.commissionType=e.highestCashbackCategory?.commissionType,t.commissionValue=e.highestCashbackCategory?.commissionValue,t.category=e.highestCashbackCategory?.category,t.isRebatesSupportedDomain=e.isRebatesSupportedDomain??null,t.isRebatesUser=e.userRebateResponse?.isRebatesUser??!1,t.merchantName=e.merchantName,t.highestCashbackCategory=e.highestCashbackCategory,t}}t.Z=r},35062:function(e,t,o){var i=o(72370),r=o(29247),a=o(75383);class n{static Create(e){let t=JSON.parse(atob(e));const o=[],i=new Map,n=t?.[0]?.Group;if(n){let e=n;for(const o of t)if(o){const t=o.Group;if(t&&r.ZP.IsOnPage(o.PageUrl,location.pathname)){e=t;break}}t=t.map((t=>{if(t.Group===e)return t}))}for(const e of t)if(e){const t=e.Type;t&&!i.has(t)&&(o.push(t),i.set(t,new a.Z(e.PageUrl,t,e.checkoutElements)))}return{map:i,array:o}}constructor(e){if((0,i.Z)(this,"DomainName",void 0),(0,i.Z)(this,"AllcheckoutCompletionPages",void 0),(0,i.Z)(this,"AllPageTypeArr",void 0),(0,i.Z)(this,"AllCheckoutCompletionPagesStr",void 0),(0,i.Z)(this,"IsExpressCheckoutEnabled",void 0),(0,i.Z)(this,"CheckoutPageUrl",void 0),e){this.DomainName=e.domainName,this.CheckoutPageUrl=e.checkoutPageUrl,this.IsExpressCheckoutEnabled=e.isExpressCheckoutEnabled;const t=e.allCheckoutCompletionPagesStr;if(this.AllCheckoutCompletionPagesStr=t,t){const{map:e,array:o}=n.Create(t);this.AllcheckoutCompletionPages=e,this.AllPageTypeArr=o}}}}(0,i.Z)(n,"PageTypeArr",[]),t.Z=n},65902:function(e,t,o){var i=o(72370);t.Z=class{constructor(e,t,o,r,a,n,s,c,l,u,d,h,p){(0,i.Z)(this,"Name",void 0),(0,i.Z)(this,"Type",void 0),(0,i.Z)(this,"Value",void 0),(0,i.Z)(this,"IsMandatory",void 0),(0,i.Z)(this,"Format",void 0),(0,i.Z)(this,"WaitForVisible",void 0),(0,i.Z)(this,"WaitForNotDisabled",void 0),(0,i.Z)(this,"WaitBefore",void 0),(0,i.Z)(this,"WaitAfter",void 0),(0,i.Z)(this,"WaitForNotVisible",void 0),(0,i.Z)(this,"NotAlwaysShown",void 0),(0,i.Z)(this,"DynamicFetch",void 0),(0,i.Z)(this,"ShouldValue",void 0),this.Name=e,this.Type=t,this.Value=o,this.IsMandatory=r,this.Format=a,this.WaitForVisible=n,this.WaitForNotDisabled=s,this.WaitBefore=c,this.WaitAfter=l,this.WaitForNotVisible=u,this.NotAlwaysShown=d,this.DynamicFetch=h,this.ShouldValue=p}}},75383:function(e,t,o){var i=o(72370),r=o(65902);t.Z=class{constructor(e,t,o){if((0,i.Z)(this,"PageUrl",void 0),(0,i.Z)(this,"Type",void 0),(0,i.Z)(this,"CheckoutElements",void 0),this.PageUrl=e,this.Type=t,this.CheckoutElements=new Map,o)for(const e of o)if(e){const t=e.Name;let o=e.Value;t&&this.CheckoutElements.set(t,new r.Z(t,e.Type,o,e.IsMandatory,e.Format,e.WaitForVisible,e.WaitForNotDisabled,e.WaitBefore,e.WaitAfter,e.WaitForNotVisble,e.NotAlwaysShown,e.DynamicFetch,e.ShouldValue))}}}},41865:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"isOffTheRecord",void 0),(0,i.Z)(this,"buildVersion",void 0)}static Create(e){const t=new r;return t.isOffTheRecord=e?.clientInfo?.isOffTheRecord??void 0,t.buildVersion=e?.clientInfo?.buildVersion,t}}t.Z=r},69886:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"clipCouponSelector",void 0),(0,i.Z)(this,"signedInSelector",void 0),(0,i.Z)(this,"discountSelector",void 0),(0,i.Z)(this,"orderTotalDataElementSelector",void 0),(0,i.Z)(this,"clippedDiscountSelector",void 0),(0,i.Z)(this,"alreadyClippedSelector",void 0),(0,i.Z)(this,"waitForPageLoad",void 0),(0,i.Z)(this,"clickBeforeClipSelector",void 0),(0,i.Z)(this,"promoCodeSelector",void 0),(0,i.Z)(this,"isSalePriceNotDiscount",void 0),(0,i.Z)(this,"isSignInOptional",void 0)}static Create(e){const t=new r;return t.clipCouponSelector=e.clipCouponSelector,t.signedInSelector=e.signedInSelector,t.discountSelector=e.discountSelector,t.orderTotalDataElementSelector=e.orderTotalDataElementSelector,t.clippedDiscountSelector=e.clippedDiscountSelector,t.alreadyClippedSelector=e.alreadyClippedSelector,t.waitForPageLoad=e.waitForPageLoad,t.clickBeforeClipSelector=e.clickBeforeClipSelector,t.promoCodeSelector=e.promoCodeSelector,t.isSalePriceNotDiscount=e.isSalePriceNotDiscount,t.isSignInOptional=e.isSignInOptional,t}}t.Z=r},605:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"attribution",void 0),(0,i.Z)(this,"couponCode",void 0),(0,i.Z)(this,"title",void 0),(0,i.Z)(this,"isLowSuccessRateCoupon",void 0),(0,i.Z)(this,"isStackable",void 0),(0,i.Z)(this,"successRate",void 0),(0,i.Z)(this,"minimumPurchase",void 0),(0,i.Z)(this,"shortHeader",void 0),(0,i.Z)(this,"calculatedCutoffPrice",void 0),(0,i.Z)(this,"discountPercent",void 0),(0,i.Z)(this,"discountValue",void 0),(0,i.Z)(this,"offerUrl",void 0),(0,i.Z)(this,"isPrivateCoupon",void 0),(0,i.Z)(this,"suggestedCouponType",void 0),(0,i.Z)(this,"isBlockedByCart",void 0),(0,i.Z)(this,"providerId",void 0)}}},4238:function(e,t,o){o.d(t,{Z:function(){return r}});var i=o(72370);class r{constructor(e,t,o){(0,i.Z)(this,"ruleName",void 0),(0,i.Z)(this,"maskType",void 0),(0,i.Z)(this,"ruleValue",void 0),this.ruleName=e,this.maskType=t,this.ruleValue=o}}},95457:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"SearchData",void 0),(0,i.Z)(this,"CategoryData",void 0),(0,i.Z)(this,"PdpData",void 0),(0,i.Z)(this,"AddedToCartData",void 0),(0,i.Z)(this,"CustomAutoShowData",void 0),(0,i.Z)(this,"categoryAutoShowCooldownInSeconds",void 0)}static Create(e){let t=new r;if(e)try{const o=atob(e);t=JSON.parse(o)}catch(e){}return t}}t.Z=r},88101:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"supported",void 0),(0,i.Z)(this,"variant",void 0),(0,i.Z)(this,"multipleVariants",void 0)}}},4872:function(e,t,o){o.d(t,{H:function(){return i}});let i=function(e){return e.sanConfirmationMessage="msShoppingExp0",e.onlineSelectorExtraction="msShoppingExp1",e.couponRedesignExperiment="msShoppingExp2",e.PCDouble="msShoppingExp3",e.PCOutOfStock="msShoppingExp4",e.blossomCampaign="msShoppingExp5",e.newNotificationManagementUI="msShoppingExp6",e.manualCoupon="msShoppingExp9",e.startShoppingRelatedProducts="msShoppingExp11",e.singleScrollingShoreline="msShoppingExp12",e.dealczarBackend="msShoppingExp13",e.sanConsent="msShoppingExp14",e.pcClickoutReverse="msShoppingExp15",e.optionalCheckoutPageUrl="msShoppingExp16",e.autosVinExtraction="msShoppingExp17",e.domMutationEnabled="msShoppingExp18",e.pdpSelectorExtraction="msShoppingExp19",e.newPriceHistoryGraph="msShoppingExp20",e.disableChatChips="msShoppingExp22",e.snoozeWithOptions="msShoppingExp23",e.searchInPane="msShoppingExp24",e.calculatedCutOffPriceFiltering="msShoppingExp25",e.pcbAddressBar="msShoppingExp29",e.checkoutSkuCashbackEstimation="msShoppingExp31",e.spbInstantAutoActivate="msShoppingExp33",e.productTracking="msShoppingExp34",e.spbAutoDismissTreatment="msShoppingExp35",e.suggestedCouponEnhancement="msShoppingExp36",e.autosApi="msShoppingExp37",e.pcboutofflownotification="msShoppingExp38",e.dynamicRanking="msShoppingExp39",e.trendingRecommendations="msShoppingExp40",e.groceryAnonymous="msShoppingExp41",e.spbAutoDismissControl="msShoppingExp42",e.buyingGuideMultiLine="msShoppingExp43",e.spbPdpWithActivated="msShoppingExp44",e.sanConsentStringUpdate="msShoppingExp45",e.autosJatoDeals="msShoppingExp46",e.startShoppingVisualSearch="msShoppingExp47",e.spbAutoSnoozeTreatment="msShoppingExp48",e.similarOffers="msShoppingExp49",e.alertSettings="msShoppingExp50",e.shorelineinboxcoupons="msShoppingExp52",e.spbPdpCashBack="msShoppingExp53",e.intersperseNativeAds="msShoppingExp54",e.sidepaneCashback="msShoppingExp55",e.spbAutoActivationOnSearch="msShoppingExp56",e.abandonedCartTracking="msShoppingExp57",e.startShoppingMomentInTimeModule="msShoppingExp58",e.triviaIcon="msShoppingExp59",e.groceryOffersSearch="msShoppingExp60",e.spbAutoShowFlagTreatmen="msShoppingExp61",e.rewardNotification="msShoppingExp62",e.discoverShopping="msShoppingExp63",e.cpsPDPcontrolFlag="msShoppingExp64",e.spbPDPShortDesign="msShoppingExp65",e.spbCheckoutAutoActivation="msShoppingExp66",e.domMutationExpansion="msShoppingExp67",e.temporalShoppingOnDiscover="msShoppingExp68",e.computeJourneyStage="msShoppingExp69",e.footerExperiments="msShoppingExp70",e.couponsConfidence="msShoppingExp71",e.ProductBestCouponConsent="msShoppingExp72",e.lowCouponExpectationExpansion="msShoppingExp73",e.spbExpiryMicroNotif="msShoppingExp74",e.spbShortNotification="msShoppingExp75",e.chatChipsOrder3="msShoppingExp76",e.spbHomePage="msShoppingExp77",e.enrollToRebateBonus="msShoppingExp78",e.instantAddToCart="msShoppingExp79",e.autoActivateInstantAtc="msShoppingExp80",e.buyingOptionsExperiment="msShoppingExp81",e.searchFeature="msShoppingExp99",e.sustainability="msShoppingExp100",e.startShoppingCategoryAds="msShoppingExp101",e.startShoppingNativeAds="msShoppingExp110",e.incentiveCampaign="msShoppingExp10000",e.pcEMI="msEdgeShoppingExp2000",e.autoOpenControllerScript="msEdgeShoppingAutoOpenControllerScript",e.autoOpenControllerMask="msEdgeShoppingServerSideAutoShow",e.autofillAutoPopup="msAutofillAutoPopup",e.bgaaService="msEdgeShoppingBackgroundAutoApply",e.bgaaUx="msEdgeShoppingBgaaUx",e.bgaaCheckoutOld="msEdgeShoppingAutoShowBackgroundAutoApply",e.bgaaNonCheckoutOld="msEdgeShoppingBackgroundAutoApplyForPDPAndHomePage",e.bannerShowCoupons="msEdgeShoppingBannerCoupons",e.categoryDeals="msEdgeShoppingPwiloNotificationsCategoryDeals",e.clarity="msEdgeShoppingClarityEnabled",e.clarityWithCookies="msEdgeShoppingClarityEnabledWithCookies",e.clientUrlNavigation="msEdgeShoppingClientUrlNavigation",e.coloredHeader="msShoppingColoredHeader",e.expressCheckout="msEdgeShoppingExpressCheckout",e.expressCheckoutFillDetails="msEdgeShoppingExpressCheckoutFillDetails",e.injectConfirmationScriptUponPurchaseCompletion="msEdgeShoppingAllowInjectConfirmationScriptNextNavigation",e.microNotification="msEdgeShoppingNotifications",e.rebatesSsoFlow="msEdgeShoppingRebatesV2Enroll",e.msWalletBNPL="msWalletBNPL",e.muidNotifications="msEdgeShoppingPwiloNotifications",e.myShopping="msEdgeShoppingMyShopping",e.pcBannerUXExperimentation1="msEdgeShoppingPCBannerUXExperimentation1",e.pcBannerUXExperimentation2="msEdgeShoppingPCBannerUXExperimentation2",e.pcBannerUXExperimentation3="msEdgeShoppingPCBannerUXExperimentation3",e.pcBannerUXExperimentation4="msEdgeShoppingPCBannerUXExperimentation4",e.pcBannerUXExperimentation5="msEdgeShoppingPCBannerUXExperimentation5",e.pcBannerUXExperimentation6="msEdgeShoppingPCBannerUXExperimentation6",e.priceDropNotification="msEdgeShoppingServerNotifications",e.pwiloOnOpenProcessing="msEdgeShoppingPwiloNotificationsOnOpenProcess",e.rewardFlyout="msEdgeShoppingRewards",e.showAmazonOtherSellers="msEdgeShoppingOtherSeller",e.showNudgeTipsOverlay="msShoppingExpNudge",e.showPaymentOptions="msZipPayVirtualCard",e.showPaymentOptionsOnProductPage="msEdgeShoppingProductFlyoutWallet",e.showProductHistory="msWebAssistQuery",e.showWalletFooter="msEnableWallet",e.signinRebates="msEdgeShoppingRebatesSignUp",e.snoozeAutoshow="msEdgeShoppingAutoShowMuteForFeature",e.socialCoupons="msEdgeShoppingExclusiveCoupons",e.socialCouponsAutoShow="msEdgeShoppingExclusiveCouponsAutoShow",e.rebatesOrganicNew="msEdgeShoppingRebatesAutoShowNewUser",e.paneOpenWithTab1="msEdgeShoppingMainTab1",e.paneOpenWithTab2="msEdgeShoppingMainTab2",e.paneOpenWithTab3="msEdgeShoppingMainTab3",e.axShopping="msEnableAXShoppingNavigation",e.shoppingOnDiscover="msEdgeShoppingOnDiscover",e.pcOfferLevel="msShoppingAutoShowPriceComparisonOfferLevel",e.discoverPdpTopPriority="msDiscoverPdpTopPriority",e.limitPdpNotificationsOnLowStages="msLimitPdpNotificationsOnLowStages",e.clientRequests="msEdgeShoppingGenericDealsService",e.shoppingCohorts="msEdgeShoppingCohorts",e.shoppingCohortsReclaimed="msEdgeShoppingCohortsReclaimed",e.shoppingCohortsVulnerable="msEdgeShoppingCohortsVulnerable",e.shoppingSettingsInPane="msEdgeShoppingSettingsInPane",e.shoppingSettingsInPaneNotificationBottomToggle="msEdgeShoppingSettingsInPaneNotificationBottomToggle",e.edgeShoppingRebatesForAADAccounts="msEdgeShoppingRebatesForAADAccounts",e.shoppingCjkProductUpsell="msEdgeShoppingCJKProductUpsell",e.pcAutoshowAvailable="msEdgeShoppingAutoShowPriceComparisonAvailable",e.travel1="msEdgeShoppingTravel1",e.travel2="msEdgeShoppingTravel2",e.travel3="msEdgeShoppingTravel3",e.travel4="msEdgeShoppingTravel4",e.travel5="msEdgeShoppingTravel5",e.travel6="msEdgeShoppingTravel6",e.settingsPaneNavigateFromFlyout="msEdgeShoppingSettingsInPaneNavigationFromFlyout",e.udaPriceComparison="msShoppingUapiExp41",e.autoApplyRewards="msEdgeShoppingAutoApplyRewards",e.cashbackActivationOmnibar="msEdgeShoppingCashbackActivationFromOmnibar",e.CashbackDashboard="edgeServerUX.shopping.cashbackDashboardEnabled",e.CouponsPersonalization="edgeServerUX.shopping.couponsPersonalization",e.PhPersonalization="edgeServerUX.shopping.phPersonalization",e.CashbackPersonalization="edgeServerUX.shopping.cashbackPersonalization",e.cashBackDelayedEnrollmentEdgeFlow="edgeServerUX.shopping.cashBackDelayedEnrollmentEdgeFlow",e.cashbackDismissTimeout="edgeServerUX.shopping.msEdgeShoppingCashbackDismissTimeout2s",e.CouponMessageFiltering="edgeServerUX.shopping.couponMessageFiltering",e.ShoppingTrips="edgeServerUX.shopping.shoppingTrips",e.ServerSideSearchInPane="edgeServerUX.shopping.searchInPane",e.campaign="edgeServerUX.shopping.campaign",e.wishlistModule="edgeServerUX.shopping.wishlistModule",e.campaignAwareness="edgeServerUX.shopping.campaignAwareness",e.cbAnimationVar1="edgeServerUX.shopping.cbAnimationVar1",e.cbAnimationVar4="edgeServerUX.shopping.cbAnimationVar4",e.compositeNotificationsPriceHistoryPlusCoupons="edgeServerUX.shopping.compositeNotificationsPriceHistoryPlusCoupons",e.compositeNotificationsPriceHistoryPlusCouponsV2="edgeServerUX.shopping.compositeNotificationsPriceHistoryPlusCouponsV2",e.cashbackPdpPlusCouponsNotification="edgeServerUX.shopping.compositeNotificationsCashbackPdpPlusCoupons",e.cashbackPdpPlusCouponsNotificationV2="edgeServerUX.shopping.compositeNotificationsV2UX",e.cashbackPdpPlusPriceDropNotification="edgeServerUX.shopping.compositeNotificationsPriceHistoryPlusCashback",e.cashbackPdpPlusPriceDropNotificationV2="edgeServerUX.shopping.compositeNotificationsPriceHistoryPlusCashbackV2",e.lowerPricePdpPlusCashbackPlusCoupons="edgeServerUX.shopping.compositeNotificationsLowerPricePdpPlusCashbackPlusCoupons",e.lowerPricePdpPlusCashbackPlusCouponsV2="edgeServerUX.shopping.compositeNotificationsLowerPricePdpPlusCashbackPlusCouponsV2",e.acTrackingToggle="edgeServerUX.shopping.acTrackingToggle",e.ptConciseUi="edgeServerUX.shopping.ptConciseUi",e.BingL2BRQ="edgeServerUX.shopping.BingL2BRQ",e.SeeAllClickout="edgeServerUX.shopping.SeeAllClickout",e.cartExtractionFromBody="edgeServerUX.shopping.cartExtractionFromBody",e.checkoutPageTypeCheck="edgeServerUX.shopping.checkoutPageTypeCheck",e.PTRecentVwd="edgeServerUX.shopping.PTRecentVwd",e.autosMyGarageEntryPoint="edgeServerUX.shopping.autosMyGarageEntryPoint",e.autosMyGarageEntryPointV2="edgeServerUX.shopping.autosMyGarageEntryPointV2",e.autosMarketValueV2="edgeServerUX.shopping.autosMarketValueV2",e.spbAddToCart="edgeServerUX.shopping.addToCartVariation",e.couponRedesignCompressed="edgeServerUX.shopping.couponRedesignCompressed",e.couponRedesignExpanded="edgeServerUX.shopping.couponRedesignExpanded",e.lostUsersCashBack="edgeServerUX.shopping.lostUsersCashback",e.lostUsersCouponClipping="edgeServerUX.shopping.lostUsersCouponClipping",e.lostUsersPriceComparison="edgeServerUX.shopping.lostUsersPriceComparison",e.lostUsersPriceComparisonRegular="edgeServerUX.shopping.lostUsersPriceComparisonRegular",e.inboxSavings="edgeServerUX.shopping.inboxSavings",e.rakutenJPClipping="edgeServerUX.shopping.rakutenJP",e.clippingV2="edgeServerUX.shopping.clippingV2",e.CouponsPipelineV2="shopping.couponsV2Pipeline",e.PTOutOfStockVariations="edgeServerUX.shopping.PTOutOfStockVariations",e.spbSearchAutoActivation="edgeServerUX.shopping.spbSearchAutoActivation",e.postPurchaseTracking="edgeServerUX.shopping.postPurchaseTracking",e.PTEmail="edgeServerUX.shopping.ptEmailConsent",e.pdpStorewideCashbackEstimation="edgeServerUX.shopping.pdpStorewideCashbackEstimation",e.blockLowPerformanceNotifications="edgeServerUX.shopping.blockLowPerformanceNotifications",e.instantAddToCartExperiment="edgeServerUX.shopping.InstantATC",e.pcbAmazonSearch="edgeServerUX.shopping.pcbAmazonSearch",e.suppressAutoApply="edgeServerUX.shopping.suppressAutoApply",e.cbSplitModules="edgeServerUX.shopping.SeparateCashBackModules",e.inboxCouponsAAFailureUpsell="edgeServerUX.shopping.inboxCouponsAAFailureUpsell",e.inboxCouponsAASuccessUpsell="edgeServerUX.shopping.inboxCouponsAASuccessUpsell",e.mobileCashbackModule="edgeServerUX.shopping.mobileCashbackModule",e.mobileProductModules="edgeServerUX.shopping.mobileProductModules",e.suppressAAAutoApplyThreshold="edgeServerUX.shopping.AAAutoApplyFailureThreshold",e.suppressAADomainSuccessThreshold="edgeServerUX.shopping.AADomainSuccessThreshold",e.ptCouponsCashbackNotification="edgeServerUX.shoppping.ptCouponsCashbackNotification",e.journeyStageTelemetry="edgeServerUX.shopping.journeyStageTelemetry",e.revampedPriceComparison="edgeServerUX.shopping.revampedPriceComparison",e.qtCartPageAutoActivation="edgeServerUX.shopping.qtAutoActivation",e.discoverChatChips="edgeServerUX.shopping.discoverChatChips",e.discoverNotification="edgeServerUX.shopping.discoverNotification",e.discoverNotification50="edgeServerUX.shopping.discoverNotification50",e.discoverNotification100="edgeServerUX.shopping.discoverNotification100",e.discoverNotification500="edgeServerUX.shopping.discoverNotification500",e.travelCheaperFlights="edgeServerUX.shopping.travelCheaperFlights",e.travelCheaperFlightsListView="edgeServerUX.shopping.travelCheaperFlightsListView",e.travelExecuteAutoOpenService="edgeServerUX.shopping.travelExecuteAutoOpenService",e.travelIsHotelExperimentActive="edgeServerUX.shopping.travelIsHotelExperimentActive",e.travelRenderCheaperFlightsNotification="edgeServerUX.shopping.travelRenderCheaperFlightsNotification",e.travelForceMarket="edgeServerUX.shopping.travelForceMarket",e.travelCheaperFlightsModule="edgeServerUX.shopping.travelCheaperFlightsModule",e.travelRenderCheaperHotelsNotification="edgeServerUX.shopping.travelRenderCheaperHotelsNotification",e.pageDetection="edgeServerUX.shopping.pageDetection",e.disableJourneyStageComputation="edgeServerUX.shopping.disableJourneyStageComputation",e.userInsights="edgeServerUX.shopping.userInsights",e.expertInsights="edgeServerUX.shopping.expertInsights",e.communityInsightsPH="edgeServerUX.shopping.communityInsightsPH",e.communityInsightsPC="edgeServerUX.shopping.communityInsightsPC",e.communityInsightsCB="edgeServerUX.shopping.communityInsightsCB",e.ptAbandonedCartNotificationToggle="edgeServerUX.shopping.ptAbandonedCartNotificationToggle",e.productSummaryCardEnabled="edgeServerUX.shopping.productSummaryCardTestExp99",e.productSummaryCardEnabledSticky="edgeServerUX.shopping.productSummaryCardStickyTestExp99",e.productSummaryInsights="edgeServerUX.shopping.productSummaryInsightsInShoppingPane",e.cbMerchantAbTesting="edgeServerUX.shopping.merchantAbTesting",e.cbMerchantAbTestingControl="edgeServerUX.shopping.merchantAbTestingCf",e.showSpbOffersOnShorelineOpen="edgeServerUX.shopping.showSpbOffersOnShorelineOpen",e.showSpbOffersOnShorelineOpenV2="edgeServerUX.shopping.showSpbOffersOnShorelineOpenV2",e.aaNoDontShowAgain="edgeServerUX.shopping.aaNoDontShowAgain",e.aaEarlyReturn="edgeServerUX.shopping.aaEarlyReturn",e.articlesCashbackNotification="edgeServerUX.shopping.artCashNotif",e.suppressLowCTR="edgeServerUX.shopping.suppressLowCTR",e.couponBackgroundDarkCode="edgeServerUX.shopping.couponBackgroundDarkCode",e.couponBackgroundLightCode="edgeServerUX.shopping.couponBackgroundLightCode",e.couponLightCode="edgeServerUX.shopping.couponLightCode",e.couponDarkCode="edgeServerUX.shopping.couponDarkCode",e.cashbackEUMarkets="edgeServerUX.shopping.cashbackEUMarkets",e.autoSuppressNegativeBGAA="edgeServerUX.shopping.autoSupperssNegativeBGAA",e.bgaaNoSnoozeTime="edgeServerUX.shopping.bgaaNoSnoozeTime",e.newHeader="edgeServerUX.shopping.newHeader",e.loggingThrottle="edgeServerUX.shopping.loggingThrottle",e.sellerIconCovIncr="edgeServerUX.shopping.sellerIconCovIncr",e.pcSeeMore="edgeServerUX.shopping.pcSeeMore",e.priceCompareV2="edgeServerUX.shopping.priceCompareV2",e.pcNotificationCashbackV2="edgeServerUX.shopping.pcNotifCbV2",e.couponValidityFix="edgeServerUX.shopping.couponValidityFix",e.domMutationReverseFlight="domMutationReverseFlight",e.fragmentPageTypeFiltering="edgeServerUX.shopping.fragmentPageTypeFiltering",e.cashbackConsolidationExp="edgeServerUX.shopping.cashbackRefactor_v4",e.collectAllFragments="edgeServerUX.shopping.collectAllFragments",e.disablePageTypeCollectionForFragments="edgeServerUX.shopping.disablePageTypeCollectionForFragments",e.smartDebounce="edgeServerUX.shopping.smartDebounceEnabled",e.suppressedCoupons="edgeServerUX.shopping.suppressedCoupons",e.autoShowNotificationForAmazonWarehouseSellers="edgeServerUX.shopping.AutoShowNotificationAmazonWarehouseSeller",e.pcAutoshowExpanded="edgeServerUX.shopping.pcAutoshowExpanded",e.pcNotificationButtonText="edgeServerUX.shopping.pcNotificationButtonText",e.pcCloseSnooze="edgeServerUX.shopping.pcCloseSnooze",e.cashbackCloseSnooze="edgeServerUX.shopping.cashbackCloseSnooze",e.phCloseSnooze="edgeServerUX.shopping.phCloseSnooze",e.clipCloseSnooze="edgeServerUX.shopping.clipCloseSnooze",e.aaCloseSnooze="edgeServerUX.shopping.aaCloseSnooze",e.autosCloseSnooze="edgeServerUX.shopping.autosCloseSnooze",e.disableNotificationForSimilarSellers="edgeServerUX.shopping.DisableNotificationSimilarSeller",e.disableCashbackOrganicNotification="edgeServerUX.shopping.disableCashbackOrganicNotification",e.disableSPBNotification="edgeServerUX.shopping.disableSPBNotification",e.spbOffersSearch="edgeServerUX.shopping.authoShowSpbT",e.shorelineUAPIBackfill="edgeServerUX.shopping.shorelineUAPIBackfill",e.spbDismissTimeout="edgeServerUX.shopping.spbDismissTimeout",e.spbCloseSnooze="edgeServerUX.shopping.spbCloseSnooze",e.purchaseExtractionRefactor="edgeServerUX.shopping.purchaseExtractionRefactor",e.fixCartUpdate="edgeServerUX.shopping.fixCartUpdate",e.buyingOptions="edgeServerUX.shopping.buyingOptions",e.ptOutOfStock="edgeServerUX.shopping.ptOutOfStock",e.loadingSpinnerWithTimeout="edgeServerUX.shopping.loadingSpinnerWithTimeout",e.pcbStorewideUXDesignChange="edgeServerUX.shopping.pcbStorewideUXDesignChangev3",e.personalizePromotionNewUser="edgeServerUX.shopping.ppNewUser",e.pdpRerank="edgeServerUX.shopping.pdpRerank",e.ptNotifications="edgeServerUX.shopping.ptNotifications",e.improvedCartModelCouponHandling="edgeServerUX.shopping.improvedCartModelCouponHandling",e.sendCouponsToCartModel="edgeServerUX.shopping.sendCouponsToCartModel",e.onlyShowAANotificationWithEligibleCoupons="edgeServerUX.shopping.onlyShowAANotificationWithEligibleCoupons",e.storewideRangeCashback="edgeServerUX.shopping.storewideRangeCashback",e.autoOpenPaneScenariosActive="edgeServerUX.shopping.autoOpenPaneScenariosActive",e.autoOpenPaneDismissTime="edgeServerUX.shopping.autoOpenPaneDismissTime",e.enablePurchaseDetectionRewardsAPI="edgeServerUX.shopping.enablePurchaseDetectionRewardsAPI",e.enableCashbackCampaignEmail="edgeServerUX.shopping.enableCashbackCampaignEmail",e.enablePostPurchaseMessage="edgeServerUX.shopping.enablePostPurchaseMessage",e}({})},31714:function(e,t,o){o.d(t,{Gc:function(){return r},Nm:function(){return a},nV:function(){return i},qG:function(){return s},vr:function(){return n}});let i=function(e){return e.RuleBased="rule",e.ML="ml",e}({}),r=function(e){return e.Micro="mlmicro",e.Limit="mllimit",e}({}),a=function(e){return e.Micro="mlmicro",e.Limit="mllimit",e}({}),n=function(e){return e.FirstMask="msEdgeShoppingAutoShowScenariosFirstMask",e.SecondMask="msEdgeShoppingAutoShowScenariosSecondMask",e}({}),s=function(e){return e.CouponLevelThreshold="CouponLevelThreshold",e.DomainLevelThreshold="DomainLevelThreshold",e}({})},31656:function(e,t,o){o.d(t,{R:function(){return l}});var i=o(72370),r=o(88101),a=o(4872),n=o(78938),s=o(47594),c=o(64865);const l=new class{constructor(){(0,i.Z)(this,"experiments",new Map),(0,i.Z)(this,"serviceExperiments",new Map),(0,i.Z)(this,"experimentsSet",new Set),(0,i.Z)(this,"serviceExperimentsSet",new Set),(0,i.Z)(this,"enablePCBannerUX",!1),(0,i.Z)(this,"expRawData",void 0),(0,i.Z)(this,"serviceFeatures",void 0),(0,i.Z)(this,"rawEnabledFeatures",void 0),(0,i.Z)(this,"rawEnabledServiceFeatures",void 0)}Create(e,t){this.experiments=new Map,this.serviceExperiments=new Map,this.experimentsSet=new Set,this.serviceExperimentsSet=new Set,"string"==typeof e?this.CreateFromJsonStr(e):this.CreateClientFeatures(e),t&&("string"==typeof t?this.CreateServiceFeaturesFromJsonStr(t):this.CreateServiceFeaturesFromJsonObj(t)),this.rawEnabledFeatures=e,this.rawEnabledServiceFeatures=t}GetEnabledFeaturesMap(){return this.experiments??new Map}GetExpRawData(){return this.expRawData}GetRawEnabledFeatures(){return this.rawEnabledFeatures}GetRawEnabledServiceFeatures(){return this.rawEnabledServiceFeatures}GetServiceExperiments(){return this.serviceFeatures}isExperimentActive(e){return this.experimentsSet.has(e)||this.serviceExperimentsSet.has(e)}getServiceExperimentValue(e){return this.serviceExperiments.get(e)?.value}getServiceExperimentParams(e){return this.serviceExperiments.get(e)?.params}isTestFlagActive(e){return this.experimentsSet.has(e.toString())||this.serviceExperimentsSet.has(e.toString())}setShowPCBannerUX(e,t,o,i){this.enablePCBannerUX=void 0!==e&&e||void 0!==t&&t&&void 0!==o&&o.CompetingPrices&&o.CompetingPrices.length>0&&void 0!==i&&i}isPCBannerUXExperimentActive(){return(this.experimentsSet.has(a.H.pcBannerUXExperimentation1)||this.experimentsSet.has(a.H.pcBannerUXExperimentation2)||this.experimentsSet.has(a.H.pcBannerUXExperimentation3)||this.experimentsSet.has(a.H.pcBannerUXExperimentation4)||this.experimentsSet.has(a.H.pcBannerUXExperimentation5)||this.experimentsSet.has(a.H.pcBannerUXExperimentation6))&&this.enablePCBannerUX}newFlyoutHeaderActive(){return this.experimentsSet.has(a.H.newHeader)}isVariantActive(e,t){return!!this.isExperimentActive(e)&&this.experiments.get(e)?.variant===t}isMultipleVariantActive(e,t,o){if(this.isExperimentActive(e)){const i=this.experiments.get(e);if(!i)return!1;if(i.variant===o)return!0;if(i.multipleVariants&&i.multipleVariants.length>0&&-1!==i.multipleVariants.findIndex((e=>e.key===t&&e.value===o)))return!0}return!1}getVariantValue(e,t,o){return parseInt(e.find((e=>e.key===t&&!(0,c.TF)(e.value)))?.value??o.toString(),void 0)}getVariantStringValue(e,t,o){return e.find((e=>e.key===t&&!(0,c.TF)(e.value)))?.value??o}getMultipleVariants(e){return this.isExperimentActive(e)?this.experiments.get(e)?.multipleVariants??[]:[]}getVariantName(e){const t=this.experiments.get(e);if(this.isExperimentActive(e)&&t&&t.variant)return t.variant}createServiceFeaturesFromMap(e){const t=new Map;e&&e.length>0&&e.forEach((e=>{const o=new n.Z,i=e[0];"object"==typeof e[1]?(o.value=e[1].value?.toString(),o.params=new Map(Object.entries(e[1].params))):(o.value=e[1],o.params=new Map),"false"!==o.value&&(t.set(i,o),this.serviceExperimentsSet.add(i))})),this.serviceExperiments=t}CreateClientFeatures(e){this.expRawData=e;const t=new Map;if(e&&e.length>0){const o=Object.values(a.H),i=Object.values(s.t);e.forEach((e=>{const a=new r.Z;a.name=e.name,a.supported=!1,e.params?.length>1?a.multipleVariants=e.params:e.params?.length>0&&(a.variant=e.params[0].value),(o.includes(e.name)||i.includes(e.name))&&(1===e.params?.length&&!1===e.params[0]?a.supported=!1:(a.supported=!0,this.experimentsSet.add(e.name))),t.set(a.name,a)}))}this.experiments=t}CreateFromJsonStr(e){try{if(e){const t=JSON.parse(e);this.CreateClientFeatures(t)}}catch(e){}}CreateServiceFeaturesFromJsonStr(e){if(!e)return;const t=JSON.parse(e);this.CreateServiceFeaturesFromJsonObj(t)}CreateServiceFeaturesFromJsonObj(e){e&&(this.serviceFeatures=e,this.createServiceFeaturesFromMap(Object.entries(e)))}}},78938:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"value",void 0),(0,i.Z)(this,"params",void 0)}}},47594:function(e,t,o){o.d(t,{t:function(){return i}});let i=function(e){return e.msShoppingTestExp1="msShoppingTestExp1",e.msShoppingTestExp2="msShoppingTestExp2",e.msShoppingTestExp3="msShoppingTestExp3",e.msShoppingTestExp4="msShoppingTestExp4",e.msShoppingTestExp5="msShoppingTestExp5",e.msShoppingTestExp6="msShoppingTestExp6",e.msShoppingTestExp7="msShoppingTestExp7",e.msShoppingTestExp8="msShoppingTestExp8",e.msShoppingTestExp9="msShoppingTestExp9",e.msShoppingTestExp10="msShoppingTestExp10",e.msShoppingTestExp11="msShoppingTestExp11",e.msShoppingTestExp12="msShoppingTestExp12",e.msShoppingTestExp13="msShoppingTestExp13",e.msShoppingTestExp14="msShoppingTestExp14",e.msShoppingTestExp15="msShoppingTestExp15",e.msShoppingTestExp16="msShoppingTestExp16",e.msShoppingTestExp17="msShoppingTestExp17",e.msShoppingTestExp18="msShoppingTestExp18",e.msShoppingTestExp99="msShoppingTestExp99",e}({})},57021:function(e,t,o){var i=o(72370);class r{static Now(){return Math.round((new Date).getTime()/1e3)}constructor(e,t){(0,i.Z)(this,"Lifetime",void 0),(0,i.Z)(this,"Timestamp",void 0),this.Lifetime=e,this.Timestamp=t||r.Now()}Expired(){return r.Now()-this.Timestamp>=this.Lifetime}}t.Z=r},36818:function(e,t,o){var i=o(72370),r=o(5144),a=o(58474);class n extends a.Z{constructor(e,t){super(),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"EntryPoint",void 0),(0,i.Z)(this,"AutoApplyResult",void 0),(0,i.Z)(this,"CouponResults",void 0),(0,i.Z)(this,"AutoApplyProcessTime",void 0),(0,i.Z)(this,"BestCoupon",void 0),(0,i.Z)(this,"Discount",void 0),(0,i.Z)(this,"StartingPrice",void 0),(0,i.Z)(this,"ErrorName",void 0),(0,i.Z)(this,"Currency",void 0),(0,i.Z)(this,"PageCurrency",void 0),(0,i.Z)(this,"IsStackable",void 0),(0,i.Z)(this,"AutoApplyScenario",void 0),(0,i.Z)(this,"ExtractedSelectors",void 0),(0,i.Z)(this,"CartExtractionId",void 0),(0,i.Z)(this,"Market",void 0),(0,i.Z)(this,"PageUrl",void 0),(0,i.Z)(this,"Metadata",void 0),this.Domain=e,this.EntryPoint=t??r.N9.Shopping,this.PageUrl=window?.location?.href??""}SetResultData(e,t,o,i,r,a,n,s,c,l,u,d){this.AutoApplyResult=e,this.AutoApplyProcessTime=t,this.BestCoupon=o,this.CouponResults=i,this.Discount=r,this.StartingPrice=a,this.IsStackable=n,this.AutoApplyScenario=s,this.ExtractedSelectors=c,this.CartExtractionId=l,this.Market=u,this.Metadata=JSON.stringify(d)}SetErrorData(e,t){this.AutoApplyResult=e,this.ErrorName=t}SetCurrencyInfo(e,t){this.Currency=e,this.PageCurrency=t}}t.Z=n},93209:function(e,t,o){var i=o(72370),r=o(58474);class a extends r.Z{constructor(e,t,o,r,a){super(),(0,i.Z)(this,"ButtonClicked",void 0),(0,i.Z)(this,"ModuleId",void 0),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"Metadata",void 0),(0,i.Z)(this,"FlyoutId",void 0),this.ButtonClicked=e,this.ModuleId=t,this.Domain=o,this.Metadata=r,this.FlyoutId=a}}t.Z=a},84830:function(e,t,o){o.d(t,{Z:function(){return c}});var i=o(72370),r=o(4872),a=o(31656);class n{static CreateInstance(e){n.instance=new n(e)}static async SetTag(e,t){n.instance&&t&&n.instance.clarityEnabled&&n.instance.WaitForClarityToLoad().then((()=>{window[n.clarityKey]("set",e,t)}))}static ReportClientInfo(e,t,o){n.reportedClientContextInfo||(n.SetTag(n.TAGNAME_CLIENTNAME,e),n.SetTag(n.TAGNAME_JSVERSION,t),n.SetTag(n.TAGNAME_EDGEVERSION,o),n.reportedClientContextInfo=!0)}constructor(e){(0,i.Z)(this,"clarityEnabled",!1),(a.R?.isExperimentActive(r.H.clarity)||a.R?.isExperimentActive(r.H.clarityWithCookies))&&(this.clarityEnabled=!0)}async WaitForClarityToLoad(){for(;!window.hasOwnProperty(n.clarityKey);)await new Promise((e=>{setTimeout(e,1e3)}))}}(0,i.Z)(n,"TAGNAME_DOMAIN","domain"),(0,i.Z)(n,"TAGNAME_FLIGHT","flight"),(0,i.Z)(n,"TAGNAME_VIEW","view"),(0,i.Z)(n,"TAGNAME_CLIENTNAME","appinfoclientname"),(0,i.Z)(n,"TAGNAME_JSVERSION","jsversion"),(0,i.Z)(n,"TAGNAME_EDGEVERSION","edgeversion"),(0,i.Z)(n,"clarityKey","clarity"),(0,i.Z)(n,"instance",void 0),(0,i.Z)(n,"reportedClientContextInfo",!1);var s=n,c=class{constructor(e,t,o,r,a,n,c){(0,i.Z)(this,"AppInfoClientName",void 0),(0,i.Z)(this,"JSVersion",void 0),(0,i.Z)(this,"BuildVersion",void 0),(0,i.Z)(this,"EnabledServiceFlights",void 0),(0,i.Z)(this,"MUID",void 0),(0,i.Z)(this,"EnabledServiceFeaturesV2",void 0),(0,i.Z)(this,"Channel",void 0),(0,i.Z)(this,"Enabledfeatures",void 0),this.AppInfoClientName=e,this.JSVersion=t,this.BuildVersion=o,this.EnabledServiceFlights=r,this.EnabledServiceFeaturesV2=a,s.ReportClientInfo(e,t,o),this.Channel=n,this.Enabledfeatures=c}}},80090:function(e,t,o){var i=o(72370),r=o(58474);class a extends r.Z{constructor(e,t,o,r){super(),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"Data",void 0),(0,i.Z)(this,"ErrorType",void 0),(0,i.Z)(this,"StackTrace",void 0),this.Domain=e,this.StackTrace=r,this.Data=JSON.stringify(o),this.ErrorType=t}}t.Z=a},14732:function(e,t,o){o.d(t,{i:function(){return a}});var i=o(72370),r=o(5144);const a=new class{constructor(){(0,i.Z)(this,"appName",void 0),this.appName=r.BN.Edge}SetAppName(e){this.appName=e}GetAppName(){return this.appName}}},12953:function(e,t,o){var i=o(72370),r=o(58474);class a extends r.Z{constructor(e,t,o,r,a,n){super(),(0,i.Z)(this,"CouponCode",void 0),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"Scenario",void 0),(0,i.Z)(this,"PageUrl",void 0),(0,i.Z)(this,"data",void 0),(0,i.Z)(this,"description",void 0),this.CouponCode=e,this.Domain=t,this.Scenario=o,this.PageUrl=r,this.data=a??"",this.description=n}}t.Z=a},59645:function(e,t,o){var i=o(72370),r=o(58474);class a extends r.Z{constructor(e,t,o,r,a){super(),(0,i.Z)(this,"EdgeFlyoutStatus",void 0),(0,i.Z)(this,"ComparableOffersCount",void 0),(0,i.Z)(this,"SavingsAmount",void 0),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"Metadata",void 0),(0,i.Z)(this,"FlyoutId",void 0),this.EdgeFlyoutStatus=e,this.ComparableOffersCount=t,this.SavingsAmount=o,this.Domain=r,this.Metadata=a}}t.Z=a},58474:function(e,t){t.Z=class{ToString(){return JSON.stringify(this)}}},79308:function(e,t,o){var i=o(72370),r=o(58474);class a extends r.Z{constructor(...e){super(...e),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"Savings",void 0),(0,i.Z)(this,"InitialPrice",void 0),(0,i.Z)(this,"Currency",void 0),(0,i.Z)(this,"Result",void 0),(0,i.Z)(this,"PageCurrency",void 0)}SetResultData(e,t,o,i,r,a){this.Domain=e,this.Savings=t??0,this.InitialPrice=o??0,this.Currency=i,this.PageCurrency=r,this.Result=a}}t.Z=a},73765:function(e,t,o){var i=o(72370),r=o(58474);class a extends r.Z{constructor(e,t,o,r,a){super(),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"Scenario",void 0),(0,i.Z)(this,"PageUrl",void 0),(0,i.Z)(this,"event_metadata",void 0),(0,i.Z)(this,"event",void 0),this.Domain=e,this.Scenario=t,this.PageUrl=o,this.event_metadata=a??"",this.event=r}}t.Z=a},82960:function(e,t,o){o.d(t,{v:function(){return r}});var i=o(72370);class r{static uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}constructor(e){(0,i.Z)(this,"Type",void 0),(0,i.Z)(this,"ID",void 0),this.Type=e,this.ID=""}toString(){return JSON.stringify(this)}}t.Z=r},17204:function(e,t,o){o(5144)},15612:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"otherSellers",void 0),(0,i.Z)(this,"productImage",void 0),(0,i.Z)(this,"productPrice",void 0),(0,i.Z)(this,"currency",void 0),(0,i.Z)(this,"productUrl",void 0),(0,i.Z)(this,"dataCreationTime",void 0)}static Create(e){const t=new r;return t.productImage=e.productImage,t.productPrice=e.productPrice,t.productUrl=e.productUrl,t.currency=e.currency,t.otherSellers=new Array,e.otherSellers.forEach((e=>{t.otherSellers.push(e)})),t}}t.Z=r},17675:function(e,t,o){o.d(t,{l:function(){return r}});var i=o(72370);class r{}(0,i.Z)(r,"ruleBasedTriggerDataKey","RuleBasedTriggerData"),(0,i.Z)(r,"defaultCouponExpectationWeight",2),(0,i.Z)(r,"positiveEngagementWeight",3),(0,i.Z)(r,"isSpiritedShopperWeight",1),(0,i.Z)(r,"mlWeight",3),(0,i.Z)(r,"defaultPriceDropWeight",2),(0,i.Z)(r,"defaultBestCompetingPriceWeight",2),(0,i.Z)(r,"scoreThreshold",.4),(0,i.Z)(r,"noPreviousUserDataAutoOpenRate",.6),(0,i.Z)(r,"noPreviousUserDataAlwaysOpenCouponExpectation",.5),(0,i.Z)(r,"noPreviousUserDataAlwaysOpenCouponExpectationV0",.2),(0,i.Z)(r,"noPreviousUserDataAlwaysOpenPriceDrop",.2),(0,i.Z)(r,"noPreviousUserDataAlwaysOpenBestCompetingPrice",.2),(0,i.Z)(r,"mlFirstHighConfidenceRange",.3),(0,i.Z)(r,"mlSecondHighConfidenceRange",.7),(0,i.Z)(r,"minEngagementCount",4),(0,i.Z)(r,"minEngagementCountV1",2),(0,i.Z)(r,"engagementScoreThreshold",.5),(0,i.Z)(r,"flyoutReintroduceDays",1)},13018:function(e,t,o){var i=o(72370),r=o(17675);t.Z=class{constructor(e,t,o){(0,i.Z)(this,"userEngagementResults",void 0),(0,i.Z)(this,"couponExpectationWeight",void 0),(0,i.Z)(this,"firstTimeAutoOpenDisabled",void 0),(0,i.Z)(this,"flyoutReintroduceDays",r.l.flyoutReintroduceDays),(0,i.Z)(this,"flyoutReintroduceIsForced",!1),(0,i.Z)(this,"notificationTracker",void 0),this.userEngagementResults=e,this.couponExpectationWeight=t??r.l.defaultCouponExpectationWeight,this.firstTimeAutoOpenDisabled=o}}},12710:function(e,t,o){},99182:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"domainSelector",void 0),(0,i.Z)(this,"productTitleSelector",void 0),(0,i.Z)(this,"productImageSelector",void 0),(0,i.Z)(this,"productLinkSelector",void 0)}static Create(e){const t=new r;return t.domainSelector=e.domainSelector,t.productTitleSelector=e.productTitleSelector,t.productImageSelector=e.productImageSelector,t.productLinkSelector=e.productLinkSelector,t}}t.Z=r},95016:function(e,t,o){o(88767)},1583:function(e,t,o){o(27689)},81731:function(e,t,o){var i=o(72370);t.Z=class{constructor(e){(0,i.Z)(this,"Timestamp",void 0),(0,i.Z)(this,"ProductId",void 0),(0,i.Z)(this,"Title",void 0),(0,i.Z)(this,"CurrencySymbol",void 0),(0,i.Z)(this,"ProductUrl",void 0),(0,i.Z)(this,"ImageUrl",void 0),(0,i.Z)(this,"CurrentPrice",void 0),(0,i.Z)(this,"OlderPrice",void 0),this.Timestamp=e?.timestamp,this.ProductId=e?.productId,this.Title=e?.title,this.CurrencySymbol=e?.currencySymbol,this.ProductUrl=e?.productUrl,this.ImageUrl=e?.imageUrl,this.CurrentPrice=e?.currentPrice,this.OlderPrice=e?.olderPrice}}},11232:function(e,t,o){var i=o(72370);t.Z=class{constructor(e,t,o){(0,i.Z)(this,"title",void 0),(0,i.Z)(this,"imageUrl",void 0),(0,i.Z)(this,"currency",void 0),(0,i.Z)(this,"extractedImage",void 0),(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"ProductUrl",void 0),(0,i.Z)(this,"base64ProductImage",void 0),(0,i.Z)(this,"triggerPriceHistoryIncreasedAlert",!1),(0,i.Z)(this,"triggerPriceHistoryMinorDropAlert",!1),(0,i.Z)(this,"triggerPriceHistoryStableAlert",!1),(0,i.Z)(this,"originalPrice",void 0),this.title=e,this.imageUrl=t,this.currency=o}}},40843:function(e,t,o){var i=o(72370),r=o(65358),a=o(17609);t.Z=class{constructor(e){if((0,i.Z)(this,"trackedProducts",[]),(0,i.Z)(this,"_anid",void 0),(0,i.Z)(this,"_muid",void 0),(0,i.Z)(this,"_currentProduct",void 0),(0,i.Z)(this,"_abandonedCartNotificationToggle",void 0),(0,i.Z)(this,"timestamp",void 0),(0,i.Z)(this,"isUnsupportedDomain",void 0),(0,i.Z)(this,"trackingPreferences",void 0),e){this.trackingPreferences=new a.Z(e.trackingPreferences),this.isUnsupportedDomain=e.isUnsupportedDomain;for(const t of e.trackedProducts){const e=new r.ZP(t);e.Title&&e.ProductUrl&&this.trackedProducts.push(e)}}}}},65358:function(e,t,o){o.d(t,{ZP:function(){return s}});var i=o(72370),r=o(81731);let a=function(e){return e.AbandonedCart="AbandonedCart",e.Explicit="Explicit",e.PostPurchase="PostPurchase",e}({});class n extends r.Z{constructor(e){super(e),(0,i.Z)(this,"basePrice",void 0),(0,i.Z)(this,"notificationEnabled",!1),(0,i.Z)(this,"notificationPercentageDrop",void 0),(0,i.Z)(this,"lastNotifiedAt",void 0),(0,i.Z)(this,"expirationDate",void 0),(0,i.Z)(this,"trackingType",void 0),(0,i.Z)(this,"metadata",void 0),(0,i.Z)(this,"imageUrl",void 0),(0,i.Z)(this,"durationInWeeks",void 0),(0,i.Z)(this,"trackingSource",a.Explicit),(0,i.Z)(this,"notifyForComparableProduct",!1),(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"comparableProductNotification",void 0),(0,i.Z)(this,"highSuccessRateCoupon",void 0),(0,i.Z)(this,"cashbackCommission",void 0),(0,i.Z)(this,"sellerName",void 0),(0,i.Z)(this,"lastPriceUpdateDate",void 0),(0,i.Z)(this,"lastNotificationEnabledDate",void 0),this.basePrice=e?.basePrice,void 0!==e?.notificationEnabled&&(this.notificationEnabled=e?.notificationEnabled),this.notificationPercentageDrop=e?.notificationPercentageDrop,this.lastNotifiedAt=e?.lastNotifiedAt,this.expirationDate=e?.expirationDate,this.trackingType=e?.trackingType,this.metadata=e?.metadata,this.imageUrl=e?.imageUrl,this.durationInWeeks=e?.durationInWeeks,void 0!==e?.trackingSource&&(this.trackingSource=e?.trackingSource),void 0!==e?.notifyForComparableProduct&&(this.notifyForComparableProduct=e?.notifyForComparableProduct),this.domain=e?.domain,this.comparableProductNotification=new class{constructor(e){(0,i.Z)(this,"url",void 0),(0,i.Z)(this,"productId",void 0),(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"globalOfferId",void 0),(0,i.Z)(this,"trackingUrl",void 0),this.url=e?.url,this.productId=e?.productId,this.domain=e?.domain,this.price=e?.price,this.globalOfferId=e?.globalOfferId,this.trackingUrl=e?.trackingUrl}}(e?.comparableProductNotification),this.highSuccessRateCoupon=e?.highSuccessRateCoupon?new class{constructor(e){(0,i.Z)(this,"couponCode",void 0),(0,i.Z)(this,"successRate",void 0),(0,i.Z)(this,"discountRate",void 0),(0,i.Z)(this,"sellerName",void 0),this.couponCode=e?.couponCode,this.successRate=e?.successRate,this.discountRate=e?.discountRate,this.sellerName=e?.sellerName}}(e?.highSuccessRateCoupon):void 0,this.cashbackCommission=e?.cashbackCommission?new class{constructor(e){(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"value",void 0),(0,i.Z)(this,"sellerName",void 0),this.domain=e?.domain,this.type=e?.type,this.value=e?.value,this.sellerName=e?.sellerName}}(e?.cashbackCommission):void 0,this.sellerName=e?.seller,this.lastPriceUpdateDate=e?.lastPriceUpdateDate,this.lastNotificationEnabledDate=e?.lastPriceUpdatePrice}}var s=n},17609:function(e,t,o){var i=o(72370);t.Z=class{constructor(e){(0,i.Z)(this,"abandonedCartTrackingEnabled",void 0),(0,i.Z)(this,"lastUpdatedAt",void 0),(0,i.Z)(this,"IsAnidTrackingConsented",void 0),(0,i.Z)(this,"_abandonedCartTrackingUnset",void 0),void 0===e?(this.abandonedCartTrackingEnabled=!0,this._abandonedCartTrackingUnset=!0,this.IsAnidTrackingConsented=!1):(this.abandonedCartTrackingEnabled=e.abandonedCartTrackingEnabled,this.IsAnidTrackingConsented=e.isAnidTrackingConsented),this.lastUpdatedAt=e?.lastUpdatedAt}}},11501:function(e,t,o){o.d(t,{Z:function(){return n}});var i=o(72370),r=o(45822),a=o(5144);class n{constructor(e){(0,i.Z)(this,"fragmentCollection",void 0),(0,i.Z)(this,"piiExtraction",void 0),(0,i.Z)(this,"transactionIdSettings",void 0),(0,i.Z)(this,"selectorTimeouts",void 0),(0,i.Z)(this,"isDisableProductNamesCollectionOnConfirmation",void 0),(0,i.Z)(this,"isDisablePurchaseTotalCollectionOnConfirmation",void 0),(0,i.Z)(this,"other",void 0),e&&(this.other=e.other,this.fragmentCollection=e.fragmentCollection,this.piiExtraction=e.piiExtraction,this.transactionIdSettings=e.transactionIdSettings,this.selectorTimeouts=e.selectorTimeouts,this.isDisableProductNamesCollectionOnConfirmation=e.isDisableProductNamesCollectionOnConfirmation,this.isDisablePurchaseTotalCollectionOnConfirmation=e.isDisablePurchaseTotalCollectionOnConfirmation)}GetOtherFeatureFlag(e,t=!1){return this.other&&this.other[e]?"true"===this.other[e].toLowerCase():t}IsAttibutionEnabled(){return this.GetOtherFeatureFlag("isEdgeAttributionEnabled")}GetFragmentCollectionTimeout(e){const t=this.fragmentCollection?.collectionRates;if(!t)return 0;const o=this.GetRatesForPageType(e,t);if(this.IsValidRate(o?.collectionTimeoutMs))return o?.collectionTimeoutMs??0;const i=t.allPages;return this.IsValidRate(i?.collectionTimeoutMs)?i?.collectionTimeoutMs??0:0}GetCollectionRate(e,t,o){if(!this.fragmentCollection?.isEnabled)return 0;const i=this.fragmentCollection?.collectionRates;if(!i)return 0;if(this.IsDisableCollectionOnPage(i,e))return 0;const r=this.GetRateFromObject(e,this.GetRatesForPageType(t,i),o);if(this.IsValidRate(r))return r??0;const a=this.GetRateFromObject(e,i.allPages,o);return this.IsValidRate(a)?a??0:0}IsDisableCollectionOnPage(e,t){return!!t&&!!(e.disableCollectionPages&&e.disableCollectionPages.length>0&&this.FindRegexMatch(t,e.disableCollectionPages))}GetRateFromObject(e,t,o){if(t){if(o)return this.IsValidRate(t.extractionIfBroken)?t.extractionIfBroken:this.other?.defaultExtractionIfBroken?this.ToValidRate(this.other?.defaultExtractionIfBroken):void 0;if(t.extractionForRegex&&e){const o=this.FindRateFromRegexMatch(e,t.extractionForRegex);if(this.IsValidRate(o))return o}return this.IsValidRate(t.defaultExtraction)?t.defaultExtraction:void 0}}FindRegexMatch(e,t){for(const o of t)if((0,r.io)(e,o))return o}FindRateFromRegexMatch(e,t){for(const o of Object.keys(t))if((0,r.io)(e,o))return t[o]??0}ToValidRate(e){const t=Number(e);return isNaN(t)?0:t}IsValidRate(e){const t=Number(e);return!isNaN(t)}GetRatesForPageType(e,t){switch(e){case a.GV.ConfirmationPage:return t.confirmationPage;case a.GV.CheckoutPage:return t.checkoutPage;case a.GV.UnknownPage:return t.unknownPage;case a.GV.ProductPage:return t.productPage;case a.GV.SearchPage:return t.searchPage;case a.GV.HomePage:return t.homePage;default:return t.otherPages}}}},59352:function(e,t,o){o.d(t,{b:function(){return i}});let i=function(e){return e.variation1="variation1",e.variation2="variation2",e.variation3="variation3",e.variation4="variation4",e.variation5="variation5",e.variation6="variation6",e.variation7="variation7",e.variation8="variation8",e.variation9="variation9",e.autoActivationVariation="autoActivationVariation",e.pdpExactMatch="pdpExactMatch",e.spbCartPageAutoActivationVariation="spbCartPageAutoActivationVariation",e.spbAADLinkingNotification="spbAADLinkingNotification",e}({})},54774:function(e,t,o){var i=o(72370);t.Z=class{constructor(e){(0,i.Z)(this,"EventInfoTime",void 0),(0,i.Z)(this,"EventInfoName",void 0),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"BestCoupon",void 0),(0,i.Z)(this,"CashbackCategory",void 0),(0,i.Z)(this,"StartingPrice",void 0),(0,i.Z)(this,"CashbackSavings",void 0),(0,i.Z)(this,"Discount",void 0),(0,i.Z)(this,"AutoApplyScenario",void 0),(0,i.Z)(this,"AutoApplyProcessTime",void 0),(0,i.Z)(this,"ImpressionId",void 0),(0,i.Z)(this,"JSVersion",void 0),(0,i.Z)(this,"BuildVersion",void 0),(0,i.Z)(this,"Currency",void 0),this.EventInfoTime=e?.eventInfo_Time,this.EventInfoName=e?.eventInfo_Name,this.Domain=e?.domain,this.BestCoupon=e?.bestCoupon,this.CashbackCategory=e?.cashbackCategory,this.StartingPrice=e?.startingPrice,this.CashbackSavings=e?.cashbackSavings,this.Discount=e?.discount,this.AutoApplyScenario=e?.autoApplyScenario,this.AutoApplyProcessTime=e?.autoApplyProcessTime,this.ImpressionId=e?.impressionId,this.JSVersion=e?.jSVersion,this.BuildVersion=e?.buildVersion,this.Currency=e?.currency}}},6747:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"descriptionSelector",void 0),(0,i.Z)(this,"profileImageSelector",void 0),(0,i.Z)(this,"influencerInfoSelector",void 0),(0,i.Z)(this,"influencerIdSelector",void 0),(0,i.Z)(this,"influencerFollowers",void 0)}static Create(e){const t=new r;return t.descriptionSelector=e.descriptionSelector,t.profileImageSelector=e.profileImageSelector,t.influencerInfoSelector=e.influencerInfoSelector,t.influencerIdSelector=e.influencerIdSelector,t.influencerFollowers=e.influencerFollowers,t}}t.Z=r},57176:function(e,t,o){o.d(t,{s3:function(){return a},x6:function(){return n}});var i=o(72370),r=o(605);let a=function(e){return e[e.ConfirmedProductPage=0]="ConfirmedProductPage",e[e.ProductPage=1]="ProductPage",e[e.Homepage=2]="Homepage",e[e.CheckoutPage=3]="CheckoutPage",e}({}),n=function(e){return e[e.Selector=0]="Selector",e[e.Automated=1]="Automated",e}({});class s extends r.Z{constructor(...e){super(...e),(0,i.Z)(this,"source",void 0),(0,i.Z)(this,"extraction",void 0),(0,i.Z)(this,"timestamp",void 0),(0,i.Z)(this,"numberOfFails",void 0)}}t.ZP=s},71951:function(e,t,o){o.d(t,{M4:function(){return i},y$:function(){return r}});let i=function(e){return e.ActionDetected="Detected",e.ActionReported="Reported",e}({}),r=function(e){return e.autoApplyStorageKey="ICAutoApplyCoupons",e.completedPurchaseStorageKey="ICCompletedPurchase",e}({})},5144:function(e,t,o){o.d(t,{$S:function(){return a},AM:function(){return P},BN:function(){return u},G7:function(){return m},GV:function(){return c},KE:function(){return d},M_:function(){return g},N9:function(){return h},R:function(){return r},Sl:function(){return p},YQ:function(){return A},in:function(){return i},oN:function(){return S},ps:function(){return s},u3:function(){return l},xu:function(){return n},zy:function(){return C}});let i=function(e){return e.Trace="Trace",e.Debug="Debug",e.Information="Information",e.Warning="Warning",e.Error="Error",e.Critical="Critical",e.None="None",e}({}),r=function(e){return e.AutoApply="AutoApply",e.ButtonClick="ButtonClick",e.ClientError="ClientError",e.DebugMessage="DebugMessage",e.EdgeFlyoutStatus="EdgeFlyoutStatus",e.CheckoutPageValidation="CheckoutPageValidation",e.CashbackInfo="CashbackInfo",e.CashbackInfoOfferDetails="CashbackInfoOfferDetails",e.OtherSellers="OtherSellers",e.RewardsActivity="RewardsActivity",e.ExpressCheckout="ExpressCheckout",e.EdgeFlyoutStatusDiagnostic="EdgeFlyoutStatusDiagnostic",e.RenderTime="RenderTime",e.RenderTimeline="RenderTimeline",e.RenderTimeBreakDown="RenderTimeBreakDown",e.PrintableGroceryCouponsOverlay="PrintableGroceryCouponsOverlay",e.CartExtraction="CartExtraction",e.CartExtractionError="CartExtractionError",e.FeedbackClicked="FeedbackClicked",e.ActiveExperiments="ActiveExperiments",e.ProductPageValidation="ProductPageValidation",e.VisibleClippingSelectors="VisibleClippingSelectors",e.PlatformDetection="PlatformDetection",e.ClippingExist="ClippingExist",e.CollectedCoupons="CollectedCoupons",e.PurchaseConfirmation="PurchaseConfirmation",e.CheckoutValidationPerf="CheckoutValidationPerf",e.AutoOpenControllerPerf="AutoOpenControllerPerf",e.AutoOpenControllerDataRecieved="AutoOpenControllerDataRecieved",e.ManualCouponApplication="ManualCouponApplication",e.EdgeDriverStatus="EdgeDriverStatus",e.EstimatedCashback="EstimatedCashback",e.CatalogExtractionRating="CatalogExtractionRating",e.CatalogExtractionReviews="CatalogExtractionReviews",e.TravelCheckoutExtraction="TravelCheckoutExtraction",e.UserPref="UserPref",e.AutoOpenController="AutoOpenController",e.ModuleQualityValidation="ModuleQualityValidation",e.HtmlFragment="HtmlFragment",e.ItemizedCashbackStatus="ItemizedCashbackStatus",e.ProductNameData="ProductNameData",e.CatalogExtractionPDPOffer="CatalogExtractionPDPOffer",e.UserAgreeToTerms="UserAgreeToTerms",e.UserDisagreeToTerms="UserDisagreeToTerms",e.CatalogExtractionSearchOffers="CatalogExtractionSearchOffers",e.SafariStatus="SafariStatus",e.AutomatedSelectorsDiagnostic="AutomatedSelectorsDiagnostic",e.JourneyStage="JourneyStage",e.PageDetectionRegexMatched="PageDetectionRegexMatched",e.ShoppingPersonalizedPromotionsRawTable="ShoppingPersonalizedPromotionsRawTable",e.PersonalizedPromotionsExtractionError="PersonalizedPromotionsExtractionError",e.ShoppingRewards="ShoppingRewards",e.ConfirmationPageValidation="ConfirmationPageValidation",e.ConfirmationPageDetails="ConfirmationPageDetails",e.SelectorDataExtraction="SelectorDataExtraction",e}({}),a=function(e){return e.AutoApply="AutoApply",e.BackgroundAutoApplyPositive="BackgroundAutoApplyPositive",e.BackgroundAutoApplyNegative="BackgroundAutoApplyNegative",e.PopupClose="PopupClose",e.CashbackInfoOfferDetails="CashbackInfoOfferDetails",e.CashbackNotificationCommision="CashbackNotificationCommision",e.ClippingPopupClose="ClippingPopupClose",e.ClipCoupon="ClipCoupon",e.AutoApplyNotificationClose="AutoApplyNotificationClose",e.CouponCopied="CouponCopied",e.SeeMoreCoupons="SeeMoreCoupons",e.SeeMoreRetailers="SeeMoreRetailers",e.SeeMoreSellers="SeeMoreSellers",e.SeeMorePaymentOptions="SeeMorePaymentOptions",e.SeeMorePersonalizedCashback="SeeMorePersonalizedCashback",e.SeeMoreGroceryCoupons="SeeMoreGroceryCoupons",e.SeeMoreSocialCoupons="SeeMoreSocialCoupons",e.SeeMoreShoppingTrips="SeeMoreShoppingTrips",e.SeeAllPrintableCoupons="SeeAllPrintableCoupons",e.SeeMoreItemizedCashback="SeeMoreItemizedCashback",e.SeeAllTrendingDeals="SeeAllTrendingDeals",e.SeeMoreOffers="SeeMoreOffers",e.ShoppingTripsCompletePurchase="ShoppingTripsCompletePurchase",e.PrintableCouponSelected="PrintableCouponSelected",e.PrintGroceryCoupons="PrintGroceryCoupons",e.FREManage="FREManage",e.FlyoutManage="FlyoutManage",e.FREDismiss="FREDismiss",e.FlyoutDismiss="FlyoutDismiss",e.FlyoutSnooze="FlyoutSnooze",e.DoNotShow="DoNotShow",e.DoNotShowFeatureForDomain="DoNotShowFeatureForDomain",e.FlyoutSnoozeUndo="FlyoutSnoozeUndo",e.RemindLater="RemindLater",e.BannerDismiss="BannerDismiss",e.AutoShowTurnedOff="AutoShowTurnedOff",e.AutoShowTurnedOn="AutoShowTurnedOn",e.ManageNotification="ManageNotification",e.ShoppingSettings="ShoppingSettings",e.FREGotIt="FREGotIt",e.FRENoThanks="FRENoThanks",e.NavigatedToAnotherRetailer="NavigatedToAnotherRetailer",e.ProceedToCheckoutWithImport="ProceedToCheckoutWithImport",e.ProceedToCheckoutWithOutImport="ProceedToCheckoutWithOutImport",e.ProceedToCheckout="ProceedToCheckout",e.UseCoupon="UseCoupon",e.UseRebates="UseRebates",e.CouponOverlayReceiptScannerBanner="CouponOverlayReceiptScannerBanner",e.ActivateCashBack="ActivateCashBack",e.JoinAndActivateCashback="JoinAndActivateCashback",e.CashbackSnoozeButton="CashbackSnoozeButton",e.CashbackDismissButton="CashbackDismissButton",e.CashbackDoNotShowButton="CashbackDoNotShowButton",e.CashbackDoNotShowOptionButton="CashbackDoNotShowOptionButton",e.PreviousCashBack="PreviousCashBack",e.ExpandedPreviousCashBack="ExpandedPreviousCashBack",e.NotificationDismiss="NotificationDismiss",e.OrganicFlowTurnedOff="OrganicFlowTurnedOff",e.OrganicFlowTurnedOn="OrganicFlowTurnedOn",e.PersonalizedRemindersTurnedOn="RemindersTurnedOn",e.PersonalizedRemindersTurnedOff="RemindersTurnedOff",e.SafariCrossSiteTrackingTurnedOn="SafariCrossSiteTrackingTurnedOn",e.SafariCrossSiteTrackingTurnedOff="SafariCrossSiteTrackingTurnedOff",e.RebatesLearnMore="RebatesLearnMore",e.RebatesLearnMoreFlyout="RebatesLearnMoreFlyout",e.RebatesViewInPane="RebatesViewInPane",e.RebatesAccount="RebatesAccount",e.CouponCopiedStackableWithCashBack="CouponCopiedStackableWithCashBack",e.CouponCopiedNonStackableWithCashBack="CouponCopiedNonStackableWithCashBack",e.ShareFB="ShareFB",e.ShareTwitter="ShareTwitter",e.ShareWhatsapp="ShareWhatsapp",e.ShareClipboard="ShareClipboard",e.ScrollVideoReviews="ScrollVideoReviews",e.ClickExpertReview="ClickExpertReview",e.ClickVideoReview="ClickVideoReview",e.NavigateToRetailerOffer="NavigateToRetailerOffer",e.CampaignShopNowPaneButton="CampaignShopNowPaneButton",e.CampaignAwarenessBannerButton="CampaignAwarenessBannerButton",e.CampaignCashbackBanner="CampaignCashbackBanner",e.WishlistSeeAllLink="WishlistSeeAllLink",e.WishlistSaveButton="WishlistSaveButton",e.WishlistUnsaveButton="WishlistUnsaveButton",e.ProductSummaryUnsaveWishlistButton="ProductSummaryUnsaveWishlistButton",e.ProductSummarySaveWishlistButton="ProductSummarySaveWishlistButton",e.NavigateToRecommendedDeal="NavigateToRecommendedDeal",e.NavigateToOtherSeller="NavigateToOtherSeller",e.AddToCart="AddToCart",e.TipsGotIt="TipsGotIt",e.TipsDwellTime="TipsDwellTime",e.SpbActivatedNotificationHeaderClick="SpbActivatedNotificationHeaderClick",e.HeroImageClick="HeroImageClick",e.AAWithoutEC="AAWithoutEC",e.AAWithEC="AAWithEC",e.ExpressCheckout="EC",e.RewardSignIn="RewardSignIn",e.RewardRedeem="RewardRedeem",e.RewardAdditionalLink="RewardAdditionalLink",e.RewardInfo="RewardInfo",e.ActivateCashbackToEarnReward="ActivateCashbackToEarnReward",e.ActivateCashbackToEarnRewardFail="ActivateCashbackToEarnRewardFail",e.HomePageNotificationHover="HomePageNotificationHover",e.DeletePackageTrackerByGuid="DeletePackageTrackerByGuid",e.PackageTrackingOptIn="PackageTrackingOptIn",e.PackageTrackingOptOut="PackageTrackingOptOut",e.PackageTrackingOrderClick="PackageTrackingOrderClick",e.PriceHistoryGotItBtn="PriceHistoryGotItBtn",e.DigitalGroceryCouponClick="DigitalGroceryCouponClick",e.DigitalGroceryCouponSeeAll="DigitalGroceryCouponSeeAll",e.RewardsClick="RewardsClick",e.ViewAccountActivity="ViewAccountActivity",e.CashbackRetailer="CashbackRetailer",e.SustainabilityShop="SustainabilityShop",e.ECWithoutPayment="ECWithoutPayment",e.ECWithBNPL="ECWithBNPL",e.FeedbackLike="FeedbackLike",e.FeedbackDislike="FeedbackDislike",e.FeedbackDislikeMenu0="FeedbackDislikeMenu0",e.FeedbackDislikeMenu1="FeedbackDislikeMenu1",e.FeedbackDislikeMenu2="FeedbackDislikeMenu2",e.FeedbackDislikeMenu3="FeedbackDislikeMenu3",e.FeedbackDislikeMenu4="FeedbackDislikeMenu4",e.FeedbackClose="FeedbackClose",e.FeedbackSubmit="FeedbackSubmit",e.FeedbackDismiss="FeedbackDismiss",e.SustainabilityLearnMore="SustainabilityLearnMore",e.PinterestNavigateToAnotherRetailer="PinterestNavigateToAnotherRetailer",e.YoutubeNavigateToAnohterRetailer="YoutubeNavigateToAnohterRetailer",e.SaveYoutubeCoupons="SaveYoutubeCoupons",e.DontSaveYoutubeCoupons="DontSaveYoutubeCoupons",e.ViewCouponsYoutube="ViewCouponsYoutube",e.PriceDropProductPage="PriceDropProductPage",e.PriceDropProductPageHover="PriceDropProductPageHover",e.SustainabilityConfirmationHover="SustainabilityConfirmationHover",e.AttainableInfoIcon="AttainableInfoIcon",e.AttainableInfoIconNotif="AttainableInfoIconNotif",e.AttainableContinueShopping="AttainableContinueShopping",e.DismissGiftCard="DismissGiftCard",e.GroceryItemShopAndActivate="GroceryItemShopAndActivate",e.GroceryItemTooltipViewed="GroceryItemTooltipViewed",e.GrocerySectionTooltipViewed="GrocerySectionTooltipViewed",e.GroceryItemDisclaimer="GroceryItemDisclaimer",e.JoinNow="JoinNow",e.MaybeLater="MaybeLater",e.NavigatedToMyGarage="NavigatedToMyGarage",e.NavigatedToAutosMarketplace="NavigatedToAutosMarketplace",e.NavigatedToAutosMarketplaceRecommendation="NavigatedToAutosMarketplaceRecommendation",e.NavigatedToAutosMarketplacePriceInsightsRatingURL="NavigatedToAutosMarketplacePriceInsightsRatingURL",e.NavigatedToAutosVideoReview="NavigatedToAutosVideoReview",e.NavigatedToAutosVideoReviewSeeNow="NavigatedToAutosVideoReviewSeeNow",e.ActivatedGroceryItem="ActivatedGroceryItem",e.MomentInTimeCard="MomentInTimeCard",e.TrendingOffersCard="TrendingOffersCard",e.TrendingOffersTitle="TrendingOffersTitle",e.SearchResultsCard="SearchResultsCard",e.TrendingOffersOnContextualTabCard="TrendingOffersOnContextualTabCard",e.TrendingOffersShowMore="TrendingOffersShowMore",e.SimilarOffersShowMore="SimilarOffersShowMore",e.SimilarOffersCard="SimilarOffersCard",e.SearchResultsShowMore="SearchResultsShowMore",e.TrendingOffersOnContextualTabShowMore="TrendingOffersOnContextualTabShowMore",e.DailyDealsCard="DailyDealsCard",e.RelatedProductsCard="RelatedProductsCard",e.NativeAdsCard="NativeAdsCard",e.AutoApplyConsent="AutoApplyConsent",e.AutoApplyBestCouponConsent="AutoApplyBestCouponConsent",e.DailyDealsShowMore="DailyDealsShowMore",e.DailyDealsTitle="DailyDealsTitle",e.RelatedProductsShowMore="RelatedProductsShowMore",e.NativeAdsShowMore="NativeAdsShowMore",e.VisualSearchCard="VisualSearchCard",e.VisualSearchShowMore="VisualSearchShowMore",e.BuyDirectCard="BuyDirectCard",e.BuyDirectShowMore="BuyDirectShowMore",e.BuyDirectTitle="BuyDirectTitle",e.ShoppingAdSlug="ShoppingAdSlug",e.InfiniteCategoryFeedCard="InfiniteCategoryFeedCard",e.InfiniteCategoryFeedAdCard="InfiniteCategoryFeedAdCard",e.InfiniteCategoryFeedShowMore="InfiniteCategoryFeedShowMore",e.InfiniteCategoryAdFeedShowMore="InfiniteCategoryAdFeedShowMore",e.InfiniteCategoryAdFeedTitle="InfiniteCategoryAdFeedTitle",e.AbandonedCartTile="AbandonedCartTile",e.AbandonedCartNotificationButton="AbandonedCartNotificationButton",e.GroceryCashbackPendingClaimClick="GroceryCashbackPendingClaimClick",e.MicrosoftCashbackAccountButton="MicrosoftCashbackAccountButton",e.PendingCashbackDisclaimer="PendingCashbackDisclaimer",e.ClaimedPendingCashbackDisclaimer="ClaimedPendingCashbackDisclaimer",e.ClaimedPendingCashbackTooltipViewed="ClaimedPendingCashbackTooltipViewed",e.PendingCashbackTooltipViewed="PendingCashbackTooltipViewed",e.cashbackUpsellJoinNowPath="cashbackUpsellJoinNowPathsJoinCashback",e.IncentiveCampaignProgress="IncentiveCampaignProgressButton",e.IncentiveCampaignClaim="IncentiveCampaignClaimButton",e.ChromeUserCampaignButton="ChromeUserCampaignButton",e.Unknown="Unknown",e.ProductTrackingCollectionsConsentRoam="ProductTrackingCollectionsConsentRoam",e.ProductTrackingCollectionsConsentSignIn="ProductTrackingCollectionsConsentSignIn",e.ProductTrackingCollectionsConsentSignInClose="ProductTrackingCollectionsConsentSignInClose",e.ProductTrackingCollectionsConsentRoamClose="ProductTrackingCollectionsConsentRoamClose",e.ProductTrackingCollectionsSeeAll="ProductTrackingCollectionsSeeAll",e.ProductTrackingTrackPrice="ProductTrackingTrackPrice",e.ProductTrackingTrackStock="ProductTrackingTrackStock",e.ProductTrackingUntrackPrice="ProductTrackingUntrackPrice",e.ProductTrackingUntrackStock="ProductTrackingUntrackStock",e.ProductTrackingUtilitiesTrackPrice="ProductTrackingUtilitiesTrackPrice",e.ProductTrackingUtilitiesTrackStock="ProductTrackingUtilitiesTrackStock",e.ProductTrackingUtilitiesUntrackPrice="ProductTrackingUtilitiesUntrackPrice",e.ProductTrackingUtilitiesUntrackStock="ProductTrackingUtilitiesUntrackStock",e.ProductTrackingTrackPriceAlertSettings="ProductTrackingTrackPriceAlertSettings",e.ProductTrackingTrackStockAlertSettings="ProductTrackingTrackStockAlertSettings",e.ProductTrackingAbandonedCartTrack="ProductTrackingAbandonedCartTrack",e.ProductTrackingAbandonedCartUntrack="ProductTrackingAbandonedCartUntrack",e.ProductCollectionTrackedProductsUntrack="ProductCollectionTrackedProductsUntrack",e.ProductCollectionsRecentlyViewedUntrack="ProductCollectionsRecentlyViewedUntrack",e.ProductCollectionsProduct="ProductCollectionsProduct",e.ProductCollectionsStartTracking="ProductCollectionsStartTracking",e.ProductCollectionsViewSteps="ProductCollectionsViewSteps",e.ProductTrackingOutOfStockPCVisitItem="ProductTrackingOutOfStockPCVisitItem",e.ProductTrackingOutOfStockConsentClose="ProductTrackingOutOfStockConsentClose",e.ProductTrackingBackInStockVisitItem="ProductTrackingBackInStockVisitItem",e.ProductTrackingPriceDropVisitItem="ProductTrackingPriceDropVisitItem",e.ProductTrackingPriceDropWithCouponVisitItem="ProductTrackingPriceDropWithCouponVisitItem",e.ProductTrackingPriceDropWithCashbackVisitItem="ProductTrackingPriceDropWithCouponVisitItem",e.ProductTrackingViewAllProducts="ProductTrackingViewAllProducts",e.ProductCollectionsRecentsTab="ProductCollectionsRecentsTab",e.ProductCollectionsTrackingTab="ProductCollectionsTrackingTab",e.ProductCollectionsTrack="ProductCollectionsTrack",e.RecommendationsViewPriceDrop="RecommendationsViewPriceDrop",e.SeePHGraph="SeePHGraph",e.PHGraphAndCouponsCompositeSeeMore="PHGraphAndCouponsCompositeSeeMore",e.lowePriceCashbackCouponsCompositeSeeMore="lowePriceCashbackCouponsCompositeSeeMore",e.TrendingCouponTile="TrendingCouponTile",e.SPBAutoActivateClick="SPBAutoActivateClick",e.TrendingCouponSeeMore="TrendingCouponSeeMore",e.SPBActivateButtonClick="SPBActivateButtonClick",e.SPBJoinAndActivateButtonClick="SPBJoinAndActivateButtonClick",e.ItemizedCashbackJoinAndActivateClick="ItemizedCashbackJoinAndActivateClick",e.SPBSeeMoreDealsButton="SPBSeeMoreDealsButton",e.SnoozeAllNotifications="SnoozeAllNotifications",e.SnoozeNotificationsForDomain="SnoozeNotificationsForDomain",e.SnoozeNotificationForDomain="SnoozeFeatureForDomain",e.SANConsentAcceptButton="SANConsentAcceptButton",e.SANConsentCloseButton="SANConsentCloseButton",e.SANConsentNotificationButton="SANConsentNotificationButton",e.SANConsentNotificationCloseButton="SANConsentNotificationCloseButton",e.ICSANConsentPaneButton="ICSANConsentPaneButton",e.ICSANConsentCloseButton="ICSANConsentCloseButton",e.ICPrivacyTooltipButton="ICPrivacyTooltipButton",e.ICTrackCashbackButton="ICTrackCashbackButton",e.ICTrackCashbackButtonNotification="ICTrackCashbackButtonNotification",e.ICClaimAndJoinButtonNotification="ICClaimAndJoinButtonNotification",e.ICClaimAndJoinButton="ICClaimAndJoinButton",e.InboxCouponsSignInToMicrosoftEdge="InboxCouponsSignInToMicrosoftEdge",e.InboxCouponsEdgeSwitchProfile="InboxCouponsEdgeSwitchProfile",e.InboxCouponsMicrosoftPrivacyStatement="InboxCouponsMicrosoftPrivacyStatement",e.InboxCouponsConnectYourEmail="InboxCouponsConnectYourEmail",e.InboxCouponsContinueWith="InboxCouponsContinueWith",e.InboxCouponsMicrosoftTermsOfUse="InboxCouponsMicrosoftTermsOfUse",e.InboxCouponsGoogleAPIServicesUserDataPolicy="InboxCouponsGoogleAPIServicesUserDataPolicy",e.InboxCouponsSwitchToPersonalProfile="InboxCouponsSwitchToPersonalProfile",e.InboxCouponsLearnAboutSupportedRetailers="InboxCouponsLearnAboutSupportedRetailers",e.InboxCouponsSeeMoreCoupons="InboxCouponsSeeMoreCoupons",e.InboxCouponsSeeMoreRetailers="InboxCouponsSeeMoreRetailers",e.InboxCouponsSeeOtherRetailers="InboxCouponsSeeOtherRetailers",e.InboxCouponsToggleExpansionRetailerCoupons="InboxCouponsToggleExpansionRetailerCoupons",e.InboxCouponsSettings="InboxCouponsSettings",e.InboxCouponsSeeOlderCoupons="InboxCouponsSeeOlderCoupons",e.InboxCouponsCouponClip="InboxCouponsCouponClip",e.InboxCouponsToggleExpansionModule="InboxCouponsToggleExpansionModule",e.InboxCouponsOpenDisconnectModal="InboxCouponsOpenDisconnectModal",e.InboxCouponsDisconnectEmail="InboxCouponsDisconnectEmail",e.InboxCouponsCancelDisconnectEmail="InboxCouponsCancelDisconnectEmail",e.InboxCouponsToggleExpansionPrivacy="InboxCouponsToggleExpansionPrivacy",e.InboxCouponsToggleExpansionRetailerSenders="InboxCouponsToggleExpansionRetailerSenders",e.InboxCouponsToggleRetailerSender="InboxCouponsToggleRetailerSender",e.InboxCouponsReconnectWith="InboxCouponsReconnectWith",e.InboxCouponsReconnect="InboxCouponsReconnect",e.InboxCouponsBack="InboxCouponsBack",e.InboxCouponsRefresh="InboxCouponsRefresh",e.InboxCouponsFreCarousel="InboxCouponsFreCarousel",e.InboxCouponsLearnMoreInfo="InboxCouponsLearnMoreInfo",e.ItemizedCashBackAddToCartButton="ItemizedCashBackAddToCartButton",e.ICGrocerySnoozeButton="ICGrocerySnoozeButton",e.ICGroceryDismissButton="ICGroceryDismissButton",e.ICGroceryDoNotShowButton="ICGroceryDoNotShowButton",e.ICGroceryDoNotShowButtonOption="ICGroceryDoNotShowButtonOption",e.SPBSnoozeButton="SPBSnoozeButton",e.SPBDoNotShowButton="SPBDoNotShowButton",e.SearchBoxInput="SearchBoxInput",e.FetchSearchResults="FetchSearchResults",e.FetchSearchResultsSpb="FetchSearchResultsSpb",e.PreviousSearchResults="PreviousSearchResults",e.NextSearchResults="NextSearchResults",e.SearchDismissButton="SearchDismissButton",e.SidepaneCashbackButton="SidepaneCashbackButton",e.SidepaneCashbackAnchor="SidepaneCashbackAnchor",e.winCartTile="winCartTile",e.UserAgreeToTerms="UserAgreeToTerms",e.UserDisagreeToTerms="UserDisagreeToTerms",e.ManuallyAppliedCoupon="ManuallyAppliedCoupon",e.BellIconNotification="BellIconNotification",e.CompositeNotificationsPriceComparisonComponent="CompositeNotificationsPriceComparisonComponent",e.AutoApplyPause="AutoApplyPause",e.PriceMatchOptIn="PriceMatchOptIn",e.PriceMatchOptOut="PriceMatchOptOut",e.PriceMatchCard="PriceMatchCard",e.PriceMatchRequestButton="PriceMatchRequestButton",e.PriceMatchNotificationButton="PriceMatchNotificationButton",e.SafariUpdateLinkButton="SafariUpdateLinkButton",e.LinkYourMSAButton="LinkYourMSAButton",e.AbandonedCartPcbVisitProductNotification="AbandonedCartPcbVisitProductNotification",e.TrackButtonSummaryCard="TrackButtonSummaryCard",e.TileButtonSummaryCard="TileButtonSummaryCard",e.OutsideAAOverlayClick="OutsideAAOverlayClick",e.AbandonedCartExclusiveCouponsNotification="AbandonedCartExclusiveCouponsNotification",e.TravelCardClicked="TravelCardClicked",e.TravelFlightCardClicked="TravelFlightCardClicked",e.TravelHotelCardClicked="TravelHotelCardClicked",e.TravelBookOnProviderClicked="TravelBookOnProviderClicked",e.TravelBookOnHotelProviderClicked="TravelBookOnHotelProviderClicked",e.UnifiedCashbackBtn="UnifiedCashbackBtn",e.PaneSettingTurnedOn="PaneSettingTurnedOn",e.PaneSettingTurnedOff="PaneSettingTurnedOff",e.BuyingOptionsFilterSelectionClicked="BuyingOptionsFilterSelectionClicked",e.PostPurchaseViewRewards="PostPurchaseViewRewards",e}({}),n=function(e){return e.FavIconRenderStatus="FavIconRenderStatus",e.ProductSummaryTileStatus="ProductSummaryTileStatus",e.AppendNodeError="AppendNodeError",e.BadDataError="BadDataError",e.PaneFlagError="PaneFlagError",e.ItemizedCashbackActivateClick="ICActivateClick",e.OpenedInCheckout="OpenedInCheckout",e.EmptyCoupons="EmptyCoupons",e.AutoApplyButtonShown="AutoApplyButtonShown",e.AutoTrigger="AutoTrigger",e.ErrorWrongAutoTrigger="ErrorWrongAutoTrigger",e.ErrorPCNotificationPrice="ErrorPCNotificationPrice",e.UserTrigger="UserTrigger",e.BannerRendered="BannerRendered",e.OnErrorInvoked="OnErrorInvoked",e.BestPrice="BestPrice",e.YouCanSave="YouCanSave",e.RebatesConfirmationBlossomNotification="RebatesConfirmationBlossomNotification",e.RebatesConfirmationNotification="RebatesConfirmationNotification",e.RebatesTurnedOffNotification="RebatesTurnedOffNotification",e.StackableCouponWithCashback="StackableCouponWithCashback",e.NonStackableCouponWithCashback="NonStackableCouponWithCashback",e.CashBackNotActiveAutoApply="CashBackNotActiveAutoApply",e.PriceHistoryPriceDrop="PriceHistoryPriceDrop",e.PriceHistoryPriceIncrease="PriceHistoryPriceIncrease",e.PriceHistoryPriceStable="PriceHistoryPriceStable",e.PriceHistoryDwellTimeHover="PriceHistoryDwellTimeHover",e.PriceHistoryInfoButtonDwellTimeHover="PriceHistoryInfoButtonDwellTimeHover",e.PriceHistoryNotificationHover="PriceHistoryNotificationHover",e.PriceHistoryNoImage="PriceHistoryNoImage",e.PriceHistoryShowMoreInfoTooltip="PriceHistoryShowMoreInfoTooltip",e.PriceHistoryHideMoreInfoTooltip="PriceHistoryHideMoreInfoTooltip",e.NewPriceHistoryGraph="NewPriceHistoryGraph",e.PriceHistoryDiscoverHover="PriceHistoryDiscoverHover",e.PriceComparisonBackfillNoticeShowMoreInfoTooltip="PriceComparisonBackfillNoticeShowMoreInfoTooltip",e.PriceComparisonBackfillNoticeDwellTimeHover="PriceComparisonBackfillNoticeDwellTimeHover",e.PriceComparisonBackfillNoticeHideMoreInfoTooltip="PriceComparisonBackfillNoticeHideMoreInfoTooltip",e.PriceComparisonDiscoverView="PriceComparisonDiscoverView",e.PriceComparisonDiscoverHover="PriceComparisonDiscoverHover",e.PriceComparisonDiscoverClick="PriceComparisonDiscoverClick",e.BuyingOptionsCFLog="BuyingOptionsCFLog",e.CashBackWillNotRender="CashBackWillNotRender",e.ErrorPageHandlerFunction="ErrorPageHandlerFunction",e.FlyoutAutoPriceHistoryTrigger="FlyoutAutoPriceHistoryTrigger",e.FlyoutProductSummaryCardRightlyPlaced="FlyoutProductSummaryCardRightlyPlaced",e.ProductSummaryCardCollectionsPackageDeleteError="ProductSummaryCardCollectionsPackageDeleteError",e.FlyoutDiscoverPriceHistoryTrigger="FlyoutDiscoverPriceHistoryTrigger",e.FlyoutDismissedPriceHistoryTrigger="FlyoutDismissedPriceHistoryTrigger",e.AutoOpenUsingUrlParam="AutoOpenUsingUrlParam",e.ProductSummaryCardCollectionsPackageAddError="ProductSummaryCardCollectionsPackageAddError",e.ContextMenuInfo="ContextMenuInfo",e.AddedToCartNotification="AddedToCartNotification",e.CashBackBlossomCampaign="CashBackBlossomCampaign",e.CashbackError="CashbackError",e.CashbackInfo="CashbackInfo",e.CashBackActivated="CashBackActivated",e.ActivateCashBackNotificationImpression="ActivateCashBackNotificationImpression",e.CashBackNotificationImpression="CashBackNotificationImpression",e.ActivateCashBackNotificationInconsistentData="ActivateCashBackNotificationInconsistentData",e.ErrorCashBackActivation="ErrorCashBackActivation",e.CheckoutUserDataInvalid="CUDInvalid",e.ExpressCheckout="ECOnly",e.OtherSeller="OtherSeller",e.OtherSellerNotification="OtherSellerNotification",e.ModuleViewed="ModuleViewed",e.TrendingCouponsModuleRendered="TrendingCouponsModuleRendered",e.RewardWillBeRendered="RewardWillBeRendered",e.RewardSignInSuccess="RewardSignInSuccess",e.ErrorRewardSignIn="ErrorRewardSignIn",e.RewardNotification="RewardNotification",e.PackageTrackingCardViewed="PackageTrackingCardViewed",e.ViewedProductPriceDrop="ViewedProductPriceDrop",e.SustainabilityConfirmation="SustainabilityConfirmation",e.SustainabilityPDP="SustainabilityPDP",e.AutosMarketplaceRenderNotification="AutosMarketplaceRenderNotification",e.AutosReviewsRenderNotification="AutosReviewsRenderNotification",e.AutosMarketplaceRenderViewModule="AutosMarketplaceRenderViewModule",e.AutosRatingsAndReviewsRendered="AutosRatingsAndReviewsRendered",e.AutosMarketplaceListingHovered="AutosMarketplaceListingHovered",e.AutosMarketplaceRatingAndReviewHovered="AutosMarketplaceRatingAndReviewHovered",e.AutosMarketDwellTimeHover="AutosMarketDwellTimeHover",e.AutosMyGarageHovered="AutosMyGarageHovered",e.AutosMyGarageRenderViewModule="AutosMyGarageRenderViewModule",e.AutosMyGarageDwellTimeHover="AutosMyGarageDwellTimeHover",e.PerfCreateAndRender="PerfCreateAndRender",e.PerfPauseAutoShow="PerfPauseAutoShow",e.PerfSelectorExtraction="PerfSelectorExtraction",e.ErrorToRecordEngagement="ErrorToRecordEngagement",e.ErrorPaneStuckLoadingState="ErrorPaneStuckLoadingState",e.ErrorRecordingContentViewed="ErrorRecordingContentViewed",e.StartShoppingAPIErrorBaseAdsWorkflow="StartShoppingAPIErrorBaseAdsWorkflow",e.StartShoppingAPIEmptyBaseAdsWorkflow="StartShoppingAPIEmptyBaseAdsWorkflow",e.StartShoppingAPIErrorHubPageWorkflow="StartShoppingAPIErrorHubPageWorkflow",e.StartShoppingAPIErrorZIWorkflowWrapper="StartShoppingAPIErrorZIWorkflowWrapper",e.StartShoppingAPIEmptyResponseHubPageWorkflow="StartShoppingAPIEmptyResponseHubPageWorkflow",e.StartShoppingAPIHubPagePersonalized="StartShoppingAPIHubPagePersonalized",e.StartShoppingAPIEmptyResponseZIWorkflowWrapper="StartShoppingAPIEmptyResponseZIWorkflowWrapper",e.StartShoppingAPINativeAdsError="StartShoppingAPINativeAdsError",e.StartShoppingAPINoNativeAdsFound="StartShoppingAPINoNativeAdsFound",e.StartShoppingAPIVisualSearchError="StartShoppingAPIVisualSearchError",e.StartShoppingAPIVisualSearchCalled="StartShoppingAPIVisualSearchCalled",e.StartShoppingAPIVisualSearchNoResultsFound="StartShoppingAPIVisualSearchNoResultsFound",e.CashbackDataFetchError="CashbackDataFetchError",e.WishlistSaveButtonVisible="WishlistSaveButtonVisible",e.CollectionsPackageInjectionError="CollectionsPackageInjectionError",e.CollectionsPackageEntityParsingError="CollectionsPackageEntityParsingError",e.CollectionsPackageAddError="CollectionsPackageAddError",e.CollectionsPackageDeleteError="CollectionsPackageDeleteError",e.CampaignAPITopDealsError="CampaignAPITopDealsError",e.CampaignAPITopDealsNoResultsFound="CampaignAPITopDealsNoResultsFound",e.SavingsFoundShown="SavingsFoundShown",e.ErrorRewardsAdded="ErrorRewardsAdded",e.DiscoverShopping="DiscoverShopping",e.DiscoverChatChips="DiscoverChatChips",e.SmartCompare="SmartCompare",e.ProductSummary="ProductSummary",e.ProductSummaryInsightClick="ProductSummaryInsightClick",e.ProductSummaryHover="ProductSummaryHover",e.BuyingGuidesView="BuyingGuidesView",e.BuyingGuidesHover="BuyingGuidesHover",e.BuyingGuidesClick="BuyingGuidesClick",e.UserInsights="UserInsights",e.ExpertInsights="ExpertInsights",e.ItemizedCashbackWithPdpActivated="ICListWithActivatedPdp",e.ItemizedCashback="ICList",e.ItemizedCashbackRecentlyShown="ICListRecentlyShown",e.ItemizedCashbackQuotient="ICListQt",e.ItemizedCashbackActivated="ICActivedList",e.ItemizedCashbackActivatedSeeAll="ICActivedListSeeAll",e.ItemizedCashbackActivatedNavigateToRetailer="ICActivatedNavigateToRetailer",e.ItemizedCashbackActivatedHover="ICActivatedHover",e.ItemizedCashbackJoinAndActivatedHover="ItemizedCashbackJoinAndActivatedHover",e.ItemizedCashbackOfferClick="ICOfferClick",e.ItemizedCashbackShopCartClick="ICActivateShopCartClick",e.ItemizedCashbackHover="ICHoverItem",e.ICRelatedOfferNotification="ICRelatedOfferNotification",e.ICRelatedOfferNotificationHover="ICRelatedOfferNotificationHover",e.ICRelatedOfferNotificationClick="ICRelatedOfferNotificationClick",e.ICActivatedNotification="ICItemActivatedNotification",e.ICActivatedNotificationHover="ICItemActivatedNotificationHover",e.ICActivatedNotificationClick="ICItemActivatedNotificationClick",e.ICMultipleActivatedNotificationHover="ICMultipleActivatedNotificationHover",e.ICMultipleActivatedNotificationRender="ICMultipleActivatedNotificationRender",e.ICCategoryNotification="ICCategoryNotification",e.ICCategoryNotificationHover="ICCategoryNotificationHover",e.ICReceiptScannerBannerHover="ICReceiptScannerBannerHover",e.ICReceiptScannerBannerClick="ICReceiptScannerBannerClick",e.ICReceiptScannerBannerRender="ICReceiptScannerBannerRender",e.ICReceiptScannerDealHover="ICReceiptScannerDealHover",e.ICReceiptScannerDealClick="ICReceiptScannerDealClick",e.ICReceiptScannerDealRender="ICReceiptScannerDealRender",e.ICAddedToCartPDPRelatedOfferHover="ICAddedToCartPDPRelatedOfferHover",e.ICAddedToCartPDPRelatedOfferRender="ICAddedToCartPDPRelatedOfferRender",e.ICAddedToCartPDPRelatedOfferClick="ICAddedToCartPDPRelatedOfferClick",e.ICSearchNotification="ICSearchNotification",e.ICSearchNotificationHover="ICSearchNotificationHover",e.ICSearchNotificationClick="ICSearchNotificationClick",e.ICTotalCashbackNotification="ICTotalCashbackNotification",e.ICTotalCashbackHover="ICTotalCashbackHover",e.ICHomeNotificationError="ICHomeNotificationError",e.ICHomeNotificationSPB="ICHomeNotificationSPB",e.ICHomeNotificationSPBHover="ICHomeNotificationSPBHover",e.ICHomeNotificationSPBClick="ICHomeNotificationSPBClick",e.ICSearchNotificationSPB="ICSearchNotificationSPB",e.ICSearchNotificationSPBHover="ICSearchNotificationSPBHover",e.ICPdpNotificationSPB="ICPdpNotificationSPB",e.ICPdpNotificationSPBActivated="ICPdpNotificationSPBActivated",e.ICPdpNotificationSPBHover="ICPdpNotificationSPBHover",e.ICPDPActivatedHover="ICPDPActivatedHover",e.ICPdpCashback="ICPdpCashback",e.ICPdpCashbackHover="ICPdpCashbackHover",e.ICSearchCategoryResult="ICSearchCategoryResult",e.ICSearchCategoryResultHover="ICSearchCategoryResultHover",e.ICPdpCashbackNotification="ICPdpCashbackNotification",e.ICPdpCashbackNotificationHover="ICPdpCashbackNotificationHover",e.ICPdpCashbackNotificationClick="ICPdpCashbackNotificationClick",e.BlockedAutoOpenEngagement="BlockedAutoOpenEngagement",e.ICApiDataUnavailable="ICApiDataUnavailable",e.CouponExpectationTooltipOpen="CouponExpectationTooltipOpen",e.CouponExpectationTooltipRead="CouponExpectationTooltipRead",e.CouponDiscoverHover="CouponDiscoverHover",e.CouponDiscoverRender="CouponDiscoverRender",e.CouponDiscoverButtonClick="CouponDiscoverButtonClick",e.TrendingCouponDiscoverButtonClick="TrendingCouponDiscoverButtonClick",e.ProductCollectionsDiscoverHover="ProductCollectionsDiscoverHover",e.ProductCollectionsDiscoverRender="ProductCollectionsDiscoverRender",e.ProductCollectionsDiscoverClick="ProductCollectionsDiscoverClick",e.CouponCarouselHover="CouponCarouselHover",e.NotificationModuleRequired="NotificationModuleRequired",e.PersonalizedCashbackNotification="PersonalizedCashbackNotification",e.PersonalizedCashbackStoreWideNotification="PersonalizedCashbackStoreWideNotification",e.PersonalizedCashbackPaneModule="PersonalizedCashbackPaneModule",e.PersonalizedCashbackAddressBarNotification="PersonalizedCashbackAddressBarNotification",e.PersonalizedCashbackConfirmationNotification="PersonalizedCashbackConfirmationNotification",e.ViewedPrivacyFooter="ViewedPrivacyFooter",e.RenderedExtensionUpdateStatement="RenderedExtensionUpdateStatement",e.CategoryFilterClick="CategoryFilterClick",e.DiscoverSuggestionClick="DiscoverSuggestionClick",e.DiscoverChatSuggestionClick="DiscoverChatSuggestionClick",e.DiscoverChatDismissClick="DiscoverChatDismissClick",e.DiscoverChatHover="DiscoverChatHover",e.DiscoverChatChevronClick="DiscoverChatChevronClick",e.DiscoverChatChipMissingText="DiscoverChatChipMissingText",e.SmartCompareClick="SmartCompareClick",e.SmartCompareSpecCardClick="SmartCompareSpecCardClick",e.SmartCompareSpecCardBasicsClick="SmartCompareSpecCardBasicsClick",e.SmartCompareFullSpecsButtonClick="SmartCompareFullSpecsButtonClick",e.SmartCompareHover="SmartCompareHover",e.PersonalizedAutoTriggerOff="PersonalizedAutoTriggerOff",e.PaneTabClick="PaneTabClick",e.EstimatedCashbackShown="EstimatedCashbackShown",e.GroceryCouponsSeeMoreClick="GroceryCouponsSeeMoreClick",e.IncentiveCampaignProgressBanner="IncentiveCampaignProgressBanner",e.IncentiveCampaignClaimBanner="IncentiveCampaignClaimBanner",e.IncentiveCampaignProgressNotification="IncentiveCampaignProgressNotification",e.IncentiveCampaignClaimNotification="IncentiveCampaignClaimNotification",e.ErrorActivatingUpsell="ErrorActivatingUpsell",e.GroceryOfferCardClick="GroceryOfferCardClick",e.GroceryOfferCardHover="GroceryOfferCardHover",e.SponsoredTooltipHover="SponsoredTooltipHover",e.SponsoredTooltipFindMoreClick="SponsoredTooltipFindMoreClick",e.SPBDetailedPriceTooltipHover="SPBDetailedPriceTooltipHover",e.OfferDetailedPriceTooltipHover="OfferDetailedPriceTooltipHover",e.SPBActivatedOfferHover="SPBActivatedOfferHover",e.SPBActivatedOfferView="SPBActivatedOfferView",e.SPBActivatedNotificationShown="SPBActivatedNotificationShown",e.SPBCheckoutNotificationShown="SPBCheckoutNotificationShown",e.SPBCheckoutNotification="SPBCheckoutNotification",e.SPBInstantATCNotificationClick="SPBInstantATCNotificationClick",e.QuotientInstantATCNotificationClick="QuotientInstantATCNotificationClick",e.InstantATCCreationOverlay="InstantATCCreationOverlay",e.InstantATCSuccessOverlay="InstantATCSuccessOverlay",e.SPBOfferCardView="SPBOfferCardView",e.SPBOfferCardClick="SPBOfferCardClick",e.SPBOfferCardHover="SPBOfferCardHover",e.SPBActivateButtonHover="SPBActivateButtonHover",e.SPBPdpActivateButtonHover="SPBPdpActivateButtonHover",e.SPBJoinAndActivateButtonHover="SPBJoinAndActivateButtonHover",e.SPBConfirmationNotification="SPBConfirmationNotification",e.SPBConfirmationNotificationHover="SPBConfirmationNotificationHover",e.SPBConfirmationCardView="SPBConfirmationCardView",e.SPBConfirmationCardHover="SPBConfirmationCardHover",e.SPBAutoActivation="SPBAutoActivation",e.SPBAutoActivationTriggered="SPBAutoActivationTriggered",e.ICTotalCashBackSeeDealsClicked="ICTotalCashBackSeeDealsClicked",e.ICCategoryNotificationSeeDealsClicked="ICCategoryNotificationSeeDealsClicked",e.PopupMismatch="PopupMismatch",e.SignInToRebatesStarted="SignInToRebatesStarted",e.SignInToRebatesSuccess="SignInToRebatesSuccess",e.SignInToRebatesFailed="SignInToRebatesFailed",e.SeeActivatedDealsButtonClicked="SeeActivatedDealsButtonClicked",e.SignInButtonClicked="SignInButtonClicked",e.GroceryCashbackError="GroceryCashbackError",e.GroceryCashbackNotification="GroceryCashbackNotification",e.GroceryCashbackSubmitSuccess="GroceryCashbackSubmitSuccess",e.GroceryCashbackSubmitError="GroceryCashbackSubmitError",e.DiscoverModuleDataPrepError="DiscoverModuleDataPrepError",e.DiscoverModuleError="DiscoverModuleError",e.IsRebatesUserSource="IsRebatesUserSource",e.UserPref="UserPref",e.UserPrefMismatch="UserPrefMismatch",e.ProductTrackingNetworkError="ProductTrackingNetworkError",e.ProductTrackingDebug="ProductTrackingDebug",e.ProductTrackingBackInStockValidation="ProductTrackingBackInStockValidation",e.ProductTrackingPriceDropValidation="ProductTrackingPriceDropValidation",e.ProductTrackingOutOfStockExtraction="ProductTrackingOutOfStockExtraction",e.PinterestEngagement="PinterestEngagement",e.ProductTrackingCollectionsStatus="ProductTrackingCollectionsStatus",e.SanConsentViewed="SanConsentViewed",e.ICSanConsentNotificationHover="ICSanConsentNotificationHover",e.ICSanConsentNotification="ICSanConsentNotification",e.ICSanConsentViewed="ICSanConsentViewed",e.ICSanConsentHover="ICSanConsentHover",e.PCBackfillNoticeViewed="PCBackfillNoticeViewed",e.ICConfirmationNotification="ICItemConfirmNotification",e.ICPendingCashbackNotification="ICPendingCashbackNotification",e.ICConfirmationNotificationHover="ICConfirmationNotificationHover",e.ICPendingCashbackNotificationHover="ICPendingCashbackNotificationHover",e.ICConfirmationPaneCard="ICConfirmationPaneCard",e.ICPendingCashbackPaneCard="ICPendingCashbackPaneCard",e.ICConfirmationPaneCardHover="ICConfirmationPaneCardHover",e.ICPendingCashbackPaneCardHover="ICPendingCashbackPaneCardHover",e.ICQuotientPrivacyPolicyClicked="ICQuotientPrivacyPolicyClicked",e.ICPrivacyTooltip="ICPrivacyTooltip",e.ICPrivacyAndCookiesClicked="ICPrivacyAndCookiesClicked",e.ICMicrosoftRebatesClicked="ICMicrosoftRebatesClicked",e.ICTermsClicked="ICTermsClicked",e.SanConsentPaneBannerHover="SanConsentPaneBannerHover",e.ExclusiveOfferDomainVisited="ExclusiveOfferDomainVisited",e.ExclusiveBestOfferForRendered="ExclusiveBestOfferForRendered",e.ExclusiveOfferFromMicrosoftRendered="ExclusiveOfferFromMicrosoftRendered",e.ExclusiveOfferForRendered="ExclusiveOfferForRendered",e.ICQtPdpOffersNoShow="ICQtPdpOffersNoShow",e.ICQtPdpOffersShow="ICQtPdpOffersShow",e.ICSPBPdpOffersNoShow="ICSPBPdpOffersNoShow",e.ICSPBPdpOffersShow="ICSPBPdpOffersShow",e.ICSPBOffersNoShow="ICSPBOffersNoShow",e.ICSPBOffersCanShow="ICSPBOffersCanShow",e.ICSPBOfferSearchBar="ICSPBOfferSearchBar",e.ICSPBVisibilityFeedback="ICSPBVisibilityFeedback",e.ICSpbOffersNoShowHomePage="ICSpbOffersNoShowHomePage",e.CBNoShow="CBNoShow",e.ErrorToRecordTelemetry="ErrorToRecordTelemetry",e.SubmitGroceryDataErrorCardShow="SubmitGroceryDataErrorCardShow",e.InboxCouponsEmailConnectError="InboxCouponsEmailConnectError",e.InboxCouponsNoCouponsFoundOnRetailerSite="InboxCouponsNoCouponsFoundOnRetailerSite",e.InboxCouponsDisconnectEmailError="InboxCouponsDisconnectEmailError",e.InboxCouponsEmailDisconnected="InboxCouponsEmailDisconnected",e.InboxCouponsNotSupportedLanguage="InboxCouponsNotSupportedLanguage",e.InboxCouponsEdgeSignInSuccess="InboxCouponsEdgeSignInSuccess",e.InboxCouponsEdgeSignInSuccessWorkProfile="InboxCouponsEdgeSignInSuccessWorkProfile",e.InboxCouponsEdgeSignInNotCompleted="InboxCouponsEdgeSignInNotCompleted",e.InboxCouponsEdgeSignInError="InboxCouponsEdgeSignInError",e.InboxCouponsAAUpsellSuppressed="InboxCouponsAAUpsellSuppressed",e.InboxCouponsAAFailureUpsellViewed="InboxCouponsAAFailureUpsellViewed",e.InboxCouponsAAFailureUpsellClicked="InboxCouponsAAFailureUpsellClicked",e.InboxCouponsAAFailureUpsellPaneModuleViewed="InboxCouponsAAFailureUpsellPaneModuleViewed",e.InboxCouponsAASuccessUpsellViewed="InboxCouponsAASuccessUpsellViewed",e.InboxCouponsAASuccessUpsellClicked="InboxCouponsAASuccessUpsellClicked",e.InboxCouponsAASuccessUpsellPaneModuleViewed="InboxCouponsAASuccessUpsellPaneModuleViewed",e.InboxCouponsEmailConnected="InboxCouponsEmailConnected",e.ICAddToCartProductAdded="ICAddToCartProductAdded",e.ICAddToCartProductNotAdded="ICAddToCartProductNotAdded",e.SpbInstantATCOverlayShown="SpbInstantATCOverlayShown",e.QuotientInstantATCOverlayShown="QuotientInstantATCOverlayShown",e.InstantATCOverlayNotShown="InstantATCOverlayNotShown",e.DataValidation="DataValidation",e.FetchGetDataError="FetchGetDataError",e.FetchError="FetchError",e.ToastNotificationError="ToastNotificationError",e.CleaningStorageError="CleaningStorageError",e.StorageLimitReached="StorageLimitReached",e.SidepaneCashbackError="SidepaneCashbackError",e.DiscoverNotificationInfo="DiscoverNotificationInfo",e.DiscoverNotificationViewed="DiscoverNotificationViewed",e.DiscoverNotificationClicked="DiscoverNotificationClicked",e.CampaignCashbackBannerRendered="CampaignCashbackBannerRendered",e.DiscoverPaneError="DiscoverPaneError",e.DiscoverPaneInfo="DiscoverPaneInfo",e.AbandonedCartPersonalizedCashback="AbandonedCartPersonalizedCashback",e.ScrollbarWidthError="ScrollbarWidthError",e.FeatureLast30DSavingsTriviaRendered="FeatureLast30DSavingsTriviaRendered",e.FeatureAvrDailySavingsTriviaRendered="FeatureAvrDailySavingsTriviaRendered",e.CartPageCashbackNotification="CartPageCashbackNotification",e.FeatureSavingsTriviaRendered="FeatureSavingsTriviaRendered",e.FeatureSaversTriviaRendered="FeatureSaversTriviaRendered",e.PageHandlerInfo="PageHandlerInfo",e.PostPurchaseTrack="PostPurchaseTrack",e.PaneHeaderRendered="PaneHeaderRendered",e.PaneTabsRendered="PaneTabsRendered",e.UserInsightsView="UserInsightsView",e.ExpertInsightsView="ExpertInsightsView",e.SuppressAutoApply="SuppressAutoApply",e.HomePageOffersOnShorelineOpen="HomePageOffersOnShorelineOpen",e.HomePageSPBOfferHover="HomePageSPBOfferHover",e.HomePageSPBOfferClick="HomePageSPBOfferClick",e.NonCheckoutBgaaOpened="NonCheckoutBgaaOpened",e.AadUserLinking="AadUserLinking",e.JoinAndActivateImpression="JoinAndActivateImpression",e.ExclusiveCouponsNotificationRendered="ExclusiveCouponsNotificationRendered",e.CouponClippingElements="CouponClippingElements",e.AutoOpenSuppressed="AutoOpenSuppressed",e.CouponClippingSelectorsAvailable="CouponClippingSelectorsAvailable",e.FlyoutDataRecieved="FlyoutDataRecieved",e.UnifiedCashBackShorelineModule="UnifiedCashBackShorelineModule",e.UnifiedCashBackNotificationModule="UnifiedCashBackNotificationModule",e.UnifiedCashBackShorelineBtnClick="UnifiedCashBackShorelineBtnClick",e.UnifiedCashBackNotificationBtnClick="UnifiedCashBackNotificationBtnClick",e.UnifiedCashBackDebugLog="UnifiedCashBackDebugLog",e.PaneSettingsView="PaneSettingsView",e.AutoShowPaused="AutoShowPaused",e.BuyingOptionsRendered="BuyingOptionsRendered",e.BuyingOptionsDiscoverView="BuyingOptionsDiscoverView",e.BuyingOptionsDiscoverHover="BuyingOptionsDiscoverHover",e.BuyingOptionsDiscoverClick="BuyingOptionsDiscoverClick",e.BuyingOptionsFilters="BuyingOptionsFilters",e.BuyingOptionsRetailers="BuyingOptionsRetailers",e.BuyingOptionsNoFilter="BuyingOptionsNoFilter",e.BuyingOptionsNoRetailer="BuyingOptionsNoRetailer",e.BuyingOptionsRetailerHover="BuyingOptionsRetailerHover",e.PreEntityExtraction="PreEntityExtraction",e.ShoppingRewardsFlyoutNoShow="ShoppingRewardsFlyoutNoShow",e.ShoppingRewardsFlyoutShow="ShoppingRewardsFlyoutShow",e.RefreshError="RefreshError",e.PaneAutoOpened="PaneAutoOpened",e.AOPUserEngagement="AOPUserEngagement",e.AOPUserDsat="AOPUserDsat",e}({}),s=function(e){return e.Error="Error",e.Negative="Negative",e.Positive="Positive",e.Cancelled="Cancelled",e.InProgress="InProgress",e}({}),c=function(e){return e.CheckoutPage="CheckoutPage",e.ProductPage="ProductPage",e.HomePage="HomePage",e.SearchPage="SearchPage",e.NonShoppingPage="NonShoppingPage",e.UnknownPage="UnknownPage",e.ConfirmationPage="ConfirmationPage",e}({}),l=function(e){return e.Cart="Cart",e.Checkout="Checkout",e.PurchaseConfirmed="PurchaseConfirmed",e.CancellationRequest="CancellationRequest",e.CancellationConfirmed="CancellationConfirmed",e}({}),u=function(e){return e.Opal="Opal",e.Extension="Extension",e.SafariExtension="SafariExtension",e.SafariIOSExtension="SafariIOSExtension",e.Edge="Edge",e.EdgeMobile="EdgeMobile",e.Sapphire="Sapphire",e.RBC="RBC",e.EdgeAndroid="EdgeAndroid",e.EdgeiOS="EdgeiOS",e.EdgeDiscover="EdgeDiscover",e}({}),d=function(e){return e.AutoApplyCoupons="AutoApplyCoupons",e.CouponClipping="CouponClipping",e.BackgroundAutoApply="BackgroundAutoApply",e.FallBackAutoApply="FallBackAutoApply",e.ProductPageBackgroundAutoApply="ProductPageBackgroundAutoApply",e.BackgroundAAResult="BackgroundAAResult",e.AutoCouponClipping="AutoCouponClipping",e.ApplyCopiedCoupon="ApplyCopiedCoupon",e.ProductBestCoupon="ProductBestCoupon",e.BestCouponBackgroundAutoApply="BestCouponBackgroundAutoApply",e.ExclusiveCoupon="ExclusiveCoupon",e}({}),h=function(e){return e.Wallet="Wallet",e.Shopping="Shopping",e}({}),p=function(e){return e.AutoApplyTransactionsKey="ListOfAutoApplyTransactions",e.CouponClippingTransactionsKey="ListOfCouponClippingTransactions",e.CashbackTransactionsKey="ListOfCashbackTransactions",e}({}),g=function(e){return e.UserCouponFailed="UserCouponFailed",e.BetterInitialPrice="BetterInitialPrice",e.CouponNotInOurCorpus="CouponNotInOurCorpus",e.ManuallyAppliedCouponNotInOurCorpus="ManuallyAppliedCouponNotInOurCorpus",e.SuggestedCoupon="SuggestedCoupon",e.SuppressedSuggestedCoupons="SuppressedSuggestedCoupons",e}({}),C=function(e){return e.PromotionsDataUpdated="PromotionsDataUpdated",e.PromotionsBannerShown="PromotionsBannerShown",e.OrderPurchased="OrderPurchased",e.RewardsNotificationShown="RewardsNotificationShown",e.ViewRewardsClicked="ViewRewardsClicked",e.RewardsEligibleTowerControl="RewardsEligibleTowerControl",e.RewardsEligibleTowerTreatment="RewardsEligibleTowerTreatment",e}({}),S=function(e){return e.AARewards="AARewards",e}({}),m=function(e){return e.Flyout="Flyout",e.Validator="Validator",e.Driver="Driver",e.Controller="Controller",e}({}),A=function(e){return e.LostUsers="Lost User Preference Override",e.LostUsersControl="Lost User Preference Override - Control Log",e}({}),P=function(e){return e.lostUsers="blocked but recovered",e.lostUsersRegular="Eligible for recovering",e}({})},56019:function(e,t,o){o.d(t,{x:function(){return i}});let i=function(e){return e.GetBoxValue="GetBoxValue",e.GetCurrentCheckoutPage="GetCurrentCheckoutPage",e.BetterInitialPrice="BetterInitialPrice",e.CheckoutPageWithoutCoupons="CheckoutPageWithoutCoupons",e.AutoApplyWithoutCoupons="AutoApplyWithoutCoupons",e.AutoApplyWithoutCheckout="AutoApplyWithoutCheckout",e.RemoveCouponFailure="RemoveCouponFailure",e.ApplyButtonUndefined="ApplyButtonUndefined",e.InputUndefined="InputUndefined",e.GetAppliedCoupon="GetAppliedCoupon",e.CouponClippingFailed="CouponClippingFailed",e.OtherSellerFailed="OtherSellerFailed",e.ContinueButtonUndefined="ContinueButtonUndefined",e.ECIframeResponseNotReceived="ECIframeResponseNotReceived",e.ECFrameNameUndefined="ECFrameNameUndefined",e.ECFrameOriginMisMatch="ECFrameOriginMisMatch",e.ExpressCheckoutBNPLFailed="ExpressCheckoutBNPLFailed",e.ErrorParsingBackgroundAutoApplyState="ErrorParsingBackgroundAutoApplyState",e.ExpiredBackgroundAAState="ExpiredBackgroundAAState",e.GetSuggestedCoupon="GetSuggestedCoupon",e.UndefinedState="UndefinedState",e.DomainDisabled="DomainDisabled",e.BackgroundAAError="BackgroundAAError",e.BackgroundAAPDPDisabled="BackgroundAAPDPDisabled",e.SavingsFoundTransactionFailure="SavingsFoundTransactionFailure",e.ApplyButtonDisabled="ApplyButtonDisabled",e.ContinueButtonDisabled="ContinueButtonDisabled",e.CartBlockedCoupons="CartBlockedCoupons",e}({})},5491:function(e,t,o){o.d(t,{V:function(){return r}});var i=o(72370);class r{constructor(){(0,i.Z)(this,"discount",void 0),(0,i.Z)(this,"initialPrice",void 0)}}},93078:function(e,t,o){o.d(t,{v:function(){return i}});let i=function(e){return e[e.Clipping=0]="Clipping",e[e.OtherSellers=1]="OtherSellers",e[e.BackgroundAA=2]="BackgroundAA",e[e.PDPconsentAA=3]="PDPconsentAA",e[e.ApplyClickedCoupon=4]="ApplyClickedCoupon",e[e.ItemizedCashbackAddToCart=5]="ItemizedCashbackAddToCart",e[e.ScrollToItem=6]="ScrollToItem",e[e.InstantAddToCart=8]="InstantAddToCart",e[e.ApplyProductBestCoupon=9]="ApplyProductBestCoupon",e[e.ApplyExclusiveCoupon=10]="ApplyExclusiveCoupon",e}({})},93190:function(e,t,o){o.d(t,{p:function(){return i}});let i=function(e){return e[e.COUPONS_CLIPPING=0]="COUPONS_CLIPPING",e[e.OTHER_SELLERS=1]="OTHER_SELLERS",e[e.OTHER_SELLERS_CONFIRMATION=2]="OTHER_SELLERS_CONFIRMATION",e[e.EXCLUSIVE_COUPONS=3]="EXCLUSIVE_COUPONS",e[e.OTHER_SELLERS_TRIGGER=4]="OTHER_SELLERS_TRIGGER",e[e.ATTAINABLE_COUPONS=5]="ATTAINABLE_COUPONS",e[e.REWARDS_GIFT_CARD=6]="REWARDS_GIFT_CARD",e[e.PRINT_GROCERY=7]="PRINT_GROCERY",e[e.GROCERY_ITEMIZED_CASHBACK=8]="GROCERY_ITEMIZED_CASHBACK",e[e.AUTOS_MARKETPLACE=9]="AUTOS_MARKETPLACE",e[e.ABANDONED_CART=11]="ABANDONED_CART",e[e.PRODUCT_TRACKING_OUT_OF_STOCK=12]="PRODUCT_TRACKING_OUT_OF_STOCK",e[e.GROCERY_ITEMIZED_CASHBACK_LANDING=13]="GROCERY_ITEMIZED_CASHBACK_LANDING",e[e.SPB_CASHBACK_LANDING=14]="SPB_CASHBACK_LANDING",e[e.AA_CONSENT=16]="AA_CONSENT",e}({})},54380:function(e,t,o){},93608:function(e,t,o){o.d(t,{d:function(){return i}});let i=function(e){return e.NotSuggestedCoupon="NotSuggestedCoupon",e.NewSuggestedCoupon="NewSuggestedCoupon",e.ExistingSuggestedCoupon="ExistingSuggestedCoupon",e}({})},39088:function(e,t,o){o.d(t,{HQ:function(){return s},Kr:function(){return r},MN:function(){return n},W1:function(){return i},yJ:function(){return a}});const i="2.363",r="3.518",a="2.997",n="1.177",s="1.613"},21488:function(e,t,o){var i=o(72370),r=o(29247);class a{constructor(){(0,i.Z)(this,"isPersonalizationDataConsentEnabled",void 0),(0,i.Z)(this,"isPersonalizationDataConsentChanged",void 0),(0,i.Z)(this,"isAnonymousFlowEnabled",void 0),(0,i.Z)(this,"isBingSignedInUser",void 0),(0,i.Z)(this,"isMSASignedIn",void 0),(0,i.Z)(this,"isSSOEnabled",void 0),(0,i.Z)(this,"isRebatesUser",void 0),(0,i.Z)(this,"ageGroup",void 0),(0,i.Z)(this,"anonymousUserId",""),(0,i.Z)(this,"isAadEmailPresent",!1),(0,i.Z)(this,"isAADSignedIn",void 0),(0,i.Z)(this,"isMarketingCampaignEventEnrolled",void 0),(0,i.Z)(this,"isCashbackPlatformAcknowledged",void 0),(0,i.Z)(this,"isAADLinkedAccountValid",void 0),(0,i.Z)(this,"isLinkingPolicyEnabled",void 0),(0,i.Z)(this,"hanid",void 0)}static Create(e,t,o,i,n){const s=new a;return s.isRebatesUser=t||e?.cashback?.userRebateResponse?.isRebatesUser||!1,s.isBingSignedInUser=e?.userInfo?.isBingSignedInUser??!1,s.isMSASignedIn=e?.userInfo?.isMSASignedIn??!1,s.isSSOEnabled=e?.userInfo?.isSSOEnabled??!1,s.isPersonalizationDataConsentEnabled=e?.userInfo?.isPersonalizationDataConsentEnabled??!1,s.isPersonalizationDataConsentChanged=e?.userInfo?.isPersonalizationDataConsentChanged??!1,s.ageGroup=e?.userInfo?.ageGroup??void 0,s.isAnonymousFlowEnabled=e?.itemLevelCashBack?.isAnonymousFlowEnabled??!1,s.isAadEmailPresent=!!o,s.isAADSignedIn=e?.userInfo?.isAADSignedIn??!1,s.isMarketingCampaignEventEnrolled=e?.promotionalCampaignDealsResponse?.isEnrolled,s.isCashbackPlatformAcknowledged=e?.promotionalCampaignDealsResponse?.isCashbackPlatformAcknowledged,s.isAADLinkedAccountValid=r.ZP.parseBool(i)||e?.userInfo?.isAADLinkedAccountValid||!1,s.isLinkingPolicyEnabled=r.ZP.parseBool(n),s.hanid=e?.userInfo?.hanid??"",s}}t.Z=a},3634:function(e,t,o){o.d(t,{$S:function(){return s},LJ:function(){return u},P5:function(){return l},PK:function(){return C},RY:function(){return r},T2:function(){return h},Z3:function(){return a},eS:function(){return d},fU:function(){return p},js:function(){return n},kH:function(){return S},m7:function(){return c},uv:function(){return g}});var i=o(5144);i.BN.EdgeMobile,i.BN.EdgeAndroid,i.BN.EdgeiOS;i.BN.Edge;const r=new Set(["amazon.com","amazon.ca","amazon.co.uk","amazon.co.jp","alibaba.com"]),a=new Map(Object.entries({"etsy.com":"receipt_id","target.com":"referenceId","tmall.com":"bizOrderId"})),n="GET_ORDER_ID_FROM_URL",s="GET_TRANSACTION_ID_FROM_URL",c="GET_TRANSACTION_ID_FROM_PATH_URL",l="<TRANSACTION_ID>",u=216e5,d="microsoft exclusive offer",h="lateAutoOpenEvent",p="spbCartResponseEvent",g="COMPONENT_TO_FOCUS_IN_SHORELINE",C={"bestbuy.com":{policyDays:15,supportPageUrl:"https://www.bestbuy.com/site/help-topics/price-match-guarantee/pcmcat290300050002.c?id=pcmcat290300050002"},"costco.com":{policyDays:30,supportPageUrl:"https://customerservice.costco.com/app/answers/detail/a_id/628/~/price-adjustment---costco.com-orders",useCartAtPathname:"/checkoutcartdisplayview"},"kohls.com":{policyDays:14,supportPageUrl:"https://cs.kohls.com/app/answers/detail/a_id/90/~/price-match-policy"},"target.com":{policyDays:14,supportPageUrl:"https://help.target.com/help/subcategoryarticle?childcat=Price+Match+Guarantee&parentcat=Policies+%26+Guidelines&searchQuery=search+help",useCartAtPathname:"/cart"},"dickssportinggoods.com":{policyDays:14,supportPageUrl:"https://www.dickssportinggoods.com/s/price-match-policy",useCartAtPathname:"/orderitemdisplay"},"jcpenney.com":{policyDays:14,supportPageUrl:"https://www.jcpenney.com/m/customer-service/our-lowest-price-guarantee"},"macys.com":{policyDays:10,supportPageUrl:"https://customerservice-macys.com/articles/how-can-i-get-a-price-adjustment",useCartAtPathname:"/my-bag",hasCsrError:!0},"ashleyfurniture.com":{policyDays:30,supportPageUrl:"https://www.ashleyfurniture.com/price-match/"},"gap.com":{policyDays:14,supportPageUrl:"https://www.gap.com/customerService/info.do?cid=1192378"},"staples.com":{policyDays:14,supportPageUrl:"https://www.staples.com/sbd/cre/marketing/pmg/index.html"}},S=Object.keys(C)},21597:function(e,t,o){o.d(t,{$R:function(){return a},aE:function(){return r}});var i=o(72370);let r=function(e){return e[e.api_response=0]="api_response",e[e.nagivation_guid=1]="nagivation_guid",e[e.disabled_scenarios=2]="disabled_scenarios",e[e.enabled_features=3]="enabled_features",e[e.storage_param=4]="storage_param",e[e.auto_show_enabled=5]="auto_show_enabled",e[e.snoozed_values=6]="snoozed_values",e[e.disable_popup_originations_for_current_domain=7]="disable_popup_originations_for_current_domain",e[e.is_off_the_record=8]="is_off_the_record",e[e.is_bing_identity_valid_for_enroll=9]="is_bing_identity_valid_for_enroll",e[e.is_rebates_active=10]="is_rebates_active",e[e.is_rebates_activation_pending_for_last_committed_url=11]="is_rebates_activation_pending_for_last_committed_url",e[e.allow_organic_rebates=12]="allow_organic_rebates",e[e.get_activate_rebates_status=13]="get_activate_rebates_status",e[e.is_bing_rebates_flow=14]="is_bing_rebates_flow",e[e.is_personalized_cashback_active=15]="is_personalized_cashback_active",e[e.is_bing_ad_referred=16]="is_bing_ad_referred",e[e.has_msa_profile=17]="has_msa_profile",e[e.has_bing_campaign_guid=18]="has_bing_campaign_guid",e[e.show_rewards_coachmark=19]="show_rewards_coachmark",e[e.should_stand_down=20]="should_stand_down",e[e.personalization_in_context_can_prompt=21]="personalization_in_context_can_prompt",e[e.user_info=22]="user_info",e[e.enabled_service_flights=23]="enabled_service_flights",e[e.enabled_service_features=24]="enabled_service_features",e[e.is_checkout_page_using_url_match=25]="is_checkout_page_using_url_match",e[e.has_autofill_data=26]="has_autofill_data",e[e.is_personalized_cashback_enabled=27]="is_personalized_cashback_enabled",e[e.pane_state=28]="pane_state",e[e.is_edge_shopping_flag=29]="is_edge_shopping_flag",e[e.is_edge_profile=30]="is_edge_profile",e[e.edge_profile_data=31]="edge_profile_data",e[e.is_ax_shop_enabled_with_detected_screen_reader=32]="is_ax_shop_enabled_with_detected_screen_reader",e[e.discover_state=33]="discover_state",e[e.session_ids=34]="session_ids",e[e.package_tracking_data=35]="package_tracking_data",e[e.bing_redirect_chain=36]="bing_redirect_chain",e[e.enabled_service_features_v2=37]="enabled_service_features_v2",e[e.cjk_params=38]="cjk_params",e[e.user_cohort_data=39]="user_cohort_data",e}({}),a=function(e){return e[e.api_response=0]="api_response",e[e.nagivation_guid=1]="nagivation_guid",e[e.enabled_features=2]="enabled_features",e[e.storage_param=3]="storage_param",e[e.import_options=4]="import_options",e[e.user_info=6]="user_info",e[e.enabled_service_flights=7]="enabled_service_flights",e[e.enabled_service_features=8]="enabled_service_features",e[e.has_autofill_data=10]="has_autofill_data",e[e.checkout_enabled_service_features_v2=13]="checkout_enabled_service_features_v2",e[e.checkout_user_cohort_data=14]="checkout_user_cohort_data",e[e.confirmation_enabled_service_features_v2=17]="confirmation_enabled_service_features_v2",e[e.confirmation_user_cohort_data=18]="confirmation_user_cohort_data",e}({});t.ZP=class{constructor(){(0,i.Z)(this,"blockedList",void 0),(0,i.Z)(this,"paths",void 0),this.blockedList=[],this.paths=new Map}}},87720:function(e,t,o){o.d(t,{Gr:function(){return a},Q5:function(){return r},Sk:function(){return s},Zs:function(){return u},cv:function(){return n},n1:function(){return c},z0:function(){return l}});var i=o(72370);const r="AutoOpenData",a="LastCleanedData",n="AutoOpenPrefData",s="AutoOpenDomainPrefData",c="LastShownData",l="StageAndCategoryLastShown",u=1728e5;t.ZP=class{constructor(){(0,i.Z)(this,"popupOrigination",void 0),(0,i.Z)(this,"timeLastAutoOpen",void 0),(0,i.Z)(this,"snoozeTime",void 0),(0,i.Z)(this,"blockedForSite",void 0),(0,i.Z)(this,"lostUserReblockedTime",void 0)}}},3141:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"blockedListPath",void 0)}}},35386:function(e,t,o){o.d(t,{v:function(){return i}});let i=function(e){return e[e.UNDEFINED=0]="UNDEFINED",e[e.DISCOVER=1]="DISCOVER",e[e.RESEARCH=2]="RESEARCH",e[e.DECISION=3]="DECISION",e[e.PURCHASE=4]="PURCHASE",e[e.POST_PURCHASE=5]="POST_PURCHASE",e}({})},11050:function(e,t,o){o.d(t,{h:function(){return i}});let i=function(e){return e.Quotient="q",e.Ibotta="i",e.Self="s",e.FirstParty="1p",e.SPB="spb",e.Unknown="unknown",e}({})},88767:function(e,t,o){o.d(t,{FA:function(){return s},ModuleNames:function(){return a},Te:function(){return r},sM:function(){return n},yA:function(){return c},zE:function(){return i}});let i=function(e){return e.PRICE_COMPARISON="Mainline",e.PRICE_COMPARISON_FREE="FreeAdMiddle",e.SIMILAR_OFFERS="SimilarMainline",e.SIMILAR_OFFERS_FREE="SimilarFreeAdMiddle",e.SPB_OFFERS="SponsoredPromotionsBrandMainline",e.NOT_SPECIFIED="NOT_SPECIFIED",e}({}),r=function(e){return e.Mouse="mouse",e.Keyboard="keyboard",e.Auto="auto",e.Banner="banner",e.Hover="hover",e}({}),a=function(e){return e.COUPON="COUPON",e.PRICECOMPARISON="PRICECOMPARISON",e.SIMILAR_OFFERS="SIMILAR_OFFERS",e.CASHBACK="CASHBACK",e.UNIFIED_CASHBACK="UNIFIED_CASHBACK",e.CASHBACK_ACTIVATE="CASHBACK_ACTIVATE",e.CASHBACK_DELAYED_ENROLLMENT="CASHBACK_DELAYED_ENROLLMENT",e.EMPTYCOUPON="EMPTYCOUPON",e.PRICEHISTORY="PRICEHISTORY",e.COUPONCLIPPING="COUPONCLIPPING",e.DEALS="DEALS",e.RECOMMENDATIONS="RECOMMENDATIONS",e.SIMILARSELLERS="SIMILARSELLERS",e.PRODUCTHISTORY="PRODUCTHISTORY",e.REWARD="REWARD",e.PRODUCTSUMMARYCARD="PRODUCTSUMMARYCARD",e.PAYMENT_OPTIONS="PAYMENT_OPTIONS",e.SOCIALCOUPONS="SOCIALCOUPONS",e.ORDERSTATUSTRACKING="ORDERSTATUSTRACKING",e.VIRTUAL_CARD="VIRTUAL_CARD",e.SUSTAINABILITY="SUSTAINABILITY",e.PRINTABLE_COUPON="PRINTABLE_COUPON",e.TRACKING_CONFIRMATION="TRACKING_CONFIRMATION",e.FEEDBACK="FEEDBACK",e.ViewedProductPriceDrop="ViewedProductPriceDrop",e.PINTEREST="PINTEREST",e.GROCERY_CASHBACK="GROCERY_CASHBACK",e.GROCERY_CASHBACK_PENDING="GROCERY_CASHBACK_PENDING",e.AUTOSMARKETPLACE="AUTOSMARKETPLACE",e.AUTOSMYGARAGE="AUTOSMYGARAGE",e.AUTOSREVIEWS="AUTOSREVIEWS",e.MOMENT_IN_TIME="MOMENT_IN_TIME",e.TRENDING_OFFERS="TRENDING_OFFERS",e.TRENDING_OFFERS_ON_CONTEXTUAL_TAB="TRENDING_OFFERS_ON_CONTEXTUAL_TAB",e.DAILY_DEALS="DAILY_DEALS",e.RELATED_PRODUCTS="RELATED_PRODUCTS",e.VISUAL_SEARCH="VISUAL_SEARCH",e.INFINITE_CATEGORY_FEED="INFINITE_CATEGORY_FEED",e.BUY_DIRECT="BUY_DIRECT",e.PRODUCT_COLLECTIONS="PRODUCT_COLLECTIONS",e.SHOPPING_TRIPS="SHOPPING_TRIPS",e.ABANDONED_CART="ABANDONED_CART",e.PRODUCT_TRACKING_OUT_OF_STOCK="PRODUCT_TRACKING_OUT_OF_STOCK",e.PRODUCT_TRACKING_PRICE_DROP="PRODUCT_TRACKING_PRICE_DROP",e.ITEMIZED_CASHBACK="ITEMIZED_CASHBACK",e.DISCOVER_CHAT_CHIPS="DISCOVER_CHAT_CHIPS",e.SMART_COMPARE="SMART_COMPARE",e.USER_INSIGHTS="USER_INSIGHTS",e.EXPERT_INSIGHTS="EXPERT_INSIGHTS",e.PRODUCT_SUMMARY="PRODUCT_SUMMARY",e.BUYING_GUIDES="BUYING_GUIDES",e.INBOX_COUPONS="INBOX_COUPONS",e.ACTIVE_RETAILER_INBOX_COUPONS="ACTIVE_RETAILER_INBOX_COUPONS",e.TRENDING_COUPONS="TRENDING_COUPONS",e.SOCIALCOUPONS_PERSISTENT="SOCIALCOUPONS_PERSISTENT",e.SAN_CONSENT="SAN_CONSENT",e.SEARCH_RESULTS="SEARCH_RESULTS",e.SEARCH_IN_PANE="SEARCH_IN_PANE",e.SIDEPANE_CASHBACK="SIDEPANE_CASHBACK",e.AX_SHOPPING_NAV="AX_SHOPPING_NAV",e.SAFARI_FIRST_RUN_EXPERIENCE="SAFARI_FIRST_RUN_EXPERIENCE",e.CAMPAIGN_PDP_CASHBACK="CAMPAIGN_PDP_CASHBACK",e.CAMPAIGN_BANNER="CAMPAIGN_BANNER",e.FEED_CAMPAIGN="FEED_CAMPAIGN",e.WISHLIST="WISHLIST",e.CJK_SIMILAR_PRODUCTS="CJK_SIMILAR_PRODUCTS",e.PRODUCT_BEST_COUPON="PRODUCT_BEST_COUPON",e.MENU="MENU",e.PRODUCT_TRACKING_ALERT="PRODUCT_TRACKING_ALERT",e.SAFARI_NULL_STATE="SAFARI_NULL_STATE",e.TRAVEL_CHEAPER_FLIGHT="TRAVEL_CHEAPER_FLIGHT",e.BACKGROUND_AUTO_APPLY="BACKGROUND_AUTO_APPLY",e.POST_PURCHASE_REWARDS="POST_PURCHASE_REWARDS",e.CASHBACK_DASHBOARD="CASHBACK_DASHBOARD",e}({}),n=function(e){return e.CASHBACK="CASHBACK",e.CASHBACK_DASHBOARD="CASHBACK_DASHBOARD",e.UNIFIED_CASHBACK="UNIFIED_CASHBACK",e.CASHBACKCONFIRMATION="CASHBACKCONFIRMATION",e.CASHBACKTURNEDOFF="CASHBACKTURNEDOFF",e.CASHBACK_CHECKOUT_NOTIFICATION="CASHBACK_CHECKOUT_NOTIFICATION",e.CASHBACK_PDP_NOTIFICATION="CASHBACK_PDP_NOTIFICATION",e.REWARD="REWARD",e.SIMILARSELLERS_NOTIFICATION="SIMILARSELLERS_NOTIFICATION",e.SIMILARSELLERS_CONFIRMATION_NOTIFICATION="SIMILARSELLERS_CONFIRMATION_NOTIFICATION",e.PRICECOMPARISON="PRICECOMPARISON",e.SOCIALCOUPONS="SOCIALCOUPONS",e.TRACKING_CONFIRMATION="TRACKING_CONFIRMATION",e.VIRTUAL_CARD="VIRTUAL_CARD",e.ViewedProductPriceDrop="ViewedProductPriceDrop",e.SUSTAINABILITY="SUSTAINABILITY_NOTIFICATION",e.AUTOSMARKETPLACE_NOTIFICATION="AUTOSMARKETPLACE_NOTIFICATION",e.AUTOSREVIEW_NOTIFICATION="AUTOSREVIEW_NOTIFICATION",e.GROCERY_CASHBACK_NOTIFICATION="GROCERY_CASHBACK_NOTIFICATION",e.GROCERY_CASHBACK_PENDING_NOTIFICATION="GROCERY_CASHBACK_PENDING_NOTIFICATION",e.ITEMIZED_CASHBACK_NOTIFICATION="ITEMIZED_CASHBACK_NOTIFICATION",e.PRICEHISTORY="PRICEHISTORY",e.COUPON="COUPON",e.RECOMMENDATION="RECOMMENDATION",e.PRICE_DROP_PLUS_COUPONS_COMPOSITE="PRICE_DROP_PLUS_COUPONS_COMPOSITE",e.CASHBACK_PLUS_COUPONS_COMPOSITE="CASHBACK_PLUS_COUPONS_COMPOSITE",e.PRICE_DROP_PLUS_CASHBACK="PRICE_DROP_PLUS_CASHBACK",e.LOWER_PRICE_PLUS_CASHBACK_PLUS_COUPONS_COMPOSITE="LOWER_PRICE_PLUS_CASHBACK_PLUS_COUPONS_COMPOSITE",e.ABANDONED_CART="ABANDONED_CART",e.PRODUCT_TRACKING_OFFERS_COUPON_NOTIFICATION="PRODUCT_TRACKING_OFFERS_COUPON_NOTIFICATION",e.PRODUCT_TRACKING_BACK_IN_STOCK_NOTIFICATION="PRODUCT_TRACKING_BACK_IN_STOCK_NOTIFICATION",e.PRODUCT_TRACKING_OUT_OF_STOCK_NOTIFICATION="PRODUCT_TRACKING_OUT_OF_STOCK_NOTIFICATION",e.PRODUCT_TRACKING_PRICE_DROP_NOTIFICATION="PRODUCT_TRACKING_PRICE_DROP_NOTIFICATION",e.COUPONCLIPPING="COUPONCLIPPING",e.TRENDING_COUPONS="TRENDING_COUPONS",e.MOMENT_IN_TIME="MOMENT_IN_TIME",e.SAN_CONSENT_NOTIFICATION="SAN_CONSENT_NOTIFICATION",e.DISCOVER_CHAT="DISCOVER_CHAT",e.CAMPAIGN_PDP_CASHBACK_NOTIFICATION="CAMPAIGN_PDP_CASHBACK_NOTIFICATION",e.CAMPAIGN_AWARENESS_NOTIFICATION="CAMPAIGN_AWARENESS_NOTIFICATION",e.AX_SHOPPING_NAV="AX_SHOPPING_NAV",e.PRODUCT_BEST_COUPON="PRODUCT_BEST_COUPON",e.ENROLL_TO_CASHBACK_CONFIRMATION_NOTIFICATION="ENROLL_TO_CASHBACK_CONFIRMATION_NOTIFICATION",e.POST_PURCHASE_CONSENT_NOTIFICATION="POST_PURCHASE_CONSENT_NOTIFICATION",e.SEARCHBOXDEMO_NOTIFICATION="SEARCHBOXDEMO_NOTIFICATION",e.PRICE_MATCH_PRICE_DROP_NOTIFICATION="PRICE_MATCH_PRICE_DROP_NOTIFICATION",e.INBOX_PRICE_MATCH_PRICE_DROP_NOTIFICATION="INBOX_PRICE_MATCH_PRICE_DROP_NOTIFICATION",e.TRAVEL_CHEAPER_FLIGHT_NOTIFICATION="TRAVEL_CHEAPER_FLIGHT_NOTIFICATION",e.TRAVEL_CHEAPER_HOTEL_NOTIFICATION="TRAVEL_CHEAPER_HOTEL_NOTIFICATION",e.DISCOVER_NOTIFICATION="DISCOVER_NOTIFICATION",e.AX_SHOPPING_NAV_NOTIFICATION="AX_SHOPPING_NAV_NOTIFICATION",e.ARTICLES_CASHBACK_NOTIFICATION="ARTICLES_CASHBACK_NOTIFICATION",e.BGAA_NOTIFICATION="BGAA_NOTIFICATION",e.POST_PURCHASE_REWARDS_NOTIFICATION="POST_PURCHASE_REWARDS_NOTIFICATION",e}({}),s=function(e){return e[e.NOT_ACTIVATING=0]="NOT_ACTIVATING",e[e.STARTED=1]="STARTED",e[e.FAILED=2]="FAILED",e[e.FAILED_SWITCH_TO_MSA_PROFILE=3]="FAILED_SWITCH_TO_MSA_PROFILE",e[e.FAILED_SWITCH_TO_MSA_DECLINED=4]="FAILED_SWITCH_TO_MSA_DECLINED",e[e.FAILED_SIGN_INTO_PROFILE=5]="FAILED_SIGN_INTO_PROFILE",e[e.PENDING_ENROLL_REBATES_USER=6]="PENDING_ENROLL_REBATES_USER",e[e.PENDING_SWITCH_TO_MSA_PROFILE=7]="PENDING_SWITCH_TO_MSA_PROFILE",e[e.PENDING_SIGN_INTO_PROFILE=8]="PENDING_SIGN_INTO_PROFILE",e[e.PENDING_ACTIVATION_IN_PROFILE=9]="PENDING_ACTIVATION_IN_PROFILE",e[e.FAILED_ACTIVATION_NO_RETAILER_DATA=10]="FAILED_ACTIVATION_NO_RETAILER_DATA",e[e.FAILED_ACTIVATION_URL_FETCH=11]="FAILED_ACTIVATION_URL_FETCH",e[e.FAILED_ACTIVATION_INVALID_JSON=12]="FAILED_ACTIVATION_INVALID_JSON",e[e.FAILED_ACTIVATION_URL_PARSING=13]="FAILED_ACTIVATION_URL_PARSING",e[e.FAILED_ACTIVATION_URL_INVALID=14]="FAILED_ACTIVATION_URL_INVALID",e[e.FAILED_ACTIVATION_ENROLL_NAVIGATION_LOAD=15]="FAILED_ACTIVATION_ENROLL_NAVIGATION_LOAD",e[e.FAILED_ACTIVATION_ENROLL_NAVIGATION_TIMED_OUT=16]="FAILED_ACTIVATION_ENROLL_NAVIGATION_TIMED_OUT",e[e.FAILED_ACTIVATION_ATTRIBUTION_NAVIGATION_LOAD=17]="FAILED_ACTIVATION_ATTRIBUTION_NAVIGATION_LOAD",e[e.FAILED_ACTIVATION_ATTRIBUTION_NAVIGATION_TIMED_OUT=18]="FAILED_ACTIVATION_ATTRIBUTION_NAVIGATION_TIMED_OUT",e[e.ACTIVATED=19]="ACTIVATED",e[e.FAILED_ACTIVATION_UNIFIED_API_BACKED_OFF=20]="FAILED_ACTIVATION_UNIFIED_API_BACKED_OFF",e[e.FAILED_ACTIVATION_ENROLL_VERIFY_COOKIE=21]="FAILED_ACTIVATION_ENROLL_VERIFY_COOKIE",e[e.FAILED_ACTIVATION_ENROLL_COOKIE_TIMED_OUT=22]="FAILED_ACTIVATION_ENROLL_COOKIE_TIMED_OUT",e[e.PENDING_BING_SSO=23]="PENDING_BING_SSO",e[e.PENDING_BING_IDENTITY_CHECK=24]="PENDING_BING_IDENTITY_CHECK",e[e.FAILED_ACTIVATION_ENROLL_API=26]="FAILED_ACTIVATION_ENROLL_API",e[e.FAILED_FETCHING_USER_INFO=27]="FAILED_FETCHING_USER_INFO",e}({}),c=function(e){return e.LISTING="Listing",e.REVIEW="REVIEW",e.MYGARAGE="MYGARAGE",e.NONE="",e}({})},73557:function(e,t,o){o.d(t,{Ke:function(){return r},sR:function(){return i}});let i=function(e){return e[e.AUTO_SHOW_COUPONS_CHECKOUT=1]="AUTO_SHOW_COUPONS_CHECKOUT",e[e.AUTO_SHOW_LOWER_PRICE_FOUND=5]="AUTO_SHOW_LOWER_PRICE_FOUND",e[e.AUTO_SHOW_BING_SEARCH=6]="AUTO_SHOW_BING_SEARCH",e[e.AUTO_SHOW_REBATES=7]="AUTO_SHOW_REBATES",e[e.AUTO_SHOW_REBATES_CONFIRMATION=8]="AUTO_SHOW_REBATES_CONFIRMATION",e[e.AUTO_SHOW_REBATES_DEACTIVATED=9]="AUTO_SHOW_REBATES_DEACTIVATED",e[e.AUTO_SHOW_REBATES_ORGANIC=11]="AUTO_SHOW_REBATES_ORGANIC",e[e.AUTO_SHOW_PRICE_HISTORY=13]="AUTO_SHOW_PRICE_HISTORY",e[e.AUTO_SHOW_REBATES_ORGANIC_NEW=14]="AUTO_SHOW_REBATES_ORGANIC_NEW",e[e.AUTO_SHOW_REBATES_CHECKOUT=15]="AUTO_SHOW_REBATES_CHECKOUT",e[e.AUTO_SHOW_PERSONALIZED_CASHBACK=17]="AUTO_SHOW_PERSONALIZED_CASHBACK",e[e.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION=18]="AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION",e[e.AUTO_SHOW_URL_PARAM_REBATES=19]="AUTO_SHOW_URL_PARAM_REBATES",e[e.AUTO_SHOW_URL_PARAM_PRICE_COMPARISON=20]="AUTO_SHOW_URL_PARAM_PRICE_COMPARISON",e[e.AUTO_SHOW_URL_PARAM_PRICE_HISTORY=21]="AUTO_SHOW_URL_PARAM_PRICE_HISTORY",e[e.AUTO_SHOW_EXPRESS_CHECKOUT=22]="AUTO_SHOW_EXPRESS_CHECKOUT",e[e.AUTO_SHOW_SERVER_DRIVEN_REWARDS=26]="AUTO_SHOW_SERVER_DRIVEN_REWARDS",e[e.AUTO_SHOW_COUPONS_CLIPPING=27]="AUTO_SHOW_COUPONS_CLIPPING",e[e.AUTO_SHOW_REBATES_ACTIVATION_FAILED=28]="AUTO_SHOW_REBATES_ACTIVATION_FAILED",e[e.AUTO_SHOW_REBATES_SWITCHED_TO_MSA=29]="AUTO_SHOW_REBATES_SWITCHED_TO_MSA",e[e.AUTO_SHOW_OTHER_SELLERS=31]="AUTO_SHOW_OTHER_SELLERS",e[e.AUTO_SHOW_ITEM_ADDED_TO_CART_FROM_OTHER_SELLER=32]="AUTO_SHOW_ITEM_ADDED_TO_CART_FROM_OTHER_SELLER",e[e.AUTO_SHOW_PROFESSIONAL_REVIEWS=33]="AUTO_SHOW_PROFESSIONAL_REVIEWS",e[e.AUTO_SHOW_VIRTUAL_CARD=35]="AUTO_SHOW_VIRTUAL_CARD",e[e.AUTO_SHOW_BING_CAMPAIGN=36]="AUTO_SHOW_BING_CAMPAIGN",e[e.AUTO_SHOW_PACKAGE_TRACKING=40]="AUTO_SHOW_PACKAGE_TRACKING",e[e.AUTO_SHOW_SERVER_DRIVEN_NOTIFICATION=41]="AUTO_SHOW_SERVER_DRIVEN_NOTIFICATION",e[e.OPEN_FLYOUT_FROM_EDGE_DRIVER_EC=42]="OPEN_FLYOUT_FROM_EDGE_DRIVER_EC",e[e.AUTO_SHOW_GUEST_DOMAIN_COUPONS=43]="AUTO_SHOW_GUEST_DOMAIN_COUPONS",e[e.AUTO_SHOW_SOCIAL_COUPONS=44]="AUTO_SHOW_SOCIAL_COUPONS",e[e.AUTO_SHOW_SUSTAINABILITY_LANDING=45]="AUTO_SHOW_SUSTAINABILITY_LANDING",e[e.AUTO_SHOW_SUSTAINABILITY_PURCHASE=46]="AUTO_SHOW_SUSTAINABILITY_PURCHASE",e[e.AUTO_SHOW_REWARDS_ACTIVATION_FAILED=47]="AUTO_SHOW_REWARDS_ACTIVATION_FAILED",e[e.AUTO_SHOW_REWARDS_SWITCHED_TO_MSA=48]="AUTO_SHOW_REWARDS_SWITCHED_TO_MSA",e[e.AUTO_SHOW_ATTAINABLE_COUPONS=49]="AUTO_SHOW_ATTAINABLE_COUPONS",e[e.AUTO_SHOW_GIFT_CARD=50]="AUTO_SHOW_GIFT_CARD",e[e.AUTO_SHOW_RECOMMENDATIONS=51]="AUTO_SHOW_RECOMMENDATIONS",e[e.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK=52]="AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK",e[e.AUTO_SHOW_AOC=53]="AUTO_SHOW_AOC",e[e.AUTO_SHOW_AUTOS_MARKETPLACE=54]="AUTO_SHOW_AUTOS_MARKETPLACE",e[e.AUTO_PRODUCT_TRACKING_OUT_OF_STOCK=58]="AUTO_PRODUCT_TRACKING_OUT_OF_STOCK",e[e.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING=59]="AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING",e[e.AUTO_SHOW_SPB_CASHBACK_LANDING=60]="AUTO_SHOW_SPB_CASHBACK_LANDING",e[e.AA_CONSENT=62]="AA_CONSENT",e[e.AUTO_SHOW_SAN_CONSENT_CONFIRMATION=63]="AUTO_SHOW_SAN_CONSENT_CONFIRMATION",e[e.AUTO_SHOW_MOMENT_IN_TIME=65]="AUTO_SHOW_MOMENT_IN_TIME",e[e.AUTO_SHOW_TRENDING_COUPONS=67]="AUTO_SHOW_TRENDING_COUPONS",e[e.AUTO_SHOW_ABANDONED_CART=72]="AUTO_SHOW_ABANDONED_CART",e[e.AUTO_SHOW_PRODUCT_TRACKING_BACK_IN_STOCK=73]="AUTO_SHOW_PRODUCT_TRACKING_BACK_IN_STOCK",e[e.AUTO_PRODUCT_TRACKING_EXP_PRICE_DROP=74]="AUTO_PRODUCT_TRACKING_EXP_PRICE_DROP",e[e.AUTO_PRODUCT_TRACKING_IMP_PRICE_DROP=75]="AUTO_PRODUCT_TRACKING_IMP_PRICE_DROP",e[e.HOVER_BUTTON_SHOW_FLYOUT=86]="HOVER_BUTTON_SHOW_FLYOUT",e[e.CJK_OPEN_HUB_ICON=87]="CJK_OPEN_HUB_ICON",e[e.AUTO_SHOW_REBATES_PDP=89]="AUTO_SHOW_REBATES_PDP",e[e.AUTO_SHOW_PRODUCT_BEST_COUPON_CONSENT=90]="AUTO_SHOW_PRODUCT_BEST_COUPON_CONSENT",e[e.AUTO_SHOW_CAMPAIGN_PDP_NOTIFICATION=91]="AUTO_SHOW_CAMPAIGN_PDP_NOTIFICATION",e[e.AUTO_SHOW_CAMPAIGN_AWARENESS_NOTIFICATION=92]="AUTO_SHOW_CAMPAIGN_AWARENESS_NOTIFICATION",e[e.AUTO_SHOW_CASHBACK_PDP_PLUS_COUPONS=98]="AUTO_SHOW_CASHBACK_PDP_PLUS_COUPONS",e[e.AUTO_SHOW_PRICE_DROP_PLUS_CASHBACK=99]="AUTO_SHOW_PRICE_DROP_PLUS_CASHBACK",e[e.AUTO_SHOW_IBC_UPSELL=100]="AUTO_SHOW_IBC_UPSELL",e[e.AUTO_SHOW_POST_PURCHASE_TRACKING=101]="AUTO_SHOW_POST_PURCHASE_TRACKING",e[e.AUTO_SHOW_AMAZON_SEARCH_PC=102]="AUTO_SHOW_AMAZON_SEARCH_PC",e[e.AUTO_SHOW_LOWER_PRICE_PLUS_CASHBACK_PLUS_COUPONS=103]="AUTO_SHOW_LOWER_PRICE_PLUS_CASHBACK_PLUS_COUPONS",e[e.AUTO_SHOW_DISCOVER_NOTIFICATION=105]="AUTO_SHOW_DISCOVER_NOTIFICATION",e[e.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY=107]="AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY",e[e.AUTO_SHOW_PERSONALIZED_CASHBACK_ADDRESSBAR=108]="AUTO_SHOW_PERSONALIZED_CASHBACK_ADDRESSBAR",e[e.AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_FLIGHTS=109]="AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_FLIGHTS",e[e.AUTO_SHOW_ARTICLES_CASHBACK_NOTIFICATION=110]="AUTO_SHOW_ARTICLES_CASHBACK_NOTIFICATION",e[e.AUTO_SHOW_CJK_PRICE_DROP=111]="AUTO_SHOW_CJK_PRICE_DROP",e[e.AUTO_SHOW_CJK_COUPON_FOUND=112]="AUTO_SHOW_CJK_COUPON_FOUND",e[e.AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION=113]="AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION",e[e.AUTO_SHOW_INBOX_PRICE_MATCH_NOTIFICATION=114]="AUTO_SHOW_INBOX_PRICE_MATCH_NOTIFICATION",e[e.AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_HOTEL_ROOM=115]="AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_HOTEL_ROOM",e[e.AUTO_SHOW_POST_PURCHASE_REWARDS_NOTIFICATION=116]="AUTO_SHOW_POST_PURCHASE_REWARDS_NOTIFICATION",e}({}),r=function(e){return e[e.NONE=0]="NONE",e[e.COUPONS_CHECKOUT=1]="COUPONS_CHECKOUT",e[e.COUPONS_CLIPPING=2]="COUPONS_CLIPPING",e[e.PRICE_COMPARE=4]="PRICE_COMPARE",e[e.PRICE_HISTORY=8]="PRICE_HISTORY",e[e.REBATES_CONFIRMATION=16]="REBATES_CONFIRMATION",e[e.REBATES_BING=32]="REBATES_BING",e[e.REBATES_ORGANIC=64]="REBATES_ORGANIC",e[e.REBATES_CHECKOUT=128]="REBATES_CHECKOUT",e[e.PERSONALIZED_CASHBACK=256]="PERSONALIZED_CASHBACK",e[e.PERSONALIZED_CASHBACK_CONFIRMATION=512]="PERSONALIZED_CASHBACK_CONFIRMATION",e[e.EXPRESS_CHECKOUT=1024]="EXPRESS_CHECKOUT",e[e.REWARDS=2048]="REWARDS",e[e.OTHER_SELLER=4096]="OTHER_SELLER",e[e.REVIEWS=8192]="REVIEWS",e[e.VIRTUAL_CARD=16384]="VIRTUAL_CARD",e[e.PACKAGE_TRACKING=32768]="PACKAGE_TRACKING",e[e.GUEST_COUPONS=65536]="GUEST_COUPONS",e[e.EXCLUSIVE_COUPONS=131072]="EXCLUSIVE_COUPONS",e[e.SUSTAINABILITY_LANDING=262144]="SUSTAINABILITY_LANDING",e[e.SUSTAINABILITY_PURCHASE=524288]="SUSTAINABILITY_PURCHASE",e[e.ATTAINABLE_COUPONS=1048576]="ATTAINABLE_COUPONS",e[e.REWARDS_GIFT_CARD=2097152]="REWARDS_GIFT_CARD",e[e.RECOMMENDATIONS=4194304]="RECOMMENDATIONS",e[e.GROCERY_ITEMIZED_CASHBACK=8388608]="GROCERY_ITEMIZED_CASHBACK",e[e.AUTOS_MARKETPLACE=16777216]="AUTOS_MARKETPLACE",e[e.SHOPRUNNER=33554432]="SHOPRUNNER",e[e.ABANDONED_CART=67108864]="ABANDONED_CART",e[e.SHOPRUNNER_CONFIRMATION=134217728]="SHOPRUNNER_CONFIRMATION",e[e.OUT_OF_STOCK=268435456]="OUT_OF_STOCK",e[e.GROCERY_ITEMIZED_CASHBACK_LANDING=536870912]="GROCERY_ITEMIZED_CASHBACK_LANDING",e[e.SPB_CASHBACK_LANDING=1073741824]="SPB_CASHBACK_LANDING",e[e.MIN_VALUE=0]="MIN_VALUE",e[e.MAX_VALUE=1073741824]="MAX_VALUE",e}({})},12265:function(e,t,o){o.d(t,{VS:function(){return a},_N:function(){return n},hB:function(){return i},qx:function(){return r}});let i=function(e){return e.Storewide="Storewide",e.PCBStorewide="PCBStorewide",e.SPBSearchCashback="SPBSearchCashback",e.SPBPDPCashback="SpbPdpCashback",e.StorewideCashbackPinterest="StorewideCashbackPinterest",e.SPBorPPCashback="SPBorPPCashback",e}({}),r=function(e){return e.NonRebateUser="NotRebateUser",e.LinkableAAD="LinkableAAD",e.LinkedAAD="LinkedAAD",e.NotEnrollledUser="NotEnrollledUser",e.Rebate="Rebate",e}({}),a=function(e){return e.Activated="Activated",e.Activating="Activating",e.Failed="Failed",e.FetchUserInfoFailed="FetchUserInfoFailed",e.NonActivated="NonActivated",e}({}),n=function(e){return e[e.NOT_ENABLED=0]="NOT_ENABLED",e[e.NON_PURCHASE_OR_CHECKOUT_PAGE=1]="NON_PURCHASE_OR_CHECKOUT_PAGE",e[e.EXTRACTION_SUCCESSFULL=2]="EXTRACTION_SUCCESSFULL",e[e.EXTRACTION_SUCCESSFULL_BUT_MISSING_FIELDS=3]="EXTRACTION_SUCCESSFULL_BUT_MISSING_FIELDS",e[e.FAILED_TO_EXTRACT_DATA=4]="FAILED_TO_EXTRACT_DATA",e[e.SELECTORS_ABSENT=5]="SELECTORS_ABSENT",e[e.CACHED_CART_DATA_NOT_SENT=6]="CACHED_CART_DATA_NOT_SENT",e[e.PURCHASE_ALREADY_RECORDED=7]="PURCHASE_ALREADY_RECORDED",e[e.CONFIRMATION_LOG_NOT_ENABLED=8]="CONFIRMATION_LOG_NOT_ENABLED",e[e.UNKNOWN_ERROR=9]="UNKNOWN_ERROR",e[e.LOG_ONLY=10]="LOG_ONLY",e}({})},55590:function(e,t,o){o.d(t,{Q:function(){return i}});let i=function(e){return e.ICLastAutoShowTime="ICLastAutoShowTime",e.ICNotificationType="ICNotificationType",e.ICIsRelatedOffer="ICIsRelatedOffer",e.ICMetadata="ICMetadata",e.ICCurrentPageInfo="ICCurrentPageInfo",e.GroceryCashbackItem="GroceryCashbackItem",e.GroceryCashbackActivated="GroceryCashbackActivated",e.GroceryAutoShowData="GroceryAutoShowData",e.GroceryCategoryAutoShowData="GroceryCategoryAutoShowData",e.ICRelatedPDPOffer="ICRelatedPDPOffer",e.ICActivationMigrationPending="ActivationMigrationPending",e.ICActivatedPending="ICActivatedPending",e.ICActivatedCashbackTotal="ActivatedCashbackTotal",e.ICActivatedCashbackImages="ActivatedCashbackImages",e.ICConfirmationPending="ICConfirmationPending",e.ICConfirmationCompleted="ICConfirmationCompleted",e.AutoClipData="AutoClipData",e.ICPendingTransaction="ICPendingTransaction",e.ICAutoShownOffers="ICAutoShownOffers",e.AutosMarketplace="AutosMarketplace",e.AutosMarketplaceNotification="AutosMarketplaceNotification",e.InboxCouponsGetAllCouponsResponseCache="InboxCouponsGetAllCouponsResponseCache",e.InboxCouponsAuthTokenKeyPrefix="InboxCouponsAuthToken|",e.InboxCouponsUserEmailsStatus="InboxCouponsUserEmailsStatus",e.InboxCouponsUserEmailsStatusCache="InboxCouponsUserEmailsStatusCache",e.InboxCouponsEdgeSignInStarted="InboxCouponsEdgeSignInStarted",e.InboxCouponsEdgeSignInSuccess="InboxCouponsEdgeSignInSuccess",e.InboxCouponsHashedUserId="InboxCouponsHashedUserId",e.InboxCouponsUserHashedEmail="InboxCouponsUserHashedEmail",e.InboxCouponsLogsMetadata="InboxCouponsLogsMetadata",e.InboxCouponsPaneOpen="InboxCouponsPaneOpen",e.TrendingCouponsData="TrendingCouponsData",e.PersonalizationContextCanPrompt="LoadTimePersonalizationContextPrompt",e.ReceiptScannerBannerImpressionIds="ReceiptScannerBannerImpressionIds",e.ReceiptScannerDealImpressionIds="ReceiptScannerDealImpressionIds",e.ReceiptScannerDealClicked="ReceiptScannerDealClicked",e.ICIsPendingTransactionPresent="ICIsPendingTransactionPresent",e.IsEntrolledInDealDaysNotifications="IsEntrolledInDealDaysNotifications",e.GroceryInstantAddToCart="GroceryInstantAddToCart",e.GroceryInstantAddToCartSpb="GroceryInstantAddToCartSpb",e.GroceryCheckoutPageOffersSpb="GroceryCheckoutPageOffersSpb",e.GroceryMatchedCartSpbOffers="GroceryMatchedCartSpbOffers",e.PackageTrackingConfirmationNotifLastShown="PackageTrackingConfirmationNotifLastShown",e.PackageTrackingUXOrderMetadata="PackageTrackingUXOrderMetadata",e.PcbNotificationLastShownAdCount="PcbNotificationLastShownAdCount",e.PersistentCartData="PersistentCartData",e.CartValues="CartValues",e.PersistentWinCartData="PersistentWinCartData",e.ValidCartsToSync="ValidCartsToSync",e.UnprocessedWinCartItems="UnprocessedWinCartItems",e.ProductCollectionBannerLastShown="ProductCollection/BannerLastShown",e.ProductTrackingOOSLastShown="ProductTrackingOOSLastShown",e.ProductTrackingTrackedProducts="productTrackingData",e.ProductTrackingOOSData="ProductTrackingData",e.ProductTrackingUrlProductCache="ProductTracking/UrlProductCache",e.ProductTrackingConsentStatus="ProductTracking/ConsentStatus",e.ProductTrackingAnidData="ProductTracking/AnidData",e.ClearedWinCarts="ClearedWinCarts",e.SidepaneCashback="SidepaneCashback",e.PaneOpenMicroNotificationPopupOrigination="PaneOpenMicroNotificationPopupOrigination",e.ProductBestCouponConsent="ProductBestCouponConsent",e.PackagesNotified="PackagesNotified",e.ValidPackage="ValidPackage",e.ProductBestCoupon="ProductBestCoupon",e.DealsForTopDomainsTimestamp="DealsForTopDomainsTimestamp",e.BestCoupons="BestCoupons",e.CashbackInfo="CashbackInfo",e.PCBStorewideAddressBar="PCBStorewideAddressBar",e.PCBStorewideAddressBarLastRequested="PCBStorewideAddressBarLastRequested",e.ICSpbHomePageShownTimestamp="ICSpbHomePageShownTimestamp",e.ICSpbExpiryNotificationShownTime="ICSpbExpiryNotificationShownTime",e.UserAnid="userAnid",e.ShippingFee="ShippingFee",e.InboxCouponsUserConsented="UserConsentedInboxCoupon",e.CartPageCashbackNotification="CartPageCashbackNotification",e.PriceMatchConsent="PriceMatchConsent",e.AmazonSearchPCBOffer="AmazonSearchPCBOffer",e.UnsuccessfulAutoApplyCount="UnsuccessfulAutoApplyCount",e.ShoppingTripsData="CashbackShoppingTripsData",e.InboxCouponsAAFailureUpsellTriggeredV2="InboxCouponsAAFailureUpsellTriggeredV2",e.InboxCouponsAASuccessUpsellTriggeredV2="InboxCouponsAASuccessUpsellTriggeredV2",e.ShoppingTripsActivateRebateDomain="ShoppingTripsActivateRebateDomain",e.ProductTrackingBackInStockValidationData="ProductTracking/BackInStockValidationData",e.ProductTrackingPriceDropValidationData="ProductTracking/PriceDropValidationData",e.PostPurchasePendingProducts="PostPurchasePendingProducts",e.PostPurchasePathnameProducts="PostPurchasePathnameProducts",e.TravelCheaperFlightData="TravelCheaperFlightData",e.TravelCheaperHotelData="TravelCheaperHotelData",e.IsNavigatedFromAddressBarPersonalizedCashback="IsNavigatedFromAddressBarPersonalizedCashback",e.IsNavigatedFromAddressBarCashback="IsNavigatedFromAddressBarCashback",e.IsNavigatedFromAddressBarCoupons="IsNavigatedFromAddressBarCoupons",e.PersonalizedPromotionsCartData="PersonalizedPromotionsCartData",e.AutoActivatedSpbOffer="AutoActivatedSpbOffer",e.ArticlesCashback="ArticlesCashback",e.ShorelineSpbOffers="ShorelineSpbOffers",e.PriceMatchNotification="PriceMatchNotification",e.BGAABestCouponResult="BGAABestCouponResult",e.BGAAApplyButtonClicked="BGAAApplyButtonClicked",e.ExclusiveCouponConsent="ExclusiveCouponConsent",e.BlossomCampaignUserStatus="BlossomCampaignUserStatus",e.BlossomCampaignUserStatusTimestamp="BlossomCampaignUserStatusTimestamp",e.BlossomShouldShowNotification="BlossomShouldShowNotification",e.BlossomShouldShowPostPurchaseUX="BlossomShouldShowPostPurchaseUX",e.PostPurchaseRewardsData="PostPurchaseRewardsData",e.CheckoutPageNavigatedTime="CheckoutPageNavigatedTime",e.DynamicTransactionId="DynamicTransactionId",e.PurchaseCart="PurchaseCart",e.ShouldOpenOfferDetails="ShouldOpenOfferDetails",e}({})},18491:function(e,t,o){o.d(t,{x:function(){return i}});let i=function(e){return e.Search="search",e.Category="category",e.Offers="offers",e.SearchInPane="searchpane",e.SearchInPaneMain="searchpaneMain",e.CategoryInPane="categorypane",e.OnShorelineOpen="onShorelineOpen",e}({})},96658:function(e,t,o){o.d(t,{r:function(){return i}});let i=function(e){return e.ActivateCashbackCTA="ActivateCashbackCTA",e.AutosMarketplaceOffers="AutosMarketplaceOffers",e.BlackFridayOffers="BlackFridayOffers",e.CyberMondayOffers="CyberMondayOffers",e.ThanksgivingOffers="ThanksgivingOffers",e.HolidaySeasonOffers="HolidaySeasonOffers",e.NewYearOffers="NewYearOffers",e.ValentinesOffers="ValentinesOffers",e}({})},56372:function(e,t,o){var i=o(72370),r=o(4872),a=o(31656),n=o(47594),s=o(5144),c=o(21597),l=o(87720),u=o(3141),d=o(73557),h=o(29247),p=o(33491),g=o(27689);t.Z=class{constructor(){(0,i.Z)(this,"autoOpenPrefData",void 0),(0,i.Z)(this,"autoOpenDomainPrefData",void 0),(0,i.Z)(this,"genericDataStore",new Map),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"currentPath",void 0),(0,i.Z)(this,"impressionId",void 0),(0,i.Z)(this,"autoOpenDataStr",void 0),(0,i.Z)(this,"lastCleanedDataStr",void 0),(0,i.Z)(this,"autoOpenPrefDataStr",void 0),(0,i.Z)(this,"autoOpenDomainPrefDataStr",void 0),(0,i.Z)(this,"lastShownDataStr",void 0),(0,i.Z)(this,"stageAndCategoryLastShownStr",void 0),(0,i.Z)(this,"totalPrice",void 0),(0,i.Z)(this,"sendErrorMessage",void 0),(0,i.Z)(this,"sendStorageMessage",void 0),(0,i.Z)(this,"domainData",void 0),(0,i.Z)(this,"autoOpenData",void 0),(0,i.Z)(this,"lastCleanedData",void 0),(0,i.Z)(this,"lastShownData",void 0),(0,i.Z)(this,"stageAndCategoryLastShown",void 0),(0,i.Z)(this,"caller",void 0)}initCommonInfo(e,t,o,i){this.impressionId=e,this.domainName=t,this.currentPath=o,this.caller=i}isPopupOriginationUnblocked(e,t){if(!this.autoOpenDataStr)return!0;if(this.domainData){if(!this.checkBlockedList(this.domainData.blockedList,e))return t&&(t.Reason="Popup origination blocked due to domain"),!1;if(!this.shouldBlockForDomain(e))try{return!!this.isPopupOriginationUnblockedForPath(e)||(t&&(t.Reason="Popup origination blocked due to path"),!1)}catch(e){return this.sendErrorMessageHandler(":::AOC - "+e),!0}return!0}return!0}isPopupOriginationUnblockedForPath(e){if(!this.domainData)return!0;this.domainData.paths.get(this.currentPath)||this.domainData.paths.set(this.currentPath,new u.Z);const t=this.domainData.paths.get(this.currentPath);return t?this.checkBlockedList(t.blockedListPath,e):(this.sendErrorMessageHandler(":::AOC - pathData undefined"),!0)}setTotalPrice(e){this.totalPrice=e}getNumberParameter(e,t){return e&&e.length>t?parseInt(e[t],10):null}getStringParameter(e,t){return e&&e.length>t?e[t]:""}doesGroupHaveEnum(e,t){return!!(e&1<<t)}cleanLocalStorage(){try{this.lastCleanedData||(this.lastCleanedData=new Map),this.autoOpenData.forEach(((e,t)=>{const o=this.lastCleanedData.get(t);if(!o){this.lastCleanedData.set(t,Date.now());const e=JSON.stringify(this.lastCleanedData,h.ZP.StringifyMap);return void this.sendStorageMessage(l.Gr,JSON.stringify({value:e}))}if(void 0!==o&&Date.now()-o<l.Zs)return;let i=!1,r=!1;const a=e;if(a.blockedList&&a.blockedList.length>0){const e=a.blockedList,t=this.cleanList(e);t&&t.length>0?(i=!0,a.blockedList=t):a.blockedList=[]}if(a.paths&&a.paths.forEach(((e,t)=>{if(e){const o=e.blockedListPath,i=this.cleanList(o);i&&i.length>0?(r=!0,e.blockedListPath=i,a.paths.set(t,e)):a.paths.delete(t)}})),r||i){this.autoOpenData.set(t,a),this.lastCleanedData.set(t,Date.now());const e=JSON.stringify(this.lastCleanedData,h.ZP.StringifyMap);this.sendStorageMessage(l.Gr,JSON.stringify({value:e}))}else this.autoOpenData.delete(t)}));const e=JSON.stringify({value:JSON.stringify(this.autoOpenData,h.ZP.StringifyMap)});this.sendStorageMessage(l.Q5,e)}catch(e){this.sendErrorMessage(this.impressionId,":::AOC -"+e)}}getSnoozeTime(e,t){return e.snoozeTime?e.snoozeTime:this.shouldBlockForDomain(e.popupOrigination)?e.popupOrigination===d.sR.AUTO_SHOW_COUPONS_CHECKOUT?e.totalPrice&&this.totalPrice&&e.totalPrice!==this.totalPrice&&!t&&!e.blockedForSite?-1:288e5:e.popupOrigination===d.sR.AUTO_SHOW_GIFT_CARD?6048e5:e.popupOrigination===d.sR.AUTO_SHOW_AUTOS_MARKETPLACE?6e5:e.popupOrigination===d.sR.AUTO_SHOW_CASHBACK_PDP_PLUS_COUPONS?864e5:e.popupOrigination===d.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_ADDRESSBAR?6e4:e.popupOrigination===d.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY?a.R.isExperimentActive(r.H.bgaaNoSnoozeTime)?1e3:288e5:e.popupOrigination===d.sR.AUTO_SHOW_POST_PURCHASE_REWARDS_NOTIFICATION?1e3:e.popupOrigination===d.sR.AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_FLIGHTS?648e5:864e5:this.shouldBlockForPath(e.popupOrigination)?e.popupOrigination===d.sR.AUTO_SHOW_PERSONALIZED_CASHBACK?6e5:e.popupOrigination===d.sR.AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_HOTEL_ROOM?12e5:864e5:-1}shouldBlockForPath(e){return!![d.sR.AUTO_SHOW_LOWER_PRICE_FOUND,d.sR.AUTO_SHOW_PRICE_HISTORY,d.sR.AUTO_SHOW_PERSONALIZED_CASHBACK,d.sR.AUTO_SHOW_COUPONS_CLIPPING,d.sR.AUTO_SHOW_OTHER_SELLERS,d.sR.AUTO_SHOW_ITEM_ADDED_TO_CART_FROM_OTHER_SELLER,d.sR.AUTO_SHOW_PROFESSIONAL_REVIEWS,d.sR.AUTO_SHOW_BING_CAMPAIGN,d.sR.AUTO_SHOW_GUEST_DOMAIN_COUPONS,d.sR.AUTO_SHOW_SOCIAL_COUPONS,d.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK,d.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING,d.sR.AUTO_SHOW_SPB_CASHBACK_LANDING,d.sR.AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION,d.sR.HOVER_BUTTON_SHOW_FLYOUT,d.sR.CJK_OPEN_HUB_ICON,d.sR.AUTO_SHOW_REBATES_PDP,d.sR.AUTO_SHOW_CAMPAIGN_PDP_NOTIFICATION,d.sR.AUTO_SHOW_PRICE_DROP_PLUS_CASHBACK,d.sR.AUTO_SHOW_AMAZON_SEARCH_PC,d.sR.AUTO_SHOW_LOWER_PRICE_PLUS_CASHBACK_PLUS_COUPONS,d.sR.AUTO_PRODUCT_TRACKING_OUT_OF_STOCK,d.sR.AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_FLIGHTS,d.sR.AUTO_SHOW_TRAVEL_NOTIFICATION_CHEAPER_HOTEL_ROOM].includes(e)}shouldBlockForDomain(e){return!![d.sR.AUTO_SHOW_COUPONS_CHECKOUT,d.sR.AUTO_SHOW_GIFT_CARD,d.sR.AUTO_SHOW_REBATES,d.sR.AUTO_SHOW_REBATES_CHECKOUT,d.sR.AUTO_SHOW_REBATES_ORGANIC,d.sR.AUTO_SHOW_REBATES_ORGANIC_NEW,d.sR.AUTO_SHOW_AUTOS_MARKETPLACE,d.sR.AUTO_SHOW_CASHBACK_PDP_PLUS_COUPONS,d.sR.AUTO_SHOW_PRODUCT_BEST_COUPON_CONSENT,d.sR.AUTO_SHOW_BING_SEARCH,d.sR.AUTO_SHOW_EXPRESS_CHECKOUT,d.sR.AUTO_SHOW_VIRTUAL_CARD,d.sR.AUTO_SHOW_PACKAGE_TRACKING,d.sR.OPEN_FLYOUT_FROM_EDGE_DRIVER_EC,d.sR.AUTO_SHOW_SUSTAINABILITY_LANDING,d.sR.AUTO_SHOW_SUSTAINABILITY_PURCHASE,d.sR.AUTO_SHOW_ATTAINABLE_COUPONS,d.sR.AA_CONSENT,d.sR.AUTO_SHOW_SAN_CONSENT_CONFIRMATION,d.sR.AUTO_SHOW_MOMENT_IN_TIME,d.sR.AUTO_SHOW_SERVER_DRIVEN_REWARDS,d.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_ADDRESSBAR,d.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY,d.sR.AUTO_SHOW_CJK_COUPON_FOUND,d.sR.AUTO_SHOW_CJK_PRICE_DROP,d.sR.AUTO_SHOW_POST_PURCHASE_REWARDS_NOTIFICATION].includes(e)}reEnabledPopupOriginationForLostUser(e,t,o){return!(![d.sR.AUTO_SHOW_PERSONALIZED_CASHBACK,d.sR.AUTO_SHOW_REBATES,d.sR.AUTO_SHOW_LOWER_PRICE_FOUND,d.sR.AUTO_SHOW_PRICE_HISTORY,d.sR.AUTO_SHOW_COUPONS_CHECKOUT,d.sR.AUTO_SHOW_COUPONS_CLIPPING].includes(e)||!this.isPopupOriginReenabledForLostUser(e,t,o))}GetMinCooldownForPopupOrigination(e){let t;switch(e){case d.sR.AUTO_SHOW_ARTICLES_CASHBACK_NOTIFICATION:t=36e5;break;case d.sR.AUTO_SHOW_CAMPAIGN_AWARENESS_NOTIFICATION:t=12096e5;break;case d.sR.AUTO_SHOW_TRENDING_COUPONS:t=2592e6;break;case d.sR.AUTO_SHOW_ABANDONED_CART:case d.sR.AUTO_SHOW_POST_PURCHASE_TRACKING:case d.sR.AUTO_SHOW_INBOX_PRICE_MATCH_NOTIFICATION:case d.sR.AUTO_SHOW_SERVER_DRIVEN_NOTIFICATION:t=864e5;break;case d.sR.AUTO_SHOW_RECOMMENDATIONS:t=432e5;break;case d.sR.AUTO_SHOW_IBC_UPSELL:t="true"===(0,p.Mw)("ibcUpsellDebug")?1e3:6048e5;break;case d.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION:case d.sR.AUTO_SHOW_REBATES_CONFIRMATION:case d.sR.AUTO_SHOW_AOC:t=36e5;break;default:t=void 0}return t}shouldBlockForStageAndCategory(e){return e===d.sR.AUTO_SHOW_DISCOVER_NOTIFICATION}initializeData(){if(this.autoOpenDataStr)try{this.autoOpenData=(0,g.BQ)(this.autoOpenDataStr,!0),this.autoOpenData&&(this.domainData=this.autoOpenData.get(this.domainName),this.domainData||(this.domainData=new c.ZP))}catch(e){this.autoOpenData=new Map,this.sendErrorMessageHandler("AutoOpenController constructor "+e+" "+this.caller);const t=JSON.stringify({value:JSON.stringify(this.autoOpenData,h.ZP.StringifyMap)});this.sendStorageMessage(l.Q5,t)}else this.autoOpenData=new Map,this.domainData=new c.ZP;if(this.lastCleanedDataStr&&"{}"!==this.lastCleanedDataStr&&(this.lastCleanedData=(0,g.BQ)(this.lastCleanedDataStr,!0)),this.autoOpenPrefDataStr)try{this.autoOpenPrefData=(0,g.BQ)(this.autoOpenPrefDataStr)}catch(e){this.autoOpenPrefData=[],this.sendErrorMessageHandler("AutoOpenController constructor auto open pref"+e),this.sendStorageMessage(l.cv,JSON.stringify({value:null}))}else this.autoOpenPrefData=[];if(this.autoOpenDomainPrefDataStr)try{this.autoOpenDomainPrefData=(0,g.BQ)(this.autoOpenDomainPrefDataStr,!0)}catch(e){this.sendErrorMessageHandler("AutoOpenController constructor auto open domain pref"+e),this.sendStorageMessage(l.Sk,JSON.stringify({value:null}))}if(this.lastShownDataStr)try{this.lastShownData=(0,g.BQ)(this.lastShownDataStr,!0)}catch(e){this.sendErrorMessageHandler("AutoOpenController constructor last shown data"+e),this.sendStorageMessage(l.n1,JSON.stringify({value:null}))}else this.lastShownData=new Map;if(this.stageAndCategoryLastShownStr)try{this.stageAndCategoryLastShown=(0,g.BQ)(this.stageAndCategoryLastShownStr,!0)}catch(e){this.sendErrorMessageHandler("AutoOpenController constructor stage and category last shown "+e),this.sendStorageMessage(l.z0,JSON.stringify({value:null}))}else this.stageAndCategoryLastShown=new Map}writeSimilarSellers(e,t){this.sendStorageMessage(e,t)}isPopupOriginReenabledForLostUser(e,t,o){const i=t?.find((t=>t.popupOrigination===e));if(void 0===i)return!1;const r=new Date;return!(o.lostUserReblockedTime&&(r.getTime()-o.lostUserReblockedTime)/864e5<3)}writeToList(e,t,o){if(this.domainData){if(this.shouldBlockForDomain(t)||o){if(this.domainData.blockedList=e,t===d.sR.AUTO_SHOW_COUPONS_CHECKOUT&&this.totalPrice){const e=this.domainData.blockedList.findIndex((e=>e.popupOrigination===d.sR.AUTO_SHOW_COUPONS_CHECKOUT));-1!==e&&(this.domainData.blockedList[e].totalPrice=this.totalPrice)}}else{let t=this.domainData.paths.get(this.currentPath);t||(t=new u.Z),t.blockedListPath=e,this.domainData.paths.set(this.currentPath,t)}this.autoOpenData.set(this.domainName,this.domainData);const i=JSON.stringify({value:JSON.stringify(this.autoOpenData,h.ZP.StringifyMap)});this.sendStorageMessage(l.Q5,i)}}checkBlockedList(e,t){let o=-1;if(e&&(o=e?.findIndex((e=>e.popupOrigination===t))),-1!==o&&e){const i=e[o],r=Date.now();let s=this.getSnoozeTime(i,!1);if((t===d.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK&&a.R.isTestFlagActive(n.t.msShoppingTestExp10)||t===d.sR.AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION)&&(s=-1),-1===s&&!i.blockedForSite){const o=e.filter((e=>e.popupOrigination!==t));return this.writeToList(o,t,!1),!0}return r-i.timeLastAutoOpen>=s&&!i.blockedForSite}return!0}sendErrorMessageHandler(e){this.caller===s.G7.Flyout||this.caller===s.G7.Driver?this.sendErrorMessage(e):this.sendErrorMessage(this.impressionId,e)}cleanList(e){let t=[];if(e&&e.length>0){const o=[];e.forEach((e=>{Date.now()-e.timeLastAutoOpen>=this.getSnoozeTime(e,!0)&&o.push(e.popupOrigination)})),t=e.filter((e=>!o.includes(e.popupOrigination)))}return t}}},71455:function(e,t,o){o.d(t,{a:function(){return i}}),o(95016);let i=function(e){return e.AutosMarketplaceString="AutosMarketplace_",e.AutosReviewString="AutosReview_",e.AutosMyGarageString="MyGarage_",e.AutosGlobalCoolDownString="AutosLastNotification",e}({})},29247:function(e,t,o){o.d(t,{BX:function(){return s},Nx:function(){return n},UE:function(){return u},VJ:function(){return d},_R:function(){return a},dz:function(){return c},w:function(){return l}});var i=o(3634),r=o(33491);function a(e){return new Promise((t=>setTimeout(t,e)))}function n(e){return"true"===e||!0===e}function s(e,t){return"object"==typeof t&&null!==t&&"Map"===t.dataType?new Map(t.value):t}async function c(e,t,o){const i=(new Date).getTime();for(;!await e()&&i+t>(new Date).getTime();)await a(o??100);return await e()}async function l(e,t){const o=(new Date).getTime();for(;o+t>(new Date).getTime();){if(e())return!0;await a(100)}return!1}function u(e){return null!=e&&e.length>0&&"null"!==e}function d(e,t,o,i){let r=!1;if(u(e)&&(r=function(e,t){if(u(e)){const o=e.toLowerCase().replace(/\s+/g,"").split(","),i=t.toLowerCase();let r=!1;for(const e of o)if(i.indexOf(e)>=0){r=!0;break}return r}return!1}(e,o)),u(t))try{!i&&location.href?.toLocaleLowerCase()?.includes(o.toLocaleLowerCase())&&"chrome-untrusted://shopping/"!==location.href&&(i=location.href?.toLocaleLowerCase()),r=function(e,t){return!!u(e)&&new RegExp(e).test(t.toLowerCase())}(t,i??o)}catch{}return r}class h{static Sleep(e){return new Promise((t=>setTimeout(t,e)))}static StringifyMap(e,t){return t instanceof Map?{dataType:"Map",value:Array.from(t.entries())}:t}static parseBool(e){return"true"===e||!0===e}static ParseMap(e,t){return"object"==typeof t&&null!==t&&"Map"===t.dataType?new Map(t.value):t}static async WaitForCondition(e,t,o){const i=(new Date).getTime();for(;!await e()&&i+t>(new Date).getTime();)await h.Sleep(o??100);return await e()}static async WaitUntilCondition(e,t){const o=(new Date).getTime();for(;o+t>(new Date).getTime();){if(await e())return!0;await h.Sleep(100)}return!1}static async WaitForSyncCondition(e,t){const o=(new Date).getTime();for(;o+t>(new Date).getTime();){if(e())return!0;await h.Sleep(100)}return!1}static IsValidDataField(e){return null!=e&&e.length>0&&"null"!==e}static IsPageMatch(e,t,o,i){let r=!1;if(h.IsValidDataField(e)&&(r=h.IsOnPage(e,o)),h.IsValidDataField(t))try{!i&&location.href?.toLocaleLowerCase()?.includes(o.toLocaleLowerCase())&&"chrome-untrusted://shopping/"!==location.href&&(i=location.href?.toLocaleLowerCase()),r=h.IsPageRegexMatch(t,i??o)}catch{}return r}static IsPageRegexMatch(e,t){return!!h.IsValidDataField(e)&&new RegExp(e).test(t.toLowerCase())}static IsOnPage(e,t){if(h.IsValidDataField(e)){const o=e.toLowerCase().replace(/\s+/g,"").split(","),i=t.toLowerCase();let r=!1;for(const e of o)if(i.indexOf(e)>=0){r=!0;break}return r}return!1}static ObserveUntil(e,t){const o=new MutationObserver((async()=>{e()&&(o.disconnect(),t())}));o.observe(document.body,{attributeFilter:["offsetWidth","offsetHeight"],childList:!0,subtree:!0})}static async MeasureExecutionTime(e,t){const o=performance.now();return await e(),performance.now()-o}static DeepAssign(e,t){return Object.keys(t).forEach((o=>{if("object"==typeof t[o])e[o]||Object.assign(e,{[o]:{}}),h.DeepAssign(e[o],t[o]);else{let i=t[o];"urlRegex"===o&&"string"==typeof i&&i.endsWith("/")&&(i=i.substring(0,i.length-1)),Object.assign(e,{[o]:i})}})),e}static scrollToModuleIfTargeted(e,t){(0,r.Mw)(i.uv)===t&&setTimeout((()=>{e?.scrollIntoView({behavior:"smooth",block:"start"}),localStorage.removeItem(i.uv)}),500)}}t.ZP=h},56854:function(e,t,o){o.d(t,{r:function(){return a}});var i=o(4872),r=o(31656);function a(){return r.R.isExperimentActive(i.H.bgaaUx)||r.R.isExperimentActive(i.H.bgaaCheckoutOld)||r.R.isExperimentActive(i.H.bgaaNonCheckoutOld)}},18435:function(e,t){t.Z=class{static IsOnCheckoutPage(e,t){return!(!t||!t.retailerData)&&t.retailerData.UpdateCurrentCheckoutPage(e)}static getQuantity(e,t){let o=t.querySelector(e);o||(o=t?.parentElement?.querySelector(e));const i=o?.innerText?.trim();let r=Number(i);try{if(isNaN(r)||0===r)if(["select","input"].includes(o?.nodeName.toLowerCase())){const o=t.querySelector(e);r=Number(o.value)}else{const e=/[-]{0,1}[\d]*[.]{0,1}[\d]+/g,t=o?.innerText?.trim().match(e);t&&t?.length>0&&(r=Number(t[0]))}}catch(e){r=-1}return isNaN(r)&&(r=-1),r}static isElementDisabled(e){return"disabled"===e.getAttribute("disabled")}}},50616:function(e,t,o){var i=o(36493);t.Z=class{static getInitialPrice(e){if(e)return(0,i.K)(e)}static getAmazonClippingDiscount(e,t){let o;if(t&&e){const r=t.substring(t.search(/\d+/g)),a=r.search(/\s|%/);let n=r;-1!==a&&(n=r.substring(0,a)),o=(0,i.K)(n),t.search(/%/)>0&&(o=e*o/100)}return o}static getSimpleDomainName(e){let t;if(e?.length>0){const o=e.indexOf(".");o>0&&(t=e.charAt(0).toUpperCase()+e.substring(1,o))}return t}}},71544:function(e,t,o){var i=o(72370),r=o(4872),a=o(31656),n=o(14732),s=o(5144);class c{static GetBuildVersion(){try{const e=navigator.userAgent.match(/Edg(?:A|iOS)?\/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/);if(e&&2===e.length)return e[1];throw Error("Invalid build version.")}catch(e){}}static IsBuildVersionSupported(e){const t=c.GetBuildVersion();if(void 0===t)return!1;const o=c.CompareBuildVersions(t,e);return void 0!==o&&o>=0}static CompareBuildVersions(e,t){if(e&&t){const o=e.split("."),i=t.split(".");if(4!==o.length||4!==i.length)return;for(let e=0;e<4;e++){const t=parseInt(o[e],10),r=parseInt(i[e],10);if(isNaN(t)||isNaN(r))return;if(t>r)return 1;if(r>t)return-1}return 0}}static IsOtherSellersExpActive(e){return"walmart.com"===e||a.R.isExperimentActive(r.H.showAmazonOtherSellers)}static GetClientName(){try{if(-1!==navigator.userAgent.toLowerCase().indexOf("android"))return s.BN.EdgeAndroid;if(/iPad|iPhone|iPod/.test(navigator.userAgent))return s.BN.EdgeiOS}catch(e){throw Error("Error getting client name")}return n.i.GetAppName()}static IsMobile(){return[s.BN.EdgeAndroid,s.BN.EdgeiOS].includes(c.GetClientName())}}(0,i.Z)(c,"enabledServiceFlights",""),t.Z=c},45822:function(e,t,o){o.d(t,{$1:function(){return l},Ak:function(){return u},I2:function(){return g},P4:function(){return c},dQ:function(){return h},hy:function(){return n},io:function(){return d},nY:function(){return s},p_:function(){return C}});var i=o(4872),r=o(31656),a=o(5144);const n=e=>!!r.R.isExperimentActive(i.H.purchaseExtractionRefactor)||!("True"!==e?.retailerData?.settings?.other?.isPurchaseRefactorExpEnabled);function s(){return r.R.isExperimentActive(i.H.fragmentPageTypeFiltering)}function c(){return r.R.isExperimentActive(i.H.collectAllFragments)}function l(){return r.R.isExperimentActive(i.H.disablePageTypeCollectionForFragments)}function u(e){return!e||function(e){return![a.GV.HomePage,a.GV.SearchPage,a.GV.ProductPage].includes(e)}(e)}const d=(e,t)=>!(!e||!t)&&(t=(t=(t="("+t.toLowerCase()+")").replace(",","|")).replace("/","/"),new RegExp(t.toLowerCase()).test(e.toLowerCase())),h=(e,t,o)=>p(e,t,o)?a.GV.HomePage:a.GV.UnknownPage,p=(e,t,o)=>{if(e&&t){const i=e.endsWith(t)||e.endsWith(`${t}/`);if(i)return i;if(o)return e.endsWith(`${t}/${o}`)||e.endsWith(`${t}/${o}/`)}return!1},g=(e,t)=>{try{if(e.length>0&&t)for(const o of e)if(o.urlRegex&&d(t,o.urlRegex))return o.type===a.u3.PurchaseConfirmed?a.GV.ConfirmationPage:o.type===a.u3.Checkout?a.GV.CheckoutPage:a.GV.UnknownPage;return a.GV.UnknownPage}catch(e){return a.GV.UnknownPage}},C=(e,t)=>e?.orderConfirmationPageUrl&&d(t,e.orderConfirmationPageUrl)?a.GV.ConfirmationPage:e?.checkoutPageUrl&&d(t,e.checkoutPageUrl)?a.GV.CheckoutPage:e?.productPageUrlRegex&&d(t,e.productPageUrlRegex)||e?.productPageUrl&&d(t,e.productPageUrl)?a.GV.ProductPage:e?.searchQueryUrlRegex&&d(t,e.searchQueryUrlRegex)?a.GV.SearchPage:a.GV.UnknownPage},64641:function(e,t,o){o.d(t,{C9:function(){return n},kU:function(){return r},u3:function(){return s}});var i=o(27689);const r=(e,t)=>"amazon.com"===t?a(e,"purchaseId"):"walmart.com"===t?a(e,"pcid"):"target.com"===t?a(e,"orderId"):"",a=(e,t)=>{const o=e.split("?"),i=o.length>1?o[1].split("&"):[];let r="";return i.forEach((e=>{const o=e.split("=");2===o.length&&o[0]===t&&(r=o[1])})),r},n=(e,t)=>{const o=(0,i.BQ)(e)??void 0,r=o?o[t]:void 0;return r?.cartDataStorageInfo?r?.cartDataStorageInfo:void 0},s=()=>Math.round((new Date).getTime()/1e3)},12727:function(e,t,o){var i=o(72370),r=o(29247);class a{constructor(e){(0,i.Z)(this,"dao",void 0),this.dao=e}deleteSecretsInURL(e){if(!this.dao.getFeatureFlagEnabledByDefault(a.FeatureName))return e;if(!e||""===e)return"";const t=this.dao.getDataMaskRules();try{if(t&&t.length>0){const o=new URL(e),i=new URLSearchParams(o.search);let n=o.toString();for(const e of t)e.maskType===a.RemoverUrlParameter&&(i.delete(e.ruleValue),o.search=i.toString(),n=o.toString());return r.ZP.IsValidDataField(n)?n:e}}catch(t){return e}return e}getCurrentUrlValue(e,t){if(!e)return t;return this.deleteSecretsInURL(t)||""}maskDataInAString(e){if(!this.dao.getFeatureFlagEnabledByDefault(a.FeatureName))return e||"";if(!e||""===e)return"";const t=this.dao.getDataMaskRules();if(t){let o=e;for(const e of t)e.maskType===a.RegexMaskRule&&(o=o.replace(new RegExp(e.ruleValue),e.ruleName));return o}return e||""}maskDataInADocument(e){if(!this.dao.getFeatureFlagEnabledByDefault(a.FeatureName))return;if(!e)return;const t=this.dao.getDataMaskRules();if(t)for(const o of t)if(o.maskType===a.RemoveAllBySelector){const t=e.querySelectorAll(o.ruleValue);for(const e of t)e.innerHTML=o.ruleName}else if(o.maskType===a.RemoveFirstBySelector){const t=e.querySelector(o.ruleValue);t&&(t.innerHTML=o.ruleName)}}}(0,i.Z)(a,"RegexMaskRule","REGEX"),(0,i.Z)(a,"RemoverUrlParameter","REMOVE_URL_PARAMETER"),(0,i.Z)(a,"FeatureName","data_masking"),(0,i.Z)(a,"RemoveFirstBySelector","REMOVE_FIRST_BY_SELCTOR"),(0,i.Z)(a,"RemoveAllBySelector","REMOVE_ALL_BY_SELECTOR"),t.Z=a},57550:function(e,t,o){o.d(t,{Sq:function(){return r},rP:function(){return a},wu:function(){return n},xJ:function(){return l}});var i=o(75434);function r(e){let t=[];return e&&e.itemizedCashBackResponse&&e.itemizedCashBackResponse.offers&&e.itemizedCashBackResponse.offers.length>0&&(t=e.itemizedCashBackResponse.offers),t}function a(e,t){if(!t||!e)return e;const o=new Set,i=new Set,r=new Set;!function(e,t,o,i){const r=Date.now();i.adsCashback?.forEach((i=>{if(!(r>1e3*i.expireTimeEpoch)&&(i.globalOfferId&&o.add(i.globalOfferId),i.destinationUrl)){const o=s(c(i.destinationUrl));o&&(t.add(o.pathname),e.add(o))}}))}(o,r,i,t);const a=function(e,t,o,i){return e.filter((e=>{if(e.pathname)return!i.has(e.pathname);const t=s(c(e.adsOffer.destinationUrl));return!t||!i.has(t.pathname)}))}(e,0,0,r);return a}function n(e){return e?.itemizedCashBackResponse?.adsMetadata?.visibilityFeedbackUrl||""}function s(e){try{if(!e)return;return new URL(c(e))}catch(t){(0,i.F0)(void 0,void 0,"Error in GetUrl for "+e,t)}}function c(e){if(!e)return"";let t=e;if(e.includes("&l1=")){const o=e.split("&l1=");o.length>1&&(t=o[1])}else if(e.includes("dest_url=")){const o=e.split("dest_url=");o.length>1&&(t=o[1])}return t}function l(e,t){const o={isPdp:!1,productId:""};if(t&&t.PdpData){const i=this.IsUrlMatchAll(e,t.PdpData);o.isPdp=i.isMatch,o.productId=i.matchKey}return o}},18549:function(e,t,o){o(88767),o(73557)},36493:function(e,t,o){o.d(t,{$g:function(){return c},Cl:function(){return s},K:function(){return r},N6:function(){return a},So:function(){return d},Vv:function(){return n},cU:function(){return u},qm:function(){return l}});var i=o(64865);function r(e,t){if(!e)return 0;if(e.indexOf("-")>-1){const t=e.substring(0,e.indexOf("-")),o=e.substring(e.indexOf("-")+1),i=r(t),a=r(o),n=Math.min(i,a);if(isNaN(n))return 0;e=n.toString()}e=(e=e.replace(/\([^)]*\)/g,"")).replace(/[^0-9\.,]+/g,"");try{!1===function(e,t){if("$"===t)return!0;const o=e.lastIndexOf(","),i=e.lastIndexOf(".");return!(i>-1&&o>-1&&o>i||i>-1&&e.length-i-1>2||o>-1&&e.length-o-1<=2||-1===o&&-1===i&&(e=e.trim(),/\s/.test(e)))}(e,t)&&(e=function(e){return e.replace(/[,.]/g,(e=>","===e?".":","))}(e))}catch{}return e=e.replace(/[,]+/g,""),parseFloat(e)}function a(e){return g.get(e)}function n(e){return S.get(e)}function s(e,t){return"$"===e&&"en-us"!==t||!c(e)?function(e){return e?a(e)??"$":"$"}(t):e}function c(e){return!(!e||!p)&&p.has(e)}function l(e){return C.has(e)??!1}function u(e,t){const o=e.replace(/[0-9,. ]/g,"").trim();for(const e of h)if(o.includes(e))return e;return t?function(e){return e&&!(0,i.TF)(e)&&c(e)?e:""}(o):function(e){return e&&!(0,i.TF)(e)&&c(e)?e:"$"}(o)}function d(e){return e.replace(/([^A-Za-z])/g,"\\$1")}const h=["$","₹","£","£","€","¥","¥","₽","元","₩","₱","đ","₫","฿","US$","CA$","AU$","MX$","C$","A$","R$","NZ$","COL$","NT$","£E","SG$","zł","S$","USD","INR","GBP","CAD","EUR","AUD","JPY","BRL","MXN","NZD","CNY","KRW","RUB","IDR","PHP","VND","THB","TWD","EGP","DKK","SEK","RM","MYR","AMD","CHF","PLN","NOK","SGD","CZK","TL","TRY","COP","ZAR","CLP","SAR","AED","Rp","dr.","Fr.","Kč","Rs","kr.","kr","R"],p=new Set(h),g=new Map([["en-us","$"],["en-gb","£"],["en-ca","CA$"],["en-au","AU$"],["en-in","₹"],["fr-fr","€"],["de-de","€"],["ja-jp","¥"],["it-it","€"],["nl-nl","€"],["es-es","€"],["en-nz","NZ$"],["pt-br","R$"],["zh-cn","元"],["es-mx","MX$"],["ko-kr"," ₩"],["ru-ru","₽"],["id-id","Rp"],["fil-ph","₱"],["vi-vn","đ"],["th-th","฿"],["zh-tw","NT$"],["ar-eg","EGP"],["de-at","€"],["da-dk","kr."],["de-ch","Fr."],["pl-pl","zł"],["sv-se","kr"],["en-my","RM"],["no-no","NOK"],["en-sg","S$"],["fi-fi","€"],["fr-be","€"],["cs-cz","Kč"],["tr-tr","TL"],["es-co","COL$"],["en-za","R"],["en-sa","SAR"],["en-eg","EGP"],["ar-ae","AED"]]),C=new Set(["USD","INR","GBP","EUR","NZD","BRL","CAD","AUD","JPY","CNY","MXN","KRW","RUB","IDR","PHP","VND","THB","TWD","EGP","DKK","CHF","PLN","SEK","MYR","NOK","SGD","CZK","TRY","COP","ZAR","CLP","SAR","AED"]),S=new Map([["$","USD"],["₹","INR"],["£","GBP"],["€","EUR"],["NZ$","NZD"],["R$","BRL"],["CA$","CAD"],["C$","CAD"],["A$","AUD"],["AU$","AUD"],["¥","JPY"],["¥","JPY"],["元","CNY"],["MX$","MXN"],["£","GBP"],["₩","KRW"],["₽","RUB"],["Rp","IDR"],["₱","PHP"],["đ","VND"],["₫","VND"],["฿","THB"],["NT$","TWD"],["EGP","EGP"],["kr.","DKK"],["Fr.","CHF"],["zł","PLN"],["dr.","SEK"],["RM","MYR"],["NOK","NOK"],["S$","SGD"],["Kč","CZK"],["TL","TRY"],["COL$","COP"],["R","ZAR"],["kr","DKK"],["SG$","SGD"],["SAR","SAR"],["AED","AED"],["AMD","AMD"]]);new Map([["USD","$"],["INR","₹"],["GBP","£"],["EUR","€"],["NZD","NZ$"],["BRL","R$"],["CAD","CA$"],["AUD","AU$"],["JPY","¥"],["CNY","元"],["MXN","MX$"],["GBP","£"],["KRW","₩"],["RUB","₽"],["IDR","Rp"],["PHP","₱"],["VND","đ"],["THB","฿"],["TWD","NT$"],["EGP","EGP"],["DKK","kr."],["CHF","Fr."],["PLN","zł"],["SEK","dr."],["MYR","RM"],["NOK","NOK"],["SGD","S$"],["CZK","Kč"],["TRY","TL"],["COP","COL$"],["ZAR","R"],["SAR","SAR"],["AED","AED"]])},91495:function(e,t,o){o.d(t,{Q:function(){return a}});var i=o(72370),r=o(55590);const a=new class{constructor(){(0,i.Z)(this,"rawStorageObj",{}),(0,i.Z)(this,"storageObjStr",""),(0,i.Z)(this,"ICIsPendingTransactionPresent",void 0),(0,i.Z)(this,"ICCurrentPageInfo",void 0),(0,i.Z)(this,"OtherSellersNotificationData",void 0),(0,i.Z)(this,"OtherSellersAutoShowCount",void 0),(0,i.Z)(this,"OtherSellersLastAutoShowTime",void 0),(0,i.Z)(this,"CanSaveYoutubeCoupons",void 0),(0,i.Z)(this,"SocialCoupons",void 0),(0,i.Z)(this,"IsEntrolledInDealDaysNotifications",void 0),(0,i.Z)(this,"CartValues",void 0),(0,i.Z)(this,"CompletedPurchase",void 0),(0,i.Z)(this,"CompletedPurchaseConf",void 0),(0,i.Z)(this,"GiftCardData",void 0),(0,i.Z)(this,"GroceryCashbackItem",void 0),(0,i.Z)(this,"Anid",void 0),(0,i.Z)(this,"GroceryCashbackActivated",void 0),(0,i.Z)(this,"ICRelatedPDPOffer",void 0),(0,i.Z)(this,"ICAutoShownOffers",void 0),(0,i.Z)(this,"AutoOpenData",void 0),(0,i.Z)(this,"AutoOpenPrefData",void 0),(0,i.Z)(this,"AutoOpenDomainPrefData",void 0),(0,i.Z)(this,"LastCleanedData",void 0),(0,i.Z)(this,"LastShownData",void 0),(0,i.Z)(this,"StageAndCategoryLastShown",void 0),(0,i.Z)(this,"ICLastAutoShowTime",void 0),(0,i.Z)(this,"ICMetadata",void 0),(0,i.Z)(this,"PersistentWinCartData",void 0),(0,i.Z)(this,"ICActivatedPending",void 0),(0,i.Z)(this,"PrivacyBadgeViewCount",void 0),(0,i.Z)(this,"PersistentCartData",void 0),(0,i.Z)(this,"PersonalizedPromotionsCartData",void 0),(0,i.Z)(this,"PersistentTravelData",void 0),(0,i.Z)(this,"AutoClipData",void 0),(0,i.Z)(this,"RuleBasedTriggerData",void 0),(0,i.Z)(this,"ICPendingTransaction",void 0),(0,i.Z)(this,"AutosMarketplace",void 0),(0,i.Z)(this,"AutosMarketplaceNotification",void 0),(0,i.Z)(this,"BestCoupons",void 0),(0,i.Z)(this,"ICNotificationType",void 0),(0,i.Z)(this,"CashbackInfo",void 0),(0,i.Z)(this,"ICIsRelatedOffer",void 0),(0,i.Z)(this,"GroceryInstantAddToCart",void 0),(0,i.Z)(this,"GroceryInstantAddToCartSpb",void 0),(0,i.Z)(this,"GroceryMatchedCartSpbOffers",void 0),(0,i.Z)(this,"CheckoutPageNavigatedTime",void 0),(0,i.Z)(this,"DynamicTransactionId",void 0),(0,i.Z)(this,"GroceryAutoShowData",void 0),(0,i.Z)(this,"GroceryCategoryAutoShowData",void 0),(0,i.Z)(this,"ProductTrackingOOSLastShown",void 0),(0,i.Z)(this,"PackageTrackingConfirmationNotifLastShown",void 0),(0,i.Z)(this,"PcbNotificationLastShownAdCount",void 0),(0,i.Z)(this,"TrackedProductsData",void 0),(0,i.Z)(this,"UrlToProductMap",void 0),(0,i.Z)(this,"SidepaneCashback",void 0),(0,i.Z)(this,"ProductBestCouponConsent",void 0),(0,i.Z)(this,"PackagesNotified",void 0),(0,i.Z)(this,"ValidPackage",void 0),(0,i.Z)(this,"DealsForTopDomainsTimestamp",void 0),(0,i.Z)(this,"ICSpbHomePageShownTimestamp",void 0),(0,i.Z)(this,"ICSpbExpiryNotificationShownTime",void 0),(0,i.Z)(this,"PCBStorewideAddressBar",void 0),(0,i.Z)(this,"PCBStorewideAddressBarLastRequested",void 0),(0,i.Z)(this,"ShippingFee",void 0),(0,i.Z)(this,"InboxCouponsUserConsent",void 0),(0,i.Z)(this,"CartPageCashbackNotification",void 0),(0,i.Z)(this,"PriceMatchConsent",void 0),(0,i.Z)(this,"UnsuccessfulAutoApplyCount",void 0),(0,i.Z)(this,"ProductTrackingBackInStockValidationData",void 0),(0,i.Z)(this,"ProductTrackingPriceDropValidationData",void 0),(0,i.Z)(this,"PostPurchasePendingProducts",void 0),(0,i.Z)(this,"PostPurchasePathnameProducts",void 0),(0,i.Z)(this,"InboxCouponsHashedUserId",void 0),(0,i.Z)(this,"InboxCouponsLogsMetadata",void 0),(0,i.Z)(this,"InboxCouponsPaneOpen",void 0),(0,i.Z)(this,"IsNavigatedFromAddressBarPersonalizedCashback",void 0),(0,i.Z)(this,"IsNavigatedFromAddressBarCashback",void 0),(0,i.Z)(this,"IsNavigatedFromAddressBarCoupons",void 0),(0,i.Z)(this,"anidTrackingData",void 0),(0,i.Z)(this,"articlesCashback",void 0),(0,i.Z)(this,"PriceMatchNotificationData",void 0),(0,i.Z)(this,"BGAAApplyButtonClicked",void 0),(0,i.Z)(this,"ExclusiveCouponConsent",void 0),(0,i.Z)(this,"BlossomCampaignUserStatus",void 0),(0,i.Z)(this,"PurchaseCart",void 0)}Create(e){a.ICSpbExpiryNotificationShownTime=e[r.Q.ICSpbExpiryNotificationShownTime]??null,a.ICSpbHomePageShownTimestamp=e[r.Q.ICSpbHomePageShownTimestamp]??null,a.OtherSellersNotificationData=e.OtherSellersNotificationData,a.OtherSellersAutoShowCount=e.OtherSellersAutoShowCount,a.OtherSellersLastAutoShowTime=e.OtherSellersLastAutoShowTime,a.CanSaveYoutubeCoupons=e.CanSaveYoutubeCoupons??null,a.SocialCoupons=e.socialCoupons??null,a.IsEntrolledInDealDaysNotifications=e[r.Q.IsEntrolledInDealDaysNotifications]??null,a.CartValues=e.CartValues,a.CompletedPurchase=e.CompletedPurchase,a.CompletedPurchaseConf=e.CompletedPurchaseConf,a.GroceryCashbackItem=e[r.Q.GroceryCashbackItem],a.Anid=e[r.Q.UserAnid],a.GroceryInstantAddToCart=e[r.Q.GroceryInstantAddToCart],a.GroceryInstantAddToCartSpb=e[r.Q.GroceryInstantAddToCartSpb],a.GroceryMatchedCartSpbOffers=e[r.Q.GroceryMatchedCartSpbOffers],a.GroceryCashbackActivated=e[r.Q.GroceryCashbackActivated],a.ICAutoShownOffers=e[r.Q.ICAutoShownOffers],a.AutoOpenData=e.AutoOpenData??null,a.AutoOpenPrefData=e.AutoOpenPrefData??null,a.AutoOpenDomainPrefData=e.AutoOpenDomainPrefData??null,a.LastCleanedData=e.LastCleanedData??null,a.LastShownData=e.LastShownData??null,a.StageAndCategoryLastShown=e.StageAndCategoryLastShown??null,a.ICLastAutoShowTime=e.ICLastAutoShowTime,a.ICMetadata=e[r.Q.ICMetadata],a.ICActivatedPending=e[r.Q.ICActivatedPending],a.PrivacyBadgeViewCount=e.PrivacyBadgeViewCount,a.GiftCardData=e.GiftCardData??null,a.PersistentCartData=e.PersistentCartData??null,a.PersistentWinCartData=e.PersistentWinCartData??null,a.PersistentTravelData=e.PersistentTravelData??null,a.AutoClipData=e.AutoClipData??null,a.RuleBasedTriggerData=e.RuleBasedTriggerData??null,a.ICPendingTransaction=e.ICPendingTransaction??null,a.AutosMarketplace=e[r.Q.AutosMarketplace],a.AutosMarketplaceNotification=e[r.Q.AutosMarketplaceNotification],a.BestCoupons=e[r.Q.BestCoupons],a.CashbackInfo=e[r.Q.CashbackInfo],a.ICNotificationType=e[r.Q.ICNotificationType],a.ICIsRelatedOffer=e[r.Q.ICIsRelatedOffer],a.GroceryAutoShowData=e[r.Q.GroceryAutoShowData],a.GroceryCategoryAutoShowData=e[r.Q.GroceryCategoryAutoShowData],a.ProductTrackingOOSLastShown=e[r.Q.ProductTrackingOOSLastShown],a.PackageTrackingConfirmationNotifLastShown=e[r.Q.PackageTrackingConfirmationNotifLastShown],a.ICIsPendingTransactionPresent=e[r.Q.ICIsPendingTransactionPresent],a.ICCurrentPageInfo=e[r.Q.ICCurrentPageInfo],a.ICRelatedPDPOffer=e[r.Q.ICRelatedPDPOffer],a.PcbNotificationLastShownAdCount=e[r.Q.PcbNotificationLastShownAdCount],a.TrackedProductsData=e[r.Q.ProductTrackingTrackedProducts],a.UrlToProductMap=e[r.Q.ProductTrackingUrlProductCache],a.SidepaneCashback=e[r.Q.SidepaneCashback],a.ProductBestCouponConsent=e[r.Q.ProductBestCouponConsent],a.PackagesNotified=e[r.Q.PackagesNotified],a.ValidPackage=e[r.Q.ValidPackage],a.DealsForTopDomainsTimestamp=e[r.Q.DealsForTopDomainsTimestamp],a.PCBStorewideAddressBar=e[r.Q.PCBStorewideAddressBar],a.PCBStorewideAddressBarLastRequested=e[r.Q.PCBStorewideAddressBarLastRequested],a.ShippingFee=e[r.Q.ShippingFee],a.InboxCouponsUserConsent=e[r.Q.InboxCouponsUserConsented],a.CartPageCashbackNotification=e[r.Q.CartPageCashbackNotification],a.PriceMatchConsent=e[r.Q.PriceMatchConsent],a.UnsuccessfulAutoApplyCount=e[r.Q.UnsuccessfulAutoApplyCount],a.ProductTrackingBackInStockValidationData=e[r.Q.ProductTrackingBackInStockValidationData],a.ProductTrackingPriceDropValidationData=e[r.Q.ProductTrackingPriceDropValidationData],a.PostPurchasePendingProducts=e[r.Q.PostPurchasePendingProducts],a.PostPurchasePathnameProducts=e[r.Q.PostPurchasePathnameProducts],a.InboxCouponsHashedUserId=e[r.Q.InboxCouponsHashedUserId],a.InboxCouponsLogsMetadata=e[r.Q.InboxCouponsLogsMetadata],a.InboxCouponsPaneOpen=e[r.Q.InboxCouponsPaneOpen],a.IsNavigatedFromAddressBarPersonalizedCashback=e[r.Q.IsNavigatedFromAddressBarPersonalizedCashback],a.anidTrackingData=e[r.Q.ProductTrackingAnidData],a.PersonalizedPromotionsCartData=e[r.Q.PersonalizedPromotionsCartData],a.IsNavigatedFromAddressBarCashback=e[r.Q.IsNavigatedFromAddressBarCashback],a.IsNavigatedFromAddressBarCoupons=e[r.Q.IsNavigatedFromAddressBarCoupons],a.articlesCashback=e[r.Q.ArticlesCashback],a.PriceMatchNotificationData=e[r.Q.PriceMatchNotification],a.BGAAApplyButtonClicked=e[r.Q.BGAAApplyButtonClicked],a.ExclusiveCouponConsent=e[r.Q.ExclusiveCouponConsent],a.BlossomCampaignUserStatus=e[r.Q.BlossomCampaignUserStatus],a.CheckoutPageNavigatedTime=e[r.Q.CheckoutPageNavigatedTime],a.DynamicTransactionId=e[r.Q.DynamicTransactionId],a.PurchaseCart=e[r.Q.PurchaseCart]}setRawStorageObject(e){this.rawStorageObj=e}setStorageObjStr(e){this.storageObjStr=e}}},44092:function(e,t,o){function i(){try{const e="__storage__test";return window.sessionStorage.setItem(e,""),window.sessionStorage.removeItem(e),!0}catch(e){return!1}}function r(e){return i()?window.sessionStorage.getItem(e):null}function a(e,t){i()&&window.sessionStorage.setItem(e,t)}o.d(t,{Lt:function(){return r},i8:function(){return a}})},33491:function(e,t,o){o.d(t,{Ev:function(){return c},Mw:function(){return n},NN:function(){return d},TJ:function(){return s},UZ:function(){return u},WN:function(){return a},Xo:function(){return l}});let i=null;const r="test-shopping-localstorage";function a(e){let t;const o=n(e);if(o)try{return t=JSON.parse(o),t}catch(e){}return t}function n(e){let t=null;return d()&&(t=window.localStorage.getItem(e)),t}function s(e){d()&&window.localStorage.removeItem(e)}function c(e,t){l(e,JSON.stringify(t))}function l(e,t){d()&&window.localStorage.setItem(e,t)}function u(e){d()&&localStorage.removeItem(e)}function d(){try{if(null!==i)return i;"undefined"!=typeof window&&window?.localStorage&&(window.localStorage.setItem(r,r),window.localStorage.getItem(r),window.localStorage.removeItem(r),i=!0)}catch(e){i=!1}return i}},91897:function(e,t,o){o.d(t,{nQ:function(){return r},r2:function(){return a}});var i=o(64865);const r=864e5;function a(e,t){if((0,i.TF)(e))return-1;const o=new Date(e),r=void 0===t?new Date:new Date(t),a=o?r.getTime()-o.getTime():0;return Math.floor(a/1e3/60/60)}},27689:function(e,t,o){o.d(t,{AL:function(){return u},Ad:function(){return p},BQ:function(){return n},Ek:function(){return c},Mu:function(){return g},S8:function(){return a},Wf:function(){return C},cz:function(){return s},og:function(){return l},sT:function(){return r},uE:function(){return d},uf:function(){return h}}),o(17204),o(5144),o(88767);var i=o(29247);function r(){return"BackgroundAutoApplyData_"+a()}function a(){return d(window.location.hostname)}function n(e,t=!1){try{if(!e||"null"===e)return null;if(e.value&&(e=e.value),"string"==typeof e){if(t){const t=JSON.parse(e,i.BX);return t.value?JSON.parse(t.value,i.BX):t}const o=JSON.parse(e);return o.value?JSON.parse(o.value):o}return e}catch(e){return null}}function s(){try{return window.self!==window.top}catch(e){return!0}}function c(){return window.location.toString()}function l(e,t){if(e&&t&&""!==t){const o=t.split("|");for(const t of o)if(e.match(t))return t}return""}function u(){return document.title}function d(e){if(!e)return"";const t=e.toLowerCase().match(/(w){3}.?\./);return t&&null!=t.index&&t[0]?e.substring(t.index+t[0].length):e}function h(e,t){return e||t||"en-us"}function p(e){try{return JSON.parse(e)}catch(e){return null}}function g(e,t){try{return new URL(e.offerUrl).hostname!==t&&e.attribution!==t}catch(e){return!1}}function C(e){if(e)try{const t=JSON.parse(e);for(const e of t)if(e.includes("bing.com"))return e}catch(e){}}o(36493)},43315:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"productNames",null),(0,i.Z)(this,"productSellerNames",null),(0,i.Z)(this,"productIdSku",null),(0,i.Z)(this,"transactionId",null),(0,i.Z)(this,"purchaseTotal",null),(0,i.Z)(this,"numberOfItems",null),(0,i.Z)(this,"pricePerItem",null),(0,i.Z)(this,"quantityPerItem",null),(0,i.Z)(this,"orderConfirmationPageUrl",null),(0,i.Z)(this,"orderSubTotalPrice",null),(0,i.Z)(this,"orderDiscountPrice",null),(0,i.Z)(this,"orderDiscountCode",null),(0,i.Z)(this,"orderShippingPrice",null),(0,i.Z)(this,"orderTaxesPrice",null),(0,i.Z)(this,"currency",null),(0,i.Z)(this,"productUrls",null),(0,i.Z)(this,"personalizationDataConsent",null),(0,i.Z)(this,"dynamicTransactionId",null),(0,i.Z)(this,"productBrandNames",null)}}},33408:function(e,t,o){o.d(t,{_p:function(){return Te}});var i=o(72370),r=o(64865),a=o(3634),n=o(95457),s=o(4872),c=o(31656),l=o(84830),u=o(82960),d=o(71951),h=o(5144),p=o(39088),g=o(21488),C=o(21597),S=o(88767),m=o(73557),A=o(55590),P=o(29247),f=o(71544),E=o(36493),T=o(33491),O=o(91495),I=o(27689),_=o(91221),v=o(90066),R=o(27900),D=o(60269),N=o(46261),y=o(1094),b=o(34802),k=o(50978),U=o(90650),w=o(87869),L=o(46557),M=o(52056),Z=o(83879),B=o(43315),F=o(69315),G=o(68813);let x=function(e){return e.LogScriptTelemetry="LogScriptTelemetry",e.PurchaseCashbackConfirmation="PurchaseCashbackConfirmation",e.SetStorageValue="SetStorageValue",e.ClearStorageValue="ClearStorageValue",e.UpdateLoadTimeData="UpdateLoadTimeData",e.AutoShowFeaturesAvailable="AutoShowFeaturesAvailable",e.ReportRewardsActivity="ReportRewardsActivity",e}({});var H=o(64641),V=o(11542),K=o(8018);class W{static GetItemizedCashbackService(){return this.itemizedCashbackService}static GetEdgeMessageService(){return this.edgeMessageService}}(0,i.Z)(W,"edgeMessageService",new class{SendPurchaseConfirmationMessage(){this.SendMessge(x.PurchaseCashbackConfirmation,[])}SendStorageMessage(e,t){this.SendMessge(x.SetStorageValue,[e,t])}ClearStorageValue(e){this.SendMessge(x.ClearStorageValue,[e])}SendUpdateLoadTimeMessge(e){this.SendMessge(x.UpdateLoadTimeData,[e])}TrySendAutoShowFeaturesAvailableMessage(e,t){return!!(0,G.Oh)(e,(0,G.tW)(),Z.Z.GetLocalDataService().GetUserSettingsData())&&(this.SendMessge(x.AutoShowFeaturesAvailable,[e.toString(),t]),!0)}ReportRewardsActivity(e,t,o){this.SendMessge(x.ReportRewardsActivity,[e,t,o])}SendMessge(e,t){F.R.postMessageToHost(e,t)}}),(0,i.Z)(W,"itemizedCashbackService",new class{constructor(e){(0,i.Z)(this,"edgeMessageService",void 0),this.edgeMessageService=e}CheckGroceryCashBack(e,t,o,i){try{const r=(0,H.kU)(e,t);if(!r)return!1;const a=o.isRebatesUser,n=this.getPendingTransaction(r,t,a);if(n)return this.addTransactionToPersistentStorage(t,n),this.edgeMessageService.SendStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:K.c.Confirmation})),this.edgeMessageService.SendStorageMessage(A.Q.ICConfirmationPending,JSON.stringify({value:!0})),this.edgeMessageService.SendPurchaseConfirmationMessage(),this.edgeMessageService.SendUpdateLoadTimeMessge(i),!0}catch(e){}return!1}getPendingTransaction(e,t,o){const i=O.Q?.GroceryCashbackActivated,r=(i?(0,I.BQ)(i):{})[t]??void 0,a=r?.fullItems?Object.keys(r.fullItems):[],n=[],s=[];for(const e of a){const t=r.fullItems[e];if(t&&t.cashbackProducts&&t.cashbackProducts.length>0)for(const e of t.cashbackProducts)e.title&&n.push(e.title),e.productId&&s.push(e.productId),e.url&&V.Z.GetProductIdsFromUrl(e.url).filter((e=>!s.includes(e))).forEach((e=>s.push(e)))}const c=O.Q?.PersistentCartData||"",l=(0,H.C9)(c,t);if(n.length>0&&l?.Products)for(const i of l.Products)if(n.includes(i.productTitle)||this.isProductFromUrlActivated(`https://www.${t}${i.productUrl}`,s))return this.makePendingTransactionToStorage(l,r,o,e)}isProductFromUrlActivated(e,t){const o=V.Z.GetProductIdsFromUrl(e);return!!t&&t.some((e=>o.includes(e)))}makePendingTransactionToStorage(e,t,o,i){return{addedTimestamp:(0,H.u3)(),groceryActivatedData:t,groceryOrder:e,isSigninBeforePurchase:o,purchaseIdFromUrl:i,transactionId:i}}addTransactionToPersistentStorage(e,t){const o=(0,I.BQ)(O.Q.ICPendingTransaction)??{};o[e]=t,this.edgeMessageService.SendStorageMessage(A.Q.ICPendingTransaction,JSON.stringify({value:JSON.stringify(o)}))}}(W.GetEdgeMessageService()));var z=W,Q=o(56577),J=class{constructor(){(0,i.Z)(this,"productIdSelector",void 0),(0,i.Z)(this,"productIdSkuSelector",void 0),(0,i.Z)(this,"productPriceSelector",void 0),(0,i.Z)(this,"productQuantitySelector",void 0),(0,i.Z)(this,"productImageSelector",void 0)}},Y=class{constructor(){(0,i.Z)(this,"confirmationPageUrl",void 0),(0,i.Z)(this,"bookingIdSelector",void 0),(0,i.Z)(this,"totalPriceSelector",void 0),(0,i.Z)(this,"startDateSelector",void 0),(0,i.Z)(this,"endDateSelector",void 0),(0,i.Z)(this,"domainType",void 0),(0,i.Z)(this,"nameSelector",void 0),(0,i.Z)(this,"isRoundTripSelector",void 0)}};class X{constructor(){(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"orderConfirmationPageUrl",void 0),(0,i.Z)(this,"orderConfirmationRegex",void 0),(0,i.Z)(this,"confirmationPageTelemetry",void 0),(0,i.Z)(this,"orderDetailsPageUrl",void 0),(0,i.Z)(this,"productNameSelector",void 0),(0,i.Z)(this,"productPageUrl",void 0),(0,i.Z)(this,"cancellationPageTelemetry",void 0),(0,i.Z)(this,"travelConfirmationPageTelemetry",void 0),(0,i.Z)(this,"exactConfirmationPageUrl",void 0),(0,i.Z)(this,"allAutomatedSelectors",void 0),(0,i.Z)(this,"settings",void 0)}static Create(e){const t=new X;return e&&(t.domainName=e.domainName,t.orderConfirmationPageUrl=e.orderConfirmationPageUrl,t.orderConfirmationRegex=e.orderConfirmationRegex,t.orderDetailsPageUrl=e.orderDetailsPageUrl,t.productNameSelector=e.productNameSelector,t.productPageUrl=e.productPageUrl,t.exactConfirmationPageUrl=e.exactConfirmationPageUrl,t.settings=e.settings,e.confirmationPageTelemetry&&(t.confirmationPageTelemetry=this.CreateConfirmationPageTelemetryData(e.confirmationPageTelemetry)),e.cancellationPageTelemetry&&(t.cancellationPageTelemetry=this.CreateCancellationPageTelemetryData(e.cancellationPageTelemetry)),e.travelConfirmationPageTelemetry&&(t.travelConfirmationPageTelemetry=this.CreateTravelConfirmationPageTelemetryData(e.travelConfirmationPageTelemetry)),e.allAutomatedSelectors&&(t.allAutomatedSelectors=this.createAutomatedSelectorsPageList(e.allAutomatedSelectors))),t}static CreateCancellationPageTelemetryData(e){const t=new class{constructor(){(0,i.Z)(this,"cancellationPageUrlRegex",void 0),(0,i.Z)(this,"transactionIdSelector",void 0),(0,i.Z)(this,"cancellationTextSelector",void 0),(0,i.Z)(this,"productTitleSelector",void 0),(0,i.Z)(this,"productQuantitySelector",void 0),(0,i.Z)(this,"pricePerItemSelector",void 0),(0,i.Z)(this,"totalPriceSelector",void 0)}};return t.cancellationPageUrlRegex=e.cancellationPageUrlRegex,t.transactionIdSelector=e.transactionIdSelector,t.cancellationTextSelector=e.cancellationTextSelector,t.productTitleSelector=e.productTitleSelector,t.productQuantitySelector=e.productQuantitySelector,t.pricePerItemSelector=e.pricePerItemSelector,t.totalPriceSelector=e.totalPriceSelector,t}static CreateConfirmationPageTelemetryData(e){const t=new class{constructor(){(0,i.Z)(this,"transactionIdSelector",void 0),(0,i.Z)(this,"purchaseTotalSelector",void 0),(0,i.Z)(this,"numItemsSelector",void 0),(0,i.Z)(this,"productDetailsData",void 0),(0,i.Z)(this,"orderIdSelectors",void 0),(0,i.Z)(this,"orderSubTotalPriceSelector",void 0),(0,i.Z)(this,"orderDiscountPriceSelector",void 0),(0,i.Z)(this,"orderDiscountCodeSelector",void 0),(0,i.Z)(this,"orderShippingPriceSelector",void 0),(0,i.Z)(this,"orderTaxesPriceSelector",void 0),(0,i.Z)(this,"isHtmlFragmentCollectionEnabled",void 0),(0,i.Z)(this,"isCartCachingEnabled",void 0),(0,i.Z)(this,"confirmationPageValidationSelector",void 0)}};return t.purchaseTotalSelector=e.purchaseTotalSelector,t.transactionIdSelector=e.transactionIdSelector,t.numItemsSelector=e.numItemsSelector,t.orderIdSelectors=e.orderIdSelectors,t.orderDiscountCodeSelector=e.orderDiscountCodeSelector,t.orderDiscountPriceSelector=e.orderDiscountPriceSelector,t.orderShippingPriceSelector=e.orderShippingPriceSelector,t.orderSubTotalPriceSelector=e.orderSubTotalPriceSelector,t.orderTaxesPriceSelector=e.orderTaxesPriceSelector,t.isHtmlFragmentCollectionEnabled=e.isHtmlFragmentCollectionEnabled,t.isCartCachingEnabled=e.isCartCachingEnabled??!0,t.confirmationPageValidationSelector=e.confirmationPageValidationSelector,e&&e.productDetailsData&&(t.productDetailsData=this.CreateProductDetailsData(e.productDetailsData)),t}static CreateProductDetailsData(e){const t=[];for(const o of e)if(o){const e=new J;e.productIdSelector=o.productIdSelector,e.productIdSkuSelector=o.productIdSkuSelector,e.productPriceSelector=o.productPriceSelector,e.productQuantitySelector=o.productQuantitySelector,e.productImageSelector=o.productImageSelector,t.push(e)}return t}static CreateTravelConfirmationPageTelemetryData(e){const t=[];for(const o of e)if(o){const e=new Y;e.bookingIdSelector=o.bookingIdSelector,e.confirmationPageUrl=o.confirmationPageUrl,e.domainType=o.domainType,e.startDateSelector=o.startDateSelector,e.endDateSelector=o.endDateSelector,e.totalPriceSelector=o.totalPriceSelector,e.nameSelector=o.nameSelector,t.push(e)}return t}static createAutomatedSelectorsPageList(e){const t=[];for(const o of e)t.push(P.ZP.DeepAssign(new Q.ZP,o));return t}}var $=X,j=class{constructor(){(0,i.Z)(this,"retailerData",void 0),(0,i.Z)(this,"impressionId",void 0),(0,i.Z)(this,"cashback",void 0),(0,i.Z)(this,"platform",void 0),(0,i.Z)(this,"orderConfirmationPageUrlRegex",void 0)}},q=class{constructor(){(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"domainType",void 0),(0,i.Z)(this,"bookingId",void 0),(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"orderConfirmationPageUrl",void 0),(0,i.Z)(this,"startDate",void 0),(0,i.Z)(this,"endDate",void 0),(0,i.Z)(this,"currency",void 0),(0,i.Z)(this,"isRoundTrip",void 0),(0,i.Z)(this,"personalizationDataConsent",void 0)}},ee=o(92572),te=o(86743),oe=o(15267),ie=o(45822),re=o(73765),ae=o(82315);function ne(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function se(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ne(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}let ce="",le="";async function ue(e,t){try{const o=e[0],i=JSON.parse(o),l=function(e){if(e){const t=new j;return e.retailerData&&(t.retailerData=$.Create(e.retailerData),t.platform=e.retailerData.platform,t.orderConfirmationPageUrlRegex=e.retailerData.orderConfirmationPageUrl),e.impressionId&&(t.impressionId=e.impressionId),t}return new j}(i),u=i.aFDMarket,p=i.personalizedAdsResponse?.personalizedCashback,E=i?.isPackageTrackingEnabled??!1,_=i?.cashback;le=l.impressionId??"",n.Z.Create(i?.itemLevelCashBack?.domainData);const R=i?.userInfo?.isAADSignedIn??!1,b=i?.userInfo?.isMSASignedIn??!1,k=i?.userInfo?.isPersonalizationDataConsentEnabled??!1;if(!t)return ce=e[1],!0;let B,F,G=!1,x=!1;e.length>2&&(B=e[2]);try{F=function(e){let t;return e.length>C.$R.enabled_service_features&&e[C.$R.enabled_service_features].length>0?t=e[C.$R.enabled_service_features]:e.length>C.$R.confirmation_enabled_service_features_v2&&e[C.$R.confirmation_enabled_service_features_v2].length>0&&(t=e[C.$R.confirmation_enabled_service_features_v2]),t}(e),c.R.Create(B,F),G=c.R.isExperimentActive(s.H.sustainability),x=c.R.isExperimentActive(s.H.postPurchaseTracking)}catch(e){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)()},"ConfirmationPageValidation","Unable to find experiments: "+e,h.in.Error)}let H,V="";if(e.length>3)try{if(V=e[3],!(0,r.TF)(V)){const e=JSON.parse(V);O.Q.Create(e),O.Q.setRawStorageObject(e)}}catch(e){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)()},"ConfirmationPageValidation","Unable to find persistentStorageData"+e,h.in.Error)}e.length>5&&(H=e[5]),e.length>=8&&(f.Z.enabledServiceFlights=e[7]);let K=!1;e.length>=10&&(K="1"===e[9]);let W,Q=!1;e.length>=11&&(Q="1"===e[10]),e.length>=12&&(W=e[11]);let J="";e.length>=13&&(J=e[12]),Z.Z.GetLocalDataService().SetUserSettingsData(e,C.$R.confirmation_user_cohort_data,c.R.isExperimentActive(s.H.shoppingCohorts));const Y=function(e,t,o,i,r){try{if((0,ie.hy)(e)){const a=ae.Z.createNewApiResponse(JSON.stringify(e),o,t),n=Z.Z.GetLocalDataService()?.GetSessionIds();if(ee.Z.initFactory(a,n,i,r),ee.Z.getFactory().getPurchaseExtractionService().isPurchaseExtractionEnabled())return!1}}catch(e){Ce("Failed to instantiate cashback injected factory")}return!0}(i,le,ce,H??"",J??""),X=function(e){const t=e.retailerData;try{if(t){const e=t.orderConfirmationRegex;if(e&&""!==e)return atob(e)}}catch(e){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),Status:"Error"},"ConfirmationPageValidation","ConfirmationPageValidationError: GetConfirmationPattern "+e+" Regex: "+t.orderConfirmationRegex,h.in.Error)}return null}(l);if(function(e,t){return e||t?.retailerData?.confirmationPageTelemetry?.transactionIdSelector||t?.retailerData?.confirmationPageTelemetry?.purchaseTotalSelector||t?.retailerData?.confirmationPageTelemetry?.confirmationPageValidationSelector||t?.retailerData?.travelConfirmationPageTelemetry?.length||t?.retailerData?.allAutomatedSelectors}(X,l))(0,T.UZ)(N.Wi),(0,P.dz)((async()=>de(X,l.retailerData)),5e3).then((async o=>{if(!o){if(("super.com"===l?.retailerData.domainName||"livesuper.com"===l?.retailerData.domainName)&&l?.retailerData.confirmationPageTelemetry?.transactionIdSelector){const e=l?.retailerData.confirmationPageTelemetry?.transactionIdSelector??"";await(0,P.dz)((async()=>void 0!==v.Z.GetFirstVisibleElement(e)),25e3,250).then((e=>{e&&(o=!0)}))}const a=function(e,t){const o=e?.retailerData?.allFinalCheckoutPages;if(!o)return"";if((0,r.TF)(t))return"";const i=o.find((e=>t.includes(e?.checkoutPageUrl))),a=i?.finalCheckoutButtonSelector;return a}(i,l.retailerData.orderConfirmationPageUrl);!function(e,t){if((0,r.TF)(e))return;v.Z.GetAllVisibleElements(e).forEach((e=>function(e,t){e.addEventListener("click",t)}(e,t)))}(a,(async()=>{(0,P.dz)((async()=>de(X,l.retailerData)),2e4).then((o=>{o&&ue(e,t)}))}))}let n=!1;const d=l?.retailerData?.domainName??"";if(o){const e=g.Z.Create(i);n=z.GetItemizedCashbackService().CheckGroceryCashBack(window.location.href,d,e,ce)}o&&x&&function(e,t){const o=(0,I.S8)();if(a.kH.includes(o)&&t){const i=!0===(0,I.BQ)(O.Q.PriceMatchConsent),r=a.PK[o]?.hasCsrError,n={Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({isUserConsented:i,hasCsrError:r})};if(ge(n,"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Eligible confirmation page detected",h.in.Information),i&&!r)(async function(e,t,o){try{const o=we(e,t,"Extension/Injected/ConfirmationPage"),i="https://www.bing.com/api/shopping/v1/savings/product-tracking/track-batch-products",r=await fetch(i,o);return await r.json()}catch(e){return ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({e:e})},"ConfirmationPageValidation","sendPostPurchaseRequest: Uncaught error",h.in.Error),{success:!1}}})(e,t).then((e=>{e.success?ge(n,"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Tracking successful",h.in.Information):ge(n,"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Tracking unsuccessful",h.in.Error)})).catch((e=>{ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({error:e})},"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Uncaught error",h.in.Error)}));else{const o=we(e,t,"Extension/UX/PendingProducts");o&&z.GetEdgeMessageService().SendStorageMessage(A.Q.PostPurchasePendingProducts,JSON.stringify({value:{request:o,timestamp:Date.now()}}))}}}(Z.Z.GetCartExtractionService().GetAvailableCartData(),W);const C=Z.Z.GetCancellationPageDataExtractionService();C.isCancellationPageValid(l.retailerData)&&(C.GetAndSendCancellationPageData(l.retailerData,le),o=!1),Se(o,l,p,_,E,H,W,J,R,b,k,u,Y),c.R.isExperimentActive(s.H.sanConsent)&&c.R.isExperimentActive(s.H.sanConfirmationMessage)&&o&&!n&&!K&&Q&&(z.GetEdgeMessageService().TrySendAutoShowFeaturesAvailableMessage(m.sR.AUTO_SHOW_SAN_CONSENT_CONFIRMATION,S.sM.SAN_CONSENT_NOTIFICATION)||pe({},m.sR.AUTO_SHOW_SAN_CONSENT_CONFIRMATION))})).catch((e=>{Ce(e?.message??"confirmationpage error.")}));else{const e=function(){try{const e=(0,T.Mw)(N.Wi);if(!e)return null;const t=JSON.parse(e);if(!t.CheckoutButtonClicked||Date.now()-t.CheckoutTime>N.LE){(0,T.UZ)(N.Wi);const e=t.CartValue;return he("Expired checkout status data in confirmation page script","Error",t.CartId,e?.OrderTotal,e?.Currency),null}return(0,T.UZ)(N.Wi),t}catch(e){return null}}();if(!e)return Se(!1,l,p,_,E,H,W,J,R,b,k,u,Y),he("no checkout status","Failed",""),!1;const t=function(e){if(e){const t=new D.Z;return e.retailerData&&(t.retailerData=L.Z.Create(e.retailerData)),e.impressionId&&(t.impressionId=e.impressionId),t}return new D.Z}(i);let o=new w.L;(0,P.dz)((async()=>(o=function(e){e.retailerData.updateCurrentFinalCheckoutPage(y.Z.GetCurrentPathName());const t=e?.retailerData?.getCurrentFinalCheckoutPage();return function(e){const t=new w.L;if(t.indicators=[],t.purchaseFailed=!1,e&&v.Z.GetAllVisibleElements(e?.finalCheckoutButtonSelector).length>0)return t.purchaseFailed=!0,t.indicators.push(w.c.finalCheckoutButtonVisible),t;const o=v.Z.GetFirstVisibleElement("body");return U.ZP.PageIncludesPaymentKeyWords(o?.innerText.toLocaleLowerCase(),U.lD)?(t.purchaseFailed=!1,t.indicators.push(w.c.successfulPaymentKeywordsFound),t):(U.ZP.PageIncludesPaymentKeyWords(o?.innerText.toLocaleLowerCase(),U.si)&&(t.purchaseFailed=!0,t.indicators.push(w.c.failurePaymentKeywordsFound)),v.Z.GetAllVisibleElements("input").length>0&&(t.purchaseFailed=!0,t.indicators.push(w.c.inputFieldsFound)),t)}(t)}(t),o.indicators.length>0)),5e3).then((()=>{Se(!!G&&!o.purchaseFailed,l,p,_,E,H,W,J,R,b,k,u,Y),function(e,t,o,i){const r=e?"Failed":"Succeeded";e||(0,T.Mw)(d.y$.autoApplyStorageKey)===d.M4.ActionDetected&&(M.Z.SendStringStorageMessage(d.y$.completedPurchaseStorageKey,d.M4.ActionDetected),(0,T.Xo)(d.y$.completedPurchaseStorageKey,d.M4.ActionDetected)),he(JSON.stringify(i),r,t,o.OrderTotal,o.Currency)}(o.purchaseFailed,e.CartId,e.CartValue,o.indicators)})).catch((t=>{Se(!1,l,p,_,E,H,W,J,R,b,k,u,Y),he(t?.message??"Error evaluating purchase status on confirmation page","Error",e.CartId,e.CartValue?.OrderTotal,e.CartValue?.Currency)}))}return!1}catch(e){return ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),Status:"Error"},"ConfirmationPageValidation","Confirmation page validation error: "+e,h.in.Error),!1}}function de(e,t){if(t?.confirmationPageTelemetry?.confirmationPageValidationSelector){const e=M.Z.GetBoxValue(t.confirmationPageTelemetry.confirmationPageValidationSelector);return null!=e&&""!==e}if(e&&""!==e){const t=document?.body?.getElementsByTagName("*"),o=new RegExp(e,"i");for(let e=0;e<=t?.length;e++)if(void 0!==t[e]&&null!==t[e]&&null!==t[e].textContent&&t[e].textContent?.match(o))return!0}if(t?.confirmationPageTelemetry?.transactionIdSelector){const e=t.confirmationPageTelemetry.transactionIdSelector;let o=M.Z.GetBoxValue(e);if(o||(o=(0,oe.ql)(e,(0,I.Ek)())),o)return!0;Ne("confirmation page detection Error",{message:`transaction id not found for selector ${e}`})}if(t?.travelConfirmationPageTelemetry?.length)for(const e of t.travelConfirmationPageTelemetry)if(e.bookingIdSelector&&""!==e.bookingIdSelector){const t=M.Z.GetBoxValue(e.bookingIdSelector);if(null!=t&&""!==t)return!0}return!!function(e){try{if(e?.allAutomatedSelectors){const t=(0,I.Ek)();for(const o of e.allAutomatedSelectors)if(o.type===h.u3.PurchaseConfirmed&&o.urlRegex&&(0,ie.io)(t,o.urlRegex))return!0}}catch(e){return Ne("confirmation page detection Error",{message:"not a valid confirmation page"}),!1}return!1}(t)||(Ne("confirmation page detection Error",{message:"not a valid confirmation page"}),!1)}function he(e,t,o,i,r){ge({CartId:o,Currency:r,Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),StartingPrice:i??-1,Status:t},"PurchaseConfirmation","Confirmation page: "+e,"Information")}function pe(e,t){const o={userSettingsData:Z.Z.GetLocalDataService().GetUserSettingsData(),popupOrigination:m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION};ge(e,"ConfirmationPageValidation",`Blocked by User Cohort:${JSON.stringify(o)}`,h.in.Information)}function ge(e,t,o,i){const r={};r.JsonData=JSON.stringify(e),r.EventType=t,r.LogLevel=i,r.Message=o,r.ClientContext=new l.Z(f.Z.GetClientName(),p.yJ,f.Z.GetBuildVersion(),f.Z.enabledServiceFlights),le&&(r.ImpressionId=le);const a=[JSON.stringify(r)];F.R.postMessageToHost("LogScriptTelemetry",a)}function Ce(e){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),Status:"error"},"ConfirmationPageValidation",e,h.in.Information),F.R.postMessageToHost("ConfirmationPageValidationError",["error",ce])}function Se(e,t,o,i,r,n,d,g,C,P,E,D,N){r&&(_.Z.hasNotificationBeenShownRecently(A.Q.PackageTrackingConfirmationNotifLastShown,a.LJ)||(async function(e,t){const o=e?.retailerData?.confirmationPageTelemetry?.transactionIdSelector,i=e?.retailerData?.confirmationPageTelemetry?.orderIdSelectors;if(!o&&!i)return;let r="",n="";try{const s=(0,I.Ek)();if(r=M.Z.GetBoxValue(o??""),r&&""!==r)n=r;else if(a.Z3.has(e?.retailerData?.domainName)){const t=a.Z3.get(e?.retailerData?.domainName);t&&s.includes(t)&&(n=(0,oe.Tb)(t,s))}else if(i?.startsWith(a.js)){const e=(0,oe.vU)(i,s);e&&(n=e)}else if(i?.startsWith(a.m7)){const e=(0,oe.AS)(i,s);e&&(n=e)}else n=await De(i);if(n&&""!==n||a.RY.has(e?.retailerData?.domainName)){const o=/(?:#\s*)([^\s|]*)/gi;n=o.exec(n??"")?.at(1)??n??"";const i={email:null,isOrderConfirmationPage:t,orderNumber:n,phoneNumber:null,trackingUrl:e?.retailerData?.orderDetailsPageUrl},r=JSON.stringify(i);F.R.postMessageToHost("ConfirmationPageData",[r,ce])}}catch(e){}}(t,e),M.Z.SendStorageMessage(A.Q.PackageTrackingConfirmationNotifLastShown,JSON.stringify({value:(new Date).toUTCString()})))),F.R.postMessageToHost("ConfirmationPageValidationStatus",[e?"true":"false",ce]),e&&(function(e,t){const o="IS_ELIGIBLE_FOR_REWARDS_"+(0,I.S8)(),i=O.Q?.rawStorageObj[o];if("true"===i&&!ke(t.personalizedCashback)){z.GetEdgeMessageService().ClearStorageValue(o);const e=JSON.stringify({offerid:"coupons_50points_202403"}),t="712",i="1";z.GetEdgeMessageService().ReportRewardsActivity(e,t,i);const r=JSON.stringify({attributes:e,type:t,amount:i});ge(new re.Z((0,I.S8)(),h.oN.AARewards,location.pathname,h.zy.OrderPurchased,r),h.R.ShoppingRewards,"Order Purchased",h.in.Information)}}(0,i),ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),Status:"Success"},"ConfirmationPageValidation","Confirmation page detected",h.in.Information),async function(e,t,o,i,r,a,n,d,g,C,P){const E=Z.Z.GetLocalDataService(),_=E.GetSessionIds()?.retailerSessionId??"",D=E.GetSessionIds()?.pageVisitId??"",N={Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),PageVisitId:D,RetailerSessionId:_};let y;try{if(e?.retailerData?.travelConfirmationPageTelemetry)y=await async function(e,t,o){if(null==e?.retailerData?.travelConfirmationPageTelemetry)return;let i,r=null;const a=e.retailerData.travelConfirmationPageTelemetry;for(const t of a)if(t.confirmationPageUrl&&new RegExp(t.confirmationPageUrl).test((0,I.Ek)())&&(i=await Pe(t,e.retailerData.domainName,e.platform,o),i?.travelConfirmationDetails)){r=i.travelConfirmationDetails;break}let n=u.Z.uuidv4();if(n&&""!==n||(n=Oe()),r){let e=!0;if(r.bookingId){const t=(0,T.Mw)(r.bookingId);t&&Date.now()-Date.parse(t)<12096e5?e=!1:(0,T.Xo)(r.bookingId,Date.now().toString())}if(e){let e="Travel confirmation page telemetry";i?.error&&(e+="; "+i.error);const o=function(e,t,o,i){const r={BookingId:t.bookingId,Currency:t.currency,Domain:(0,I.S8)(),DomainType:t.domainType,EndDate:t.endDate,EventId:o,Name:t.name,OrderConfirmationPageUrl:t.orderConfirmationPageUrl,Price:t.price,RGuid:i?.rGuid,StartDate:t.startDate,IsRoundTrip:t.isRoundTrip,PersonalizationDataConsent:t.personalizationDataConsent},a={};a.JsonData=JSON.stringify(r),a.EventType="TravelConfirmationPageDetails",a.LogLevel="Information",a.Message=e,a.ClientContext={AppInfoClientName:f.Z.GetClientName(),JSVersion:p.yJ},le&&(a.ImpressionId=le);const n=[JSON.stringify(a)];return F.R.postMessageToHost("LogScriptTelemetry",n),r}(e,r,n,t);return await Ae(n,"TravelConfirmationPage"),o}}else ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)()},"ConfirmationPageValidation",(i?.error??" ")+"confirmationpage cart details extraction error.",h.in.Error)}(e,t,g);else if(e?.retailerData?.confirmationPageTelemetry){let r;const E=!!e?.retailerData?.settings?.other?.disableExpiredCartExtraction&&"true"===e.retailerData.settings.other.disableExpiredCartExtraction.toLowerCase(),_=await Te(e.retailerData.confirmationPageTelemetry,e.retailerData.domainName,e.platform,E);r=_?.confirmationDetails||null,r&&(r.personalizationDataConsent=g,r.dynamicTransactionId=O.Q?.DynamicTransactionId);try{if(r&&"primox.de"===(0,I.S8)()){const e="div.payment--content",t=v.Z.GetFirstVisibleElement(e);if(t){const e=t.textContent??"",o=/Transaktionsnummer:(.*?)Gewählte Zahlungsart:/,i=o?.exec(e);if(i){const e=i[1].trim();r.transactionId=e}}}}catch{}let D=u.Z.uuidv4();D&&""!==D||(D=Oe());try{if(r&&!r.transactionId){const t=me(e)??void 0,o=(0,oe.Im)(t),i=(0,oe.RT)(o,(0,I.Ek)());i&&(r.transactionId=i)}}catch(e){}if(r&&(r?.transactionId||r?.purchaseTotal||r?.numberOfItems||r?.productNames)){let u=!0,g="";if(0===e?.retailerData?.domainName.indexOf("amazon")&&(r.transactionId=(0,oe.Tb)("purchaseId",(0,I.Ek)())||""),r?.transactionId&&e?.retailerData?.confirmationPageTelemetry?.isCartCachingEnabled){const e=(0,T.Mw)(r.transactionId);e&&Date.now()-parseInt(e,10)<12096e5?(u=!1,g="do not send data. Expity not reached",(0,T.Xo)(r.transactionId,Date.now().toString())):(0,T.Xo)(r.transactionId,Date.now().toString())}if(P||(u=!1,g="do not send data. PurchaseExtractionService will send data"),u){let u="Confirmation page telemetry";if(e.retailerData.confirmationPageTelemetry.isCartCachingEnabled&&(!r.productNames||!r.purchaseTotal)){const e="no cart data cached";ge(N,"ConfirmationPageValidation",e,h.in.Error),u+=", "+e}if(_?.error&&(u+=", "+_.error),!r.productNames||!r.purchaseTotal||!r.transactionId){const t=`${r.productNames?"":"Empty productNames;"}${r.purchaseTotal?"":"Empty purchaseTotal;"}${r.transactionId?"":"Empty transactionId;"}`;Z.Z.GetHtmlFragmentCollectionService().CollectFragmentOnConfirmationPage(e,C||"",t)}const g=O.Q?.CheckoutPageNavigatedTime;y=function(e,t,o,i,r,a,n,s,c){let l=null,u=null,d=null,p=null,g=!1;const C=window?.windowCallPhantom,S=window?._phantom,m=window?.phantom;document?.documentElement?.hasAttribute("__selenium_unwrapped")&&(l=document.documentElement.getAttribute("__selenium_unwrapped")),document?.documentElement?.hasAttribute("__webdriver_evaluate")&&(u=document.documentElement.getAttribute("__webdriver_evaluate")),document?.documentElement?.hasAttribute("__driver_evaluate")&&(d=document.documentElement.getAttribute("__driver_evaluate")),document?.documentElement?.hasAttribute("$cdc_asdjflasutopfhvcZLmcfl_")&&(p=typeof document.documentElement.getAttribute("$cdc_asdjflasutopfhvcZLmcfl_")),g="undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process?.type||!("undefined"==typeof process||"object"!=typeof process.versions||!process.versions.hasOwnProperty("electron"));let P=t.productNames,f=t.transactionId,E=t.orderConfirmationPageUrl;const T=ee.Z.getFactory()?.getPersonalDataRemover();T&&(f=T.maskDataInAString(f),P=T.maskDataInAString(P),E=T.deleteSecretsInURL(E));const O=Z.Z.GetLocalDataService(),_=O.GetSessionIds()?.retailerSessionId??"",v=O.GetSessionIds()?.pageVisitId??"",R=function(e){try{if(""===e)return;const[t,o]=e.split(" "),[i,r,a]=t.split("-").map(Number),[n,s,c]=o.split(":").map(Number);return new Date(i,r-1,a,n,s,c)}catch(e){return}}(c??"");let D=!1;const N=R&&function(e,t){try{const o=t.getTime()-e.getTime(),i=Math.floor(o/1e3);return Math.floor(i/60)<=2}catch(e){return!1}}(R,new Date)?t?.dynamicTransactionId:"";try{r?.retailerData?.settings?.transactionIdSettings?.shouldAutoGenerate&&(f=N,D=!0)}catch(e){}z.GetEdgeMessageService().SendStorageMessage(A.Q.CheckoutPageNavigatedTime,JSON.stringify({value:""})),z.GetEdgeMessageService().SendStorageMessage(A.Q.DynamicTransactionId,JSON.stringify({value:""}));const y={Currency:t.currency??"",Domain:(0,I.S8)(),DriverEvaluate:d?JSON.stringify(d):"",EventId:o,IsChromeDriver:p??"",IsElectron:g,NavigatorWebdriver:navigator.webdriver??!1,NumberOfItems:t.numberOfItems??"",OrderConfirmationPageUrl:E??"",OrderConfirmationPageUrlRegex:(0,I.og)(E,r.orderConfirmationPageUrlRegex),OrderDiscountCode:t.orderDiscountCode??"",OrderDiscountPrice:t.orderDiscountPrice??"",OrderShippingPrice:t.orderShippingPrice??"",OrderSubTotalPrice:t.orderSubTotalPrice??"",OrderTaxesPrice:t.orderTaxesPrice??"",Platform:r.platform??"",PricePerItem:t.pricePerItem??"",ProductIdSku:t.productIdSku??"",ProductNames:P??"",ProductSellerNames:t.productSellerNames??"",PurchaseTotal:t.purchaseTotal??"",QuantityPerItem:t.quantityPerItem??"",ProductBrandNames:t.productBrandNames??"",PersonalizationDataConsent:t.personalizationDataConsent,Rguid:i?.rGuid??"",SeleniumUnwrapped:l?JSON.stringify(l):"",TransactionId:f??"",WebdriverEvaluate:u?JSON.stringify(u):"",WindowCallPhantom:C?JSON.stringify(C):"",WindowPhantom:m?JSON.stringify(m):"",Window_Phantom:S?JSON.stringify(S):"",DomainCountry:"",RetailerDataDomain:r.retailerData?.domainName??"",ExactConfirmationPageUrl:r.retailerData?.orderConfirmationPageUrl??"",ESF:a,Anid:n??"",ActiveCashbackOffers:i?JSON.stringify(i):"",IsAADSignedIn:s??null,PageUrlFields:me(r)??null,PageVisitId:v??"",RetailerSessionId:_??"",DynamicTransactionId:N??"",IsDynamicTransaction:D??null};return ge(y,"ConfirmationPageDetails",e,h.in.Information),y}(u,r,D,t,e,a,i,n,g),await async function(e,t,o,i,r){if(e&&t.transactionId&&""!==t.transactionId&&t.productNames&&""!==t.productNames){const n=t.transactionId,s=i.retailerData.domainName,u=t.currency,d=t.purchaseTotal?Number(t.purchaseTotal.replace(/[^0-9\.]+/g,"")):0,g=t.numberOfItems?Number(t.numberOfItems):0,C=t.productNames,S=t.pricePerItem?.replace(/[^0-9\,]+/g,"")??null;let m="",A="",P="";if(o?.adsCashback&&o?.adsCashback?.length>0?(m=s,A="BingPersonalization"):r&&r.merchantId&&""!==r.merchantId&&r.affiliateNetwork&&""!==r.affiliateNetwork&&(m=r.merchantId,A=r.affiliateNetwork),r&&r.merchantFullName&&""!==r.merchantFullName&&(P=r.merchantFullName),""!==m&&""!==A){const t="https://www.bing.com/api/shopping/v1/savings/cashback/instant";var a;try{a=await function(e,t,o,i,r,a,n,s,u,d,h){return{Anid:e,CashbackAmount:0,Currency:n,Domain:a,MerchantName:o,MerchantId:i,AffiliateName:r,PurchaseTotal:s,NumOfItems:u,ProductNames:d,PricePerItem:h,TransactionDate:(new Date).toISOString(),TransactionId:t,Country:"",ClientContext:new l.Z(f.Z.GetClientName(),p.yJ,f.Z.GetBuildVersion(),f.Z.enabledServiceFlights,c.R.GetServiceExperiments(),void 0,c.R.GetExpRawData())}}(e,n,P,m,A,s,u,d,g,C,S);const o={body:JSON.stringify(a),headers:{"Content-Type":"application/json"},method:"POST"},i=await fetch(t,o);await i.json(),200===i.status&&be()}catch(e){!async function(e,t,o){if(ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({error:e})},"ConfirmationPageValidation",`Instant cash back call failed. ${o?"Making call through client using FetchShoppingApi instead":"requestBody not defined"}.`,h.in.Information),o){const e=[t,JSON.stringify(o)];F.R.postMessageToHost("FetchShoppingApi",e),be()}}(e,t,a)}}}}(i,r,t,e,o);const P=new RegExp(e.retailerData.orderConfirmationPageUrl,"i").test((0,I.Ek)());if(!(0,te.XB)()&&(b=r)&&b.transactionId&&b.purchaseTotal&&b.productNames&&o?.userRebateResponse?.isRebatesUser&&P)if(ke(t)){const o=se(se({},N),{},{DebugData:JSON.stringify({Source:"isInSessionClick",PersonalizedCashbackData:t,NotificationLastShownCount:O.Q?.PcbNotificationLastShownAdCount})});z.GetEdgeMessageService().TrySendAutoShowFeaturesAvailableMessage(m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION,S.sM.CASHBACKCONFIRMATION)?ge(o,"ConfirmationPageValidation","ConfirmationPageNotification PP cashback",h.in.Information):pe(o,m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION);const i=O.Q?.PcbNotificationLastShownAdCount??{};i&&(i[e?.retailerData.domainName]=null,z.GetEdgeMessageService().SendStorageMessage(A.Q.PcbNotificationLastShownAdCount,JSON.stringify({value:i})))}else if(function(e,t){const o=e?.adsCashback?.length>0&&""!==e?.adsCashback[0].commissionValue&&""!==e?.adsCashback[0].commissionType,i=O.Q?.PcbNotificationLastShownAdCount;let r={};return(!i||(r=i,"1"!==i[t]))&&(r[t]="1",z.GetEdgeMessageService().SendStorageMessage(A.Q.PcbNotificationLastShownAdCount,JSON.stringify({value:r})),o)}(t,e?.retailerData.domainName)){const e=se(se({},N),{},{DebugData:JSON.stringify({Source:"wasNotificationAlreadyShown",PersonalizedCashbackData:t,NotificationLastShownCount:O.Q?.PcbNotificationLastShownAdCount})});z.GetEdgeMessageService().TrySendAutoShowFeaturesAvailableMessage(m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION,S.sM.CASHBACKCONFIRMATION)?ge(e,"ConfirmationPageValidation","ConfirmationPageNotification PP cashback",h.in.Information):pe(e,m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION)}else ge(se(se({},N),{},{DebugData:JSON.stringify({PersonalizedCashbackData:t,NotificationLastShownCount:O.Q?.PcbNotificationLastShownAdCount})}),"ConfirmationPageValidation","ConfirmationPageNotification already shown",h.in.Information);else(0,te.XB)()||ge(se(se({},N),{},{DebugData:JSON.stringify({UserRebatesResponse:JSON.stringify(o?.userRebateResponse??{}),TransactionId:r?.transactionId,PurchaseTotal:r?.purchaseTotal,ProductNames:r?.productNames,IsConfirmationPage:P})}),"ConfirmationPageValidation","Data not valid for confirmation autoshow",h.in.Information);if(c.R.isExperimentActive(s.H.enrollToRebateBonus)&&P&&r?.purchaseTotal&&parseFloat(r.purchaseTotal.substring(1))>=50&&!o?.userRebateResponse?.isRebatesUser&&d&&(z.GetEdgeMessageService().TrySendAutoShowFeaturesAvailableMessage(m.sR.AUTO_SHOW_MOMENT_IN_TIME,S.sM.ENROLL_TO_CASHBACK_CONFIRMATION_NOTIFICATION)||pe({},m.sR.AUTO_SHOW_MOMENT_IN_TIME)),await Ae(D,"ConfirmationPage"),e?.retailerData?.confirmationPageTelemetry?.isCartCachingEnabled){const t=e?.retailerData?.exactConfirmationPageUrl;if(t)try{new RegExp(t,"i").test((0,I.Ek)())&&(Ne("Deleting cart data. exactConfirmationPageUrl matched"),(0,T.UZ)(R.OY),ye(e.retailerData.domainName))}catch(t){Ne("Deleting cart data. Error with regex"),(0,T.UZ)(R.OY),ye(e.retailerData.domainName)}else Ne("Deleting cart data. No exactConfirmationPageUrl"),(0,T.UZ)(R.OY),ye(e.retailerData.domainName)}}else ge(se(se({},N),{},{DebugData:JSON.stringify({ConfirmationPageDetails:r})}),"ConfirmationPageValidation",g,h.in.Error)}else ge(se(se({},N),{},{DebugData:JSON.stringify({ConfirmationPageDetails:r,errorMsg:_?.error||""})}),"ConfirmationPageValidation","Confirmationpagedetails no data extracted",h.in.Error);try{await async function(e){try{if(null==e.retailerData?.allAutomatedSelectors)return void Ne("PersonalizedPromotions Error",{message:"no automated selectors"});const t=e.retailerData.allAutomatedSelectors,o=(0,I.Ek)();for(const i of t)if(i?.type===h.u3.PurchaseConfirmed&&new RegExp(i.urlRegex?.toLowerCase()??"").test(o.toLowerCase())){if(null===i.details||0===Object.keys(i.details).length)continue;return void fe(i,e.retailerData.domainName)}Ne("PersonalizedPromotions Error",{message:"no PurchaseConfirmed selectors found"})}catch(e){Ne("PersonalizedPromotions Error",{message:"catch error",error:e})}}(e),(0,T.UZ)(k.Vj),function(e){try{const t=O.Q?.PersonalizedPromotionsCartData??"",o=(0,I.BQ)(t)??{};o[e]={};const i=JSON.stringify({value:JSON.stringify(o)});z.GetEdgeMessageService().SendStorageMessage(A.Q.PersonalizedPromotionsCartData,i)}catch(e){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)()},"ConfirmationPageValidation",(e?.message??" ")+"error deleting persistent cart data",h.in.Error)}}(e.retailerData.domainName)}catch(e){ge(N,"ConfirmationPageValidation","Error when extracting automated selectors: "+(e?.message??""),h.in.Error)}}}catch(e){ge(N,"ConfirmationPageValidation",(e?.message??" ")+"confirmationpage cart details extraction error.",h.in.Error)}var b}(t,o,i,n,0,g,C,P,E,D,N))}function me(e){try{const t=e?.retailerData?.allAutomatedSelectors||[],o=(0,I.Ek)();for(const e of t)if(e?.type===h.u3.PurchaseConfirmed&&new RegExp(e.urlRegex).test(o.toLowerCase()))return e?.urlFields}catch(e){}return null}async function Ae(e,t){let o="",i="";await(0,P._R)(1e3);const r=document.querySelectorAll('[id^="batBeacon"] > img');if(r)for(const e of r)if(e?.currentSrc){const t=new URL(e.currentSrc),r=t?.searchParams.get("mid"),a=t?.searchParams.get("ti");r&&a&&(o+=r+",",i+=a+",")}o=o.length>0?o.substring(0,o.length-1):"",i=i.length>0?i.substring(0,i.length-1):"",ge({Domain:(0,I.S8)(),EventId:e,ImpressionId:le,Mid:o,PageType:t,TagId:i},"ConfirmationPageUetEvent","ConfirmationPage UET Event",h.in.Information)}async function Pe(e,t,o,i){if(!e)return null;const a=new q;let n,s,c,l,u,d=0,p="";a.personalizationDataConsent=i,a.orderConfirmationPageUrl=(0,I.Ek)(),a.domainType=a.domainType;try{let e=Z.Z.GetCartExtractionService().GetLastTravelData();if(e)p+="cached:"+JSON.stringify(e??{})+"; ";else{const o=O.Q?.PersistentTravelData,i=((0,I.BQ)(o)??{})[t]??{},r=i?.travelDataStorageInfo??{};p+="persistent:"+JSON.stringify(r)+";",r&&Object.keys(r).length&&(e=r)}if(e){if(d+=e.Price,a.currency=e.Currency,a.domainType=e.DomainType,c="",l="",u="",e.flightLegs)for(const t of e.flightLegs)t.startDate&&(c+=t.startDate+"<SEP>"),t.endDate&&(l+=t.endDate+"<SEP>"),t.name&&(u+=t.name+"<SEP>");else e.StartDate&&(c=e.StartDate),e.EndDate&&(l=e.EndDate),u=e.Name;a.name=u,a.startDate=c,a.endDate=l}}catch(e){p+="error getting travel data from checkout: "+e+";",ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)()},"ConfirmationPageValidation",p,h.in.Error)}if(e.bookingIdSelector&&""!==e.bookingIdSelector&&(s=M.Z.GetBoxValue(e.bookingIdSelector),s&&(a.bookingId=s)),e.nameSelector&&""!==e.nameSelector&&(u=M.Z.GetBoxValue(e.nameSelector),u&&(a.name=u)),e.totalPriceSelector&&""!==e.totalPriceSelector&&(n=M.Z.GetBoxValue(e.totalPriceSelector),n)){a.price=n;const e=(0,E.cU)(n,!0);(0,r.TF)(e)||(a.currency=e)}if(a.price&&""!==a.price||(a.price=d.toString()),e.startDateSelector&&""!==e.startDateSelector&&(c=M.Z.GetBoxValue(e.startDateSelector),c&&(a.startDate=c)),e.endDateSelector&&""!==e.endDateSelector&&(l=M.Z.GetBoxValue(e.endDateSelector),l&&(a.endDate=l)),e.isRoundTripSelector&&""!==e.isRoundTripSelector){const t=M.Z.GetBoxValue(e.isRoundTripSelector);t&&(a.isRoundTrip=t)}return a.bookingId&&""!==a.bookingId||(p+="no bookingId; "),a.domainType&&""!==a.domainType||(a.domainType=e.domainType),{travelConfirmationDetails:a,error:p}}async function fe(e,t){try{if(!e)return void Ne("PersonalizedPromotions Error",{message:"no automated selectors for personalized promotions pipeline found, aborting"});if(e?.type!==h.u3.PurchaseConfirmed)return void Ne("PersonalizedPromotions Error",{message:"Not a confirmation page, pageType: "+e?.type});if(null===e.details)return void Ne("PersonalizedPromotions Error",{message:"No selectors provided for page url"});const o=new b.Z;if(o.domain=t,o.pageType=e.type,o.pageUrl=(0,I.Ek)(),o.orderId=M.Z.GetBoxValue(e.details.orderId),o.orderTotal=Ee(e.details.orderTotalPrice),o.orderSubtotal=M.Z.GetBoxValue(e.details.orderSubTotalPrice),o.productName=await _e(e.details.productName),o.productItemPrice=await _e(e.details.productItemPrice),o.productTotalPrice=await _e(e.details.productTotalPrice),o.productPrice=await _e(e.details.productPrice),o.productQuantity=await _e(e.details.productQuantity),o.productId=await _e(e.details.productId),(0,r.TF)(o.productName)&&"true"===e.details.getProductNamesFromImg&&e.details.productImgSelector){const t=v.Z.RunQuerySelectorAll(e.details.productImgSelector);let i="";for(const e of t){const t=e?.getAttribute("alt");t&&(i+=t+"<SEP>")}o.productNameFromImg=i}o.pageUrlFields=e.urlFields;const i="Successfully extracted Personalized Promotions Purchase Confirmation Information";ge(o,h.R.ShoppingPersonalizedPromotionsRawTable,i,h.in.Information)}catch(e){Ne("PersonalizedPromotions Error",{message:"catch error",error:e})}}function Ee(e){let t="";if(e&&e.includes(",")){const i=e.split(",").reverse();let r=!1;for(const e of i){const i=M.Z.GetBoxValue(e);if(i&&(o=i,new RegExp("/[0-9]/").test(o))){r=!0,t=i;break}}r||(t=M.Z.GetBoxValue(e))}else t=M.Z.GetBoxValue(e);var o;return t?t.trim():""}async function Te(e,t,o,i=!1){const a=Z.Z.GetLocalDataService(),n=a.GetSessionIds()?.retailerSessionId??"",s=a.GetSessionIds()?.pageVisitId??"",c={Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),PageVisitId:s,RetailerSessionId:n};if(!e)return ge(c,"ConfirmationPageValidation","ConfirmationTelemetry selectors not found",h.in.Information),null;ge(c,"ConfirmationPageValidation","Data extraction started",h.in.Information);const l=new B.Z;let d,p,g,C,S,m,A,f,T;const _=e.orderIdSelectors??"";let D="";l.orderConfirmationPageUrl=(0,I.Ek)(),S="";try{if(e.isCartCachingEnabled){const e=Z.Z.GetCartExtractionService();let o=e.GetLastCartData();const r=e.GetFastCart(),a=void 0!==o?.Products?.find((e=>!e.productTitle||""===e.productTitle));if(o||(D+="Cart data from local storage is empty;"),r&&(D+="fastCart:"+JSON.stringify(r??{})+";"),!o||null==o.Products||o.Products?.length<=0||a){const e=O.Q?.PersistentCartData,i=((0,I.BQ)(e)??{})[t]??{},r=i?.cartDataStorageInfo??{};D+="persistent:"+JSON.stringify(r)+"; ";const a=void 0!==r?.Products?.find((e=>!e.productTitle||""===e.productTitle));o=Object.keys(r).length&&!a?r:null}else D+="cached:"+JSON.stringify(o??{})+"; ";const n=Boolean(o&&Date.now()-o.CartDataCreationTime<=R.l$);if(!o||!n&&i)D+=`No cached cart data found; isCardDataPresent: ${!!o}; isNotExpiredCart: ${n}; Time: ${Date.now().toString()};`,ge(c,"ConfirmationPageValidation",D,h.in.Error);else{D+="Using cached cart data; ";const e="<SEP>";let t=0;g="",C="",m="",A="",T="";const i=void 0!==o?.Products?.find((e=>!0===e.buyNowItem));if(o.Products){l.numberOfItems=o.Products?.length.toString();for(const r of o.Products)i&&!0!==r.buyNowItem||(r.productTitle&&(g+=r.productTitle+e),r.productPrice&&(t+=r.productPrice,m+=o.Currency+r.productPrice?.toString()+e),r.productQuantity&&(A+=r.productQuantity?.toString()+e),r.productSeller&&(C+=(r.productSeller?.replace("Sold by:","")||"")+e),T+=(r.productBrand??"")+e)}g=g?g.trim():g,g&&(l.productNames=g),null!==m&&""!==m&&(l.pricePerItem=m),null!==A&&""!==A&&(l.quantityPerItem=A),o&&o.ProductIds&&""!==o.ProductIds&&(l.productIdSku=o.ProductIds),o&&o.ProductUrls&&""!==o.ProductUrls&&(l.productUrls=o.ProductUrls),C&&(l.productSellerNames=C),T&&(l.productBrandNames=T),void 0!==o.Currency&&(null==o.OrderTotal||isNaN(o.OrderTotal)||o.OrderTotal<0?l.purchaseTotal=o.Currency+t.toString():l.purchaseTotal=o.Currency+o.OrderTotal.toString(),l.currency=o.Currency),null!=o.OrderSubTotal&&!isNaN(o.OrderSubTotal)&&o.OrderSubTotal>=0&&(l.orderSubTotalPrice=o.Currency+o.OrderSubTotal.toString())}}else D+="cart caching not enabled;"}catch(e){D+="error during cart extraction from cache: "+e+"; ",ge(c,"ConfirmationPageValidation",D,h.in.Error)}if(e?.productDetailsData?.length&&e?.productDetailsData?.length>0){g="",m="",A="",f="";let o=0;for(const i of e?.productDetailsData){if("microsoft.com"===t){const e="div[class*='lineItemRow']",t="div[class*='bundleItems']";await(0,P.dz)((async()=>void 0!==v.Z.GetFirstVisibleElement(e)),5e3);const r=v.Z.RunQuerySelectorAll(e);if(r&&r.length>0)for(const e of r)if(null==v.Z.GetFirstVisibleElement(t,e)){await(0,P.dz)((async()=>void 0!==v.Z.GetFirstVisibleElement(i?.productIdSelector??"",e)),5e3);let t=v.Z.GetFirstVisibleElement(i?.productPriceSelector??"",e);t&&t.textContent&&(m+=t.textContent?.trim()+"<SEP>"),t=v.Z.GetFirstVisibleElement(i?.productIdSelector??"",e),t&&t.textContent&&(g+=t.textContent?.trim()+"<SEP>",o++),t=v.Z.GetFirstVisibleElement(i?.productQuantitySelector??"",e),t&&t.textContent&&(A+=t.textContent?.trim()+"<SEP>")}o>0&&(S=o.toString())}if("microsoft.com"!==t||""===g){const e="wayfair.com"===t?1e4:5e3;if(i?.productIdSelector&&""!==i?.productIdSelector){let t;await(0,P.dz)((async()=>(t=v.Z.GetFirstVisibleElement(i?.productIdSelector??""),void 0!==t)),e);let r=v.Z.RunQuerySelectorAll(i?.productIdSelector??"");if(r.length>0)for(const e of r)e&&e.textContent&&(g+=e.textContent?.trim()+"<SEP>",o++);else{r=Re(i?.productIdSelector??"");for(const e of r)e&&e.textContent&&(g+=e.textContent?.trim()+"<SEP>",o++)}}m=await Ie(i,t),A=await _e(i?.productQuantitySelector,0),f=await _e(i?.productIdSkuSelector,0),o>0&&(S=o.toString())}}if(g=g?g.trim():g,g&&(l.productNames=g),null!==m&&""!==m)l.pricePerItem=m;else if("jossandmain.com"===t&&null!==g){D+="no price per item but there are product names;";for(const o of e?.productDetailsData)m=await Ie(o,t);D+=m+";",l.pricePerItem=m}null!==A&&""!==A&&(l.quantityPerItem=A),null!==f&&""!==f&&(l.productIdSku=f)}const N=await async function(e){try{if(!e)return"";const t=(0,oe.ql)(e,(0,I.Ek)());if(t)return t;const o=await async function(e){const t=(e?.split(",")??[]).filter((e=>!(0,oe.Ae)(e))).join(",");let o=await(0,P.dz)((async()=>v.Z.HasVisibleElement(t)),5e3).then((()=>M.Z.GetBoxValue(t))).catch((e=>M.Z.GetBoxValue(t)));return o=M.Z.GetBoxValue(t),o}(e);return o}catch(t){Ne("Error getting transaction id",{message:t.message,transactionIdSelector:e??""})}return""}(e?.transactionIdSelector);if(l.transactionId=N,"replacements.com"===t||"us.puma.com"===t&&!l.transactionId){let e=u.Z.uuidv4();e&&""!==e||(e=Oe());const t=Date.now()+"_"+e;l.transactionId=t}try{!_||""===_||l.transactionId&&""!==l.transactionId||(p=await De(_),l.transactionId=p)}catch(e){}if(null!==S&&""!==S?l.numberOfItems=S:e?.transactionIdSelector&&""!==e?.transactionIdSelector&&(S=M.Z.GetBoxValue(e?.numItemsSelector??""),null!=S&&""!==S&&(l.numberOfItems=S)),l.orderDiscountCode=ve(e?.orderDiscountCodeSelector),l.orderDiscountPrice=ve(e?.orderDiscountPriceSelector),l.orderShippingPrice=ve(e?.orderShippingPriceSelector),l.orderTaxesPrice=ve(e?.orderTaxesPriceSelector),l.orderSubTotalPrice=ve(e?.orderSubTotalPriceSelector),e?.purchaseTotalSelector&&""!==e?.purchaseTotalSelector){if("petsmart.com"===t||"jlobeauty.com"===t||"homedepot.com"===t||"shopify"===o){const t=e?.purchaseTotalSelector;d=await(0,P.dz)((async()=>v.Z.HasVisibleElement(t)),5e3).then((()=>M.Z.GetBoxValue(t))).catch((e=>M.Z.GetBoxValue(t)))}else d=Ee(e.purchaseTotalSelector);try{if(d){const e=(0,E.K)(d);!isNaN(e)&&e>0&&(l.purchaseTotal=d);const t=(0,E.cU)(d,!0);(0,r.TF)(t)||(l.currency=t)}else if(l.pricePerItem&&""!==l.pricePerItem){const e=(0,E.cU)(l.pricePerItem,!0);(0,r.TF)(e)||(l.currency=e)}}catch(e){Ne("Error extracting currency",{message:"Could not extract currency: "+e})}}if(("wayfair.com"===t||e.isCartCachingEnabled||"jossandmain.com"===t)&&(void 0===l.purchaseTotal||""===l.purchaseTotal))try{const e=O.Q?.CartValues,o=((0,I.BQ)(e)??{})[t]??{},i=o?.cartValue??{};i&&i.OrderTotal&&i.OrderTotal>=0&&(l.purchaseTotal=i.Currency+i.OrderTotal.toString(),l.currency=i.Currency),D+="got purchaseTotal from CartValue "+l.purchaseTotal+"; "}catch(e){D+="error getting purchaseTotal from cart: "+e}if(!("walmart.com"!==t&&0!==t.indexOf("amazon")||null!=l.productNames&&""!==l.productNames)&&e?.productDetailsData){if(g="",e.productDetailsData.length>0){const t=e.productDetailsData[0].productImageSelector;if(null!=t){const e=v.Z.RunQuerySelectorAll(t);for(const t of e){const e=t.getAttribute("alt");g+=e?.trim()+"<SEP>"}}}g=g?g.trim():g,g&&(l.productNames=g,D+="got productNames from productImage: "+g+";")}return ge(c,"ConfirmationPageValidation","Data extraction complete",h.in.Information),{confirmationDetails:l,error:D}}function Oe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}async function Ie(e,t){let o="";if(e?.productPriceSelector&&""!==e?.productPriceSelector){let i,r=[],a=5e3;"wayfair.com"===t&&(a=1e4),await(0,P.dz)((async()=>(i=v.Z.GetFirstVisibleElement(e?.productPriceSelector??""),void 0!==i)),a),r=v.Z.RunQuerySelectorAll(e?.productPriceSelector);for(const e of r)e&&e.textContent&&(o+=e.textContent?.trim()+"<SEP>");if((!r||0===r.length)&&(r=Re(e?.productPriceSelector??""),r.length>0))for(const e of r)e&&e.textContent&&(o+=e.textContent?.trim()+"<SEP>")}return o}async function _e(e,t=5e3){let o="";if(e&&""!==e){let i,r=[];await(0,P.dz)((async()=>(i=v.Z.GetFirstVisibleElement(e??""),void 0!==i)),t),r=v.Z.RunQuerySelectorAll(e);for(const e of r)e&&e.textContent&&(o+=e.textContent?.trim()+"<SEP>");if((!r||0===r.length)&&(r=Re(e??""),r.length>0))for(const e of r)e&&e.textContent&&(o+=e.textContent?.trim()+"<SEP>")}return o}function ve(e){if(e&&""!==e){const t=M.Z.GetBoxValue(e);if(null!=t&&""!==t)return t}return null}function Re(e){return e&&""!==e?document.getElementsByClassName(e):[]}async function De(e){if(!e)return"";try{return await(0,P.dz)((async()=>v.Z.HasVisibleElement(e)),5e3).then((()=>{const t=e.split(";");for(const e of t){const t=M.Z.GetBoxValue(e);if(null!=t&&""!==t)return t}return""})).catch((e=>""))}catch(e){}return""}function Ne(e,t=void 0){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:t?JSON.stringify(t):""},"ConfirmationPageValidation",e,h.in.Information)}function ye(e){try{const t=O.Q?.PersistentCartData??"",o=(0,I.BQ)(t)??{};o[e]={};const i=JSON.stringify({value:JSON.stringify(o)});z.GetEdgeMessageService().SendStorageMessage(A.Q.PersistentCartData,i);const r=O.Q?.CartValues??"",a=(0,I.BQ)(r)??{};a[e]={};const n=JSON.stringify({value:JSON.stringify(a)});z.GetEdgeMessageService().SendStorageMessage(A.Q.CartValues,n)}catch(e){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)()},"ConfirmationPageValidation",(e?.message??" ")+"error deleting persistent cart data",h.in.Error)}}function be(){"EligibleUser"===O.Q.BlossomCampaignUserStatus&&(z.GetEdgeMessageService().SendStorageMessage(A.Q.BlossomShouldShowNotification,JSON.stringify({value:"true"})),z.GetEdgeMessageService().SendStorageMessage(A.Q.BlossomShouldShowPostPurchaseUX,JSON.stringify({value:"true"})),z.GetEdgeMessageService().SendStorageMessage(A.Q.BlossomCampaignUserStatus,JSON.stringify({value:"OfferClaimed"})),z.GetEdgeMessageService().SendStorageMessage(A.Q.BlossomCampaignUserStatusTimestamp,JSON.stringify({value:(new Date).getTime().toString()})))}function ke(e){return e&&e.isAdClick&&e.commissionType&&e.commissionValue}function Ue(e){return e&&""!==e?["https://","http://","www."].some((t=>e.startsWith(t)))?e:location.origin+e:""}function we(e,t,o){try{const i=function(e,t){if(!t||!t.Products?.length)return void ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)()},"ConfirmationPageValidation","createPostPurchaseProducts: CartData not found.",h.in.Information);const o=[],i=[];for(const r of t.Products){const a=r.productTitle?r.productTitle:r.foundInWebAssist&&r.webAssistTitle?r.webAssistTitle:"",n=r.productImg?r.productImg:r.foundInWebAssist&&r.webAssistImg?r.webAssistImg:"",s=r.productPrice?r.productPrice:r.foundInWebAssist&&r.webAssistPrice?r.webAssistPrice:0,c=t?.Currency??"",l=Ue(r.productUrl),u=!!a.length&&0!==s&&!!l.length,d={Title:a,ImageUrl:n,Price:s,Currency:c,Muid:e,Url:l,isValid:u};u?o.push(d):i.push(d)}if(i?.length){const e=O.Q?.PostPurchasePathnameProducts,r=[];if(e){for(const t of i)if(t.Title.length)for(const o of e)t.Title===o.productTitle&&(t.ImageUrl=o.productImg,t.Price=o.productPrice,t.Url=Ue(o.productUrl),t.isValid=!!t.Title.length&&0!==t.Price&&!!t.Url.length,t.isValid&&r.push(t));const a={Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({cartProducts:t?.Products,validProducts:o,invalidProducts:i,fixedProducts:r,pathnameProducts:e})};o.push(...r);let n="createPostPurchaseProducts: Invalid product(s) were ";r.length===i.length?n+="all fixed":r.length?n+="partially fixed":n+="not fixed",ge(a,"ConfirmationPageValidation",n,h.in.Information),z.GetEdgeMessageService().SendStorageMessage(A.Q.PostPurchasePathnameProducts,JSON.stringify([]))}else ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({cartProducts:t?.Products,validProducts:o,invalidProducts:i,fixedProducts:r,pathnameProducts:e})},"ConfirmationPageValidation","createPostPurchaseProducts: Invalid product(s) were found with no pathname products",h.in.Information)}return o}(t,e);if(void 0===i)return;return i&&i.length?{headers:{"Content-Type":"application/json",Source:"ProductTracking",Service:o},method:"POST",body:JSON.stringify({Muid:t,Products:i,TrackingSource:2})}:void ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({CartProducts:e?.Products,products:i,service:o})},"ConfirmationPageValidation","createPostPurchaseRequest: No request body",h.in.Error)}catch(e){ge({Domain:(0,I.S8)(),PageUrl:(0,I.Ek)(),DebugData:JSON.stringify({e:e})},"ConfirmationPageValidation","createPostPurchaseRequest: Uncaught error",h.in.Error)}}window.CheckAndIsConfirmationPageValid=function(e,t){(0,I.cz)()||ue(e,t)},window.IsConfirmationPageValid=ue,window.confirmationPageValidatorRuntime=F.R},69315:function(e,t,o){o.d(t,{R:function(){return a}});var i=o(89366);class r extends i.Z{initializeRuntime(e){"complete"===document.readyState?window.IsConfirmationPageValid(e,!1):window.addEventListener&&window.addEventListener("load",(t=>{window.CheckAndIsConfirmationPageValid(e,!1)}))}handleMessages(e,t){if("ConfirmationPageValidation"===t)try{"complete"===document.readyState?window.IsConfirmationPageValid(e,!0):window.addEventListener&&window.addEventListener("load",(t=>{window.CheckAndIsConfirmationPageValid(e,!0)}))}catch(e){}}getNativeHandler(){return confirmationPageValidatorNativeHandler}}const a=new r},9448:function(e,t,o){o.d(t,{H:function(){return i}});let i=function(e){return e.CheckoutPageValidationError="CheckoutPageValidationError",e.LogScriptTelemetry="LogScriptTelemetry",e.PageStatus="PageStatus",e.CheckoutPageGMV="CheckoutPageGMV",e.ExpressCheckoutPageGMV="ExpressCheckoutPageGMV",e.CheckoutPageValidationStatus="CheckoutPageValidationStatus",e.PurchaseCompleted="PurchaseCompleted",e.SetStorageValue="SetStorageValue",e.GuestDomain="GuestDomain",e.BackgroundAutoApplyStateValid="BackgroundAutoApplyStateValid",e.PlatformExpansionDomain="PlatformExpansionDomain",e.UpdateAddressBar="UpdateAddressBar",e.RecordShoppingUserEngagement="RecordShoppingUserEngagement",e.RecordShoppingUserAction="RecordShoppingUserAction",e.GetCashBack="GetCashBack",e.NavigateToUrlBackground="NavigateToUrlBackground",e.StartEdgeDriver="StartEdgeDriver",e.UpdateLoadTimeData="UpdateLoadTimeData",e}({})},79249:function(e,t,o){var i=o(72370),r=o(23727),a=o(57021);class n extends a.Z{constructor(...e){super(...e),(0,i.Z)(this,"StartTime",void 0),(0,i.Z)(this,"CouponsApplied",void 0),(0,i.Z)(this,"ContextID",void 0),(0,i.Z)(this,"InitialPrice",void 0),(0,i.Z)(this,"TrueInitialPrice",void 0),(0,i.Z)(this,"UnremovedDiscountSum",void 0),(0,i.Z)(this,"BestCoupon",void 0),(0,i.Z)(this,"MaxDiscount",void 0),(0,i.Z)(this,"CouponResults",void 0),(0,i.Z)(this,"ImpressionId",void 0),(0,i.Z)(this,"StringifiedMap",void 0),(0,i.Z)(this,"ImportOptions",void 0),(0,i.Z)(this,"Currency",void 0),(0,i.Z)(this,"PageCurrency",void 0),(0,i.Z)(this,"CashBackActive",void 0),(0,i.Z)(this,"AppliedCoupon",void 0),(0,i.Z)(this,"BackgroundAACancelled",void 0),(0,i.Z)(this,"BackgroundAAStatus",void 0),(0,i.Z)(this,"SuggestedCoupons",void 0),(0,i.Z)(this,"ExtractedInputBox",void 0),(0,i.Z)(this,"ExtractedApplyButton",void 0),(0,i.Z)(this,"ExtractedOrderTotalElement",void 0),(0,i.Z)(this,"CartBlockedCoupons",void 0),(0,i.Z)(this,"HideProgressOverlay",void 0),(0,i.Z)(this,"Metadata",void 0)}static CreateNew(e,t){const o=new n(n.fourMinutesExpiryInSeconds);return o.ContextID=e,o.StartTime=Date.now(),o.CouponsApplied=new Map,o.UnremovedDiscountSum=0,o.MaxDiscount=0,o.CouponResults=[],o.BackgroundAAStatus=new r.Z,t&&(o.ImpressionId=t),o}static CreateFromObject(e){if(e&&null!==e.ContextID&&void 0!==e.ContextID){const t=n.CreateNew(e.ContextID);return e.StringifiedMap&&JSON.parse(e.StringifiedMap).forEach((e=>{const o=e[0],i=e[1];t.CouponsApplied.set(o,i)})),e.BestCoupon&&(t.BestCoupon=e.BestCoupon),null!==e.InitialPrice&&void 0!==e.InitialPrice&&(t.InitialPrice=e.InitialPrice),e.TrueInitialPrice&&(t.TrueInitialPrice=e.TrueInitialPrice),e.UnremovedDiscountSum&&(t.UnremovedDiscountSum=e.UnremovedDiscountSum),null!==e.MaxDiscount&&void 0!==e.MaxDiscount&&(t.MaxDiscount=e.MaxDiscount),e.CouponResults&&(t.CouponResults=e.CouponResults),e.ImpressionId&&(t.ImpressionId=e.ImpressionId),e.ImportOptions&&(t.ImportOptions=e.ImportOptions),e.CashBackActive&&(t.CashBackActive=e.CashBackActive),e.Currency&&(t.Currency=e.Currency),e.PageCurrency&&(t.PageCurrency=e.PageCurrency),e.StartTime&&(t.StartTime=e.StartTime),e.AppliedCoupon&&(t.AppliedCoupon=e.AppliedCoupon),e.BackgroundAACancelled&&(t.BackgroundAACancelled=e.BackgroundAACancelled),e.BackgroundAAStatus&&(t.BackgroundAAStatus=e.BackgroundAAStatus),e.SuggestedCoupons&&(t.SuggestedCoupons=e.SuggestedCoupons),e.ExtractedInputBox&&(t.ExtractedInputBox=e.ExtractedInputBox),e.ExtractedApplyButton&&(t.ExtractedApplyButton=e.ExtractedApplyButton),e.ExtractedOrderTotalElement&&(t.ExtractedOrderTotalElement=e.ExtractedOrderTotalElement),e.CartBlockedCoupons&&(t.CartBlockedCoupons=e.CartBlockedCoupons),e.HideProgressOverlay&&(t.HideProgressOverlay=e.HideProgressOverlay),e.Metadata&&(t.Metadata=e.Metadata),t}return null}StringifyMap(){this.StringifiedMap=JSON.stringify(Array.from(this.CouponsApplied.entries()))}ToString(){return this.StringifyMap(),JSON.stringify(this)}}(0,i.Z)(n,"fourMinutesExpiryInSeconds",480),t.Z=n},8018:function(e,t,o){o.d(t,{c:function(){return i}});let i=function(e){return e.Confirmation="confirmation",e.Activated="activated",e.Search="search",e.Category="category",e.CategoryAutoshow="categoryAutoshow",e.PDP="pdp",e.SearchSPB="searchSPB",e.ActivatedOffers="activatedoffers",e.GroceryAutoShow="groceryAutoShow",e.PdpSPB="pdpSPB",e.AddedToCartPDP="AddedToCartPDP",e.SpbHomePage="SpbHomePage",e.CartPageNotification="CartPageNotification",e.SpbCartPageNotification="SpbCartPageNotification",e}({})},44445:function(e,t,o){o.d(t,{a:function(){return n}});var i=o(89366),r=function(e){return e.StartAutoApply="StartAutoApply",e.GetZipUrlStatus="GetZipUrlStatus",e.UpdatePaymentDetails="UpdatePaymentDetails",e.WalletMessageFromHost="WalletMessageFromHost",e.BgaaMessageFromHost="BgaaMessageFromHost",e.RewardsPromotionsAvailable="RewardsPromotionsAvailable",e}(r||{});class a extends i.Z{initializeRuntime(e){window.SendSequenceSupportedMessage(),"interactive"===document.readyState||"complete"===document.readyState?window.TryExecuteAutoApply(e,!1):window.addEventListener&&window.addEventListener("DOMContentLoaded",(t=>{window.CheckAndExecuteAutoApply(e,!1)}))}handleMessages(e,t){switch(r[t]){case r.StartAutoApply:try{"interactive"===document.readyState||"complete"===document.readyState?window.TryExecuteAutoApply(e,!0):window.addEventListener&&window.addEventListener("DOMContentLoaded",(t=>{window.CheckAndExecuteAutoApply(e,!0)}))}catch(e){}break;case r.GetZipUrlStatus:window.handleBNPLResult(e[0]);break;case r.UpdatePaymentDetails:window.ExecuteUpdatePaymentDetails(e);break;case r.WalletMessageFromHost:window.HandleWalletMessageFromHost(e[0],e[1]);break;case r.BgaaMessageFromHost:const o=e[0];"RestartBgaa"===o?window.RestartBackgroundAutoApply():"CancelBgaa"===o&&window.CancelBackgroundAutoApply();break;case r.RewardsPromotionsAvailable:window.UpdateRewardsData(e);break;default:throw new Error("Unknown message type: "+t)}}getNativeHandler(){return autoApplyNativeHandler}}const n=new a},23727:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"BgAutoApplyInProgress",void 0),(0,i.Z)(this,"ForegroundApplyingBestCoupon",void 0),(0,i.Z)(this,"progressBarStartPos",void 0),(0,i.Z)(this,"progressBarEndPos",void 0),(0,i.Z)(this,"currentCoupon",void 0),(0,i.Z)(this,"currentCouponIndex",void 0),(0,i.Z)(this,"couponsTotal",void 0),(0,i.Z)(this,"result",void 0),(0,i.Z)(this,"expiredState",void 0),(0,i.Z)(this,"pageUrl",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"isBgaaFinished",void 0),(0,i.Z)(this,"hasNotifiedUser",void 0)}}},28219:function(e,t,o){var i=o(29247),r=o(90066);class a{static GetCouponStatusMessages(e,t,o){return{statusMessage:a.GetErrorMessage(e)||"",successMessages:t?.map((e=>r.Z.GetTextValue(e)))||[],failureMessages:o?.map((e=>r.Z.GetTextValue(e)))||[]}}static GetErrorMessage(e){if(e&&(0,i.UE)(e)&&r.Z.CountVisibleElements(e)>0)return r.Z.GetTextValue(e)}}t.Z=a},77776:function(e,t,o){var i=o(35062),r=o(29247),a=o(36493),n=o(27689),s=o(9448),c=o(82315),l=o(1094),u=o(11849),d=o(52056),h=o(90066);class p{static IsECPage(e){if(e&&e.checkoutData){const t=new i.Z(e.checkoutData);if(p.IsECURLMatch(t,location.pathname)&&t.IsExpressCheckoutEnabled){const e=p.GetECValidationElements(t);return p.IsECElementsExist(e)}}return!1}static IsECElementsExist(e){for(const t of e)if(h.Z.HasVisibleElement(t.Value))return!0;return!1}static GetECValidationElements(e){const t=[],o=e?.AllcheckoutCompletionPages?.get("ShippingAddress");if(o){const e=o.CheckoutElements.get("address1"),i=o.CheckoutElements.get("clickBefore");e&&e.Value&&t.push(e),i&&i.Value&&t.push(i)}const i=e?.AllcheckoutCompletionPages?.get("ContactInfo");if(i){const e=i.CheckoutElements.get("email"),o=i.CheckoutElements.get("clickBefore");e&&e.Value&&t.push(e),o&&o.Value&&t.push(o)}return t}static IsECURLMatch(e,t){let o=!1;return e&&e.CheckoutPageUrl&&e.CheckoutPageUrl.split(",").forEach((e=>{o=o||r.ZP.IsOnPage(e,t)})),o}static GetExpressCheckoutGMVSelector(e){const t=e?.retailerData?.allFinalCheckoutPages??[],o=t?.filter((e=>"none"!==e?.enabledTips&&r.ZP.IsOnPage(e?.checkoutPageUrl,location.pathname)));let a;if(o?.length>0&&(a=o[0]?.orderTotalDataElementSelector),e.checkoutData){const t=new i.Z(e.checkoutData),o=t?.AllcheckoutCompletionPages?.get("OrderInfo");a=o?.CheckoutElements?.get("orderTotal")?.Value??a}return a}static async GetExpressCheckoutGMV(e,t,o){let i={OrderTotal:-1,Currency:"$",PageCurrency:""};if(e&&r.ZP.IsValidDataField(e)){await r.ZP.WaitForCondition((async()=>h.Z.HasVisibleElement(e)),o??5e3);const a=l.Z.CreateCheckoutPageData(t),s=(0,n.uf)(a?.market,a.retailerData?.exclusiveMarket);i=u.Z.GetCartValue(e,s)}return i}static async GetAndSendExpressCheckoutPageGMV(e){const t=c.Z.getApiResponse();try{const o=p.GetExpressCheckoutGMVSelector(e);if(o){const i=await p.GetExpressCheckoutGMV(o,e),{OrderTotal:r,Currency:a}=i;if(r&&r>0)return this.SendExpressCheckoutGMVMessage(r,a,e.traceId),void d.Z.SendLogEvent(t.impressionId,"Complete GetAndSendExpressCheckoutPageGMV","true",r);throw new Error(`Shopping cart value is invalid - ${r}`)}}catch(e){d.Z.SendLogEvent(t.impressionId,`GetAndSendExpressCheckoutPageGMV error. ${e?.message}`,"error")}}static SendExpressCheckoutGMVMessage(e,t,o){const i=(0,a.qm)(t)?t:(0,a.Vv)(t)??"USD";d.Z.SendMessage(s.H.ExpressCheckoutPageGMV,[o,e.toString(),i])}}t.Z=p},41310:function(e,t,o){var i=o(72370),r=o(59645),a=o(5144),n=o(75434),s=o(52056);function c(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}t.Z=class{static LogSPBTelemetry(e,t,o,n,l,u={}){const d=new r.Z(e);d.Metadata=JSON.stringify(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?c(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({userInfo:n,responseData:o},u)),s.Z.SendLogEvent(l,t,"",void 0,void 0,a.R.EdgeFlyoutStatus,d)}static IsSearchPage(e,t){const o={isSerp:!1,searchKey:""};if(t&&t.SearchData){const i=this.IsUrlMatchAll(e,t.SearchData);o.isSerp=i.isMatch,o.searchKey=i.matchKey}return o}static IsUrlMatchAll(e,t){for(const o of t){const t=this.IsUrlMatch(e,o);if(t.isMatch)return t}return{isMatch:!1,matchKey:""}}static GetSPBCashbackOffersPdp(e){const t=e?.offer?e.offer:void 0,o=e?.relatedOffers;return{exactMatch:t,relatedOffers:o||[],visibilityFeedbackUrl:e?.adsMetadata?.visibilityFeedbackUrl||""}}static GetTotalCashback(e){const t=e?.map((e=>{const t=Number(e?.offerValue);return isNaN(t)?0:t})).reduce(((e,t)=>e+t),0);return t||0}static GetTotalCashbackFromOffers(e){const t=e?.map((e=>{const t=Number(e?.value);return isNaN(t)?0:t})).reduce(((e,t)=>e+t),0);return t||0}static IsVariationString(e,t,o){const i=e.GetData("variations"),r=(i?(0,n.rm)(i):{})[t];return!(!r||r!==o)}static IsUrlMatch(e,t){let o={isMatch:!1,matchKey:""};return"PathAndParameter"===t.type?o=this.UrlPathParameterMatch(e,t.path,t.parameter):"PathRegexAndParameter"===t.type?o=this.UrlPathRegexParameterMatch(e,t.path,t.parameter):"QueryParam"===t.type?o=this.UrlQueryParameterMatch(e,t.parameter):"PathRegex"===t.type?o=this.UrlPathRegextMatch(e,t.regexData):"ParamRegex"===t.type&&(o=this.UrlParamRegex(e,t.parameter,t.regexData)),o}static UrlParamRegex(e,t,o){let i="",r=!1;const a=e.searchParams.get(t);if(o&&a){const e=a.match(o.regex),t=o.indices;for(const o of t)if(e&&e.length>o&&e[o]){i=e[o],r=!0;break}}return{isMatch:r,matchKey:i}}static UrlPathParameterMatch(e,t,o){let i="";const r=e.searchParams.get(o),a=e.pathname.toLowerCase(),n=(a===(t=t.toLowerCase())||a===t+"/"||a.endsWith(t)||a.endsWith(t+"/"))&&null!=r;return n&&null!=r&&(i=r),{isMatch:n,matchKey:i}}static UrlPathRegexParameterMatch(e,t,o){let i="";const r=e.searchParams.get(o),a=new RegExp(t).test(e.pathname)&&null!=r;return a&&null!=r&&(i=r),{isMatch:a,matchKey:i}}static UrlQueryParameterMatch(e,t){let o="";const i=e.searchParams.get(t),r=null!=i;return r&&null!=i&&(o=i),{isMatch:r,matchKey:o}}static UrlPathRegextMatch(e,t){let o="",i=!1;if(t){const r=e.pathname.match(t.regex),a=t.indices;for(const e of a)if(r&&r.length>e&&r[e]){o=r[e],i=!0;break}}return{isMatch:i,matchKey:o}}}},90066:function(e,t,o){var i=o(29247);class r{static HasVisibleElement(e){return r.CountVisibleElements(e)>0}static CountVisibleElements(e){if(!i.ZP.IsValidDataField(e))return 0;const t=e.split(";");for(const e of t){const t=r.CountVisibleElementsSingleSel(e);if(t>0)return t}return 0}static RunQuerySelectorAll(e,t){if(!i.ZP.IsValidDataField(e))return[];const o=(e=e.replace(/;/g,",")).split("<");let r;r=t?t.querySelectorAll(o[0]):document.querySelectorAll(o[0]);for(const e of o.slice(1)){const t=r[0]?.shadowRoot;if(!t)return[];r=t.querySelectorAll(e)}return r}static IsElementVisible(e){return e&&e.offsetWidth>0&&e.offsetHeight>0}static GetFirstVisibleElement(e,t){if(!i.ZP.IsValidDataField(e))return;const o=e.split(";");for(const e of o)try{const o=r.RunQuerySelectorAll(e,t);for(const e of o)if(r.IsElementVisible(e))return e}catch(e){}}static GetAllVisibleElements(e){if(!i.ZP.IsValidDataField(e))return[];const t=e.split(";"),o=[];for(const e of t){const t=r.RunQuerySelectorAll(e);for(const e of t)r.IsElementVisible(e)&&o.push(e)}return o}static GetTextValue(e,t){if(!e||!i.ZP.IsValidDataField(e))return"";const o=e.split(";"),a=o[0],n=r.GetFirstVisibleElement(a,t);if(!n)return"";let s=n,c=s.innerText;if(1===o.length)s=r.NormalizeIfSuperscripted(n),c=s.innerText;else{const e=s.cloneNode(!0);let i=o[1];const n=r.GetFirstVisibleElement(i,s)??r.GetFirstVisibleElement(i,t);let l="";if(n&&n.innerText){if(l="."+n.innerText,s.contains(n)){const t=r.GetFirstMatchingElement(i,e);if(t?.innerText)e.removeChild(t);else{i.startsWith(a)&&(i=i.slice(a.length));const t=this.GetFirstMatchingElement(i,e);t?.innerText&&e.removeChild(t)}c=e?.innerText?e.innerText:c}c+=l}if(o.length>2){for(const t of o.slice(2)){const o=this.GetFirstMatchingElement(t,e);o?.innerText&&e.removeChild(o)}c=e?.innerText?e.innerText:c}c+=l}return r.StripInvalidJSONCharacters(c)}static GetItemizedData(e,t,o){let i="";if(e&&""!==e){const a=r.RunQuerySelectorAll(e,o);for(const e of a)e&&e.textContent&&(i+=e.textContent?.trim()+t)}return i}static StripInvalidJSONCharacters(e){return e.replace(/\n/gi,"")}static NormalizeIfSuperscripted(e){if(e&&e.innerHTML&&e.innerHTML.toLowerCase().indexOf("</sup>")>-1)try{const t=e.cloneNode(!0),o=t.childNodes.length;for(let e=0;e<o;e++){const o=t.childNodes[e];if("SUP"===o.tagName){let e=o.innerText;const i=/[0-9\.]+/g.exec(e);if(null!==i)return e="."+i[0],o.innerText=e,t}}}catch(t){return e}return e}static GetFirstMatchingElement(e,t){if(!i.ZP.IsValidDataField(e))return;const o=e.split(";");for(const e of o){const o=r.RunQuerySelectorAll(e,t);for(const e of o)if(e)return e}}static GetAllMatchingElements(e){if(!i.ZP.IsValidDataField(e))return[];const t=e.split(";"),o=[];for(const e of t)try{const t=r.RunQuerySelectorAll(e);for(const e of t)e&&o.push(e)}catch(e){}return o}static CountVisibleElementsSingleSel(e){if(!i.ZP.IsValidDataField(e))return 0;const t=r.RunQuerySelectorAll(e);let o=0;for(const e of t)r.IsElementVisible(e)&&o++;return o}}t.Z=r},41290:function(e,t,o){o.d(t,{Z:function(){return S}});var i=o(72370),r=o(36818),a=o(80090),n=o(58474);class s extends n.Z{constructor(e,t,o,r){super(),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"PreClippingVisibleSelectors",void 0),(0,i.Z)(this,"PostClippingVisibleSelectors",void 0),(0,i.Z)(this,"WasClippingSuccessful",void 0),this.Domain=e,this.PreClippingVisibleSelectors=t,this.PostClippingVisibleSelectors=o,this.WasClippingSuccessful=r}}var c=s,l=o(54774),u=o(5144),d=o(56019),h=o(29247),p=o(50616),g=o(36493),C=o(90066),S=class{constructor(e,t){(0,i.Z)(this,"logService",void 0),(0,i.Z)(this,"scenario",void 0),this.logService=e,this.scenario=t}async TryClipCoupons(e,t,o,i){const r=Date.now();return e.clipCouponSelector?await this.ClipCouponsAndLogResult(r,e,t,o,i).catch((e=>(this.LogError(r,e.message,t,o,i),!1))):(this.LogError(r,"ClipCoupon selector not found",t,o,i),!1)}async ClipCouponsAndLogResult(e,t,o,i,r){const a=this.GetPriceData(t,i);if(!await h.ZP.WaitForCondition((async()=>C.Z.HasVisibleElement(t.clipCouponSelector)),3e3)&&t.clickBeforeClipSelector){const i=C.Z.GetAllMatchingElements(t.clickBeforeClipSelector);for(const e of i)e.click();await h.ZP.WaitForCondition((async()=>C.Z.HasVisibleElement(t.clipCouponSelector)),3e3).then((async t=>{if(!t){const t="Clicked before element but never found Clip Button";return this.LogError(e,t,o,a,r),!1}}))}const n=C.Z.GetAllMatchingElements(t.clipCouponSelector),s=this.GetFirstVisibleIndices(t);if(0===n.length){let i="Clip button not found, no AlreadyClipped selector";return t.alreadyClippedSelector&&(i=C.Z.GetFirstVisibleElement(t.alreadyClippedSelector)?"Coupon Already Clipped":"Clip Button and Already Clipped not found"),this.LogError(e,i,o,a,r),this.LogVisibleSelectors(o,s,[],!1,r),!1}let c=!1;for(const e of n)e.click(),c=!0;return this.GetPostClippingSelectorsAndLog(o,t,s,c,r),c?this.LogClippingResult(e,u.ps.Positive,o,a,"Finished Clipping Coupon",r):this.LogError(e,"Coupon Clipping Failed",o,a,r),c}GetPriceData(e,t){let o=t.initialPrice??0,i=t.discount;try{if(!o&&e.orderTotalDataElementSelector){const t=C.Z.GetFirstVisibleElement(e.orderTotalDataElementSelector)?.innerText;t&&(o=(0,g.K)(t))}if(!i&&e.discountSelector){const t=C.Z.GetFirstVisibleElement(e.discountSelector)?.innerText;i=p.Z.getAmazonClippingDiscount(o,t)}}catch(e){}return{discount:i,initialPrice:o}}async GetPostClippingSelectorsAndLog(e,t,o,i,r){await h.ZP.Sleep(1e3);const a=this.GetFirstVisibleIndices(t);this.LogVisibleSelectors(e,o,a,i,r)}GetFirstVisibleIndices(e){return[this.GetFirstVisibleElementIndex(e.clipCouponSelector),this.GetFirstVisibleElementIndex(e.discountSelector),this.GetFirstVisibleElementIndex(e.orderTotalDataElementSelector),this.GetFirstVisibleElementIndex(e.clippedDiscountSelector),this.GetFirstVisibleElementIndex(e.alreadyClippedSelector)]}GetFirstVisibleElementIndex(e){if(!e)return-2;const t=e.split(";");for(let e=0;e<t.length;e++){const o=t[e];try{const t=document.querySelectorAll(o);for(const o of t)if(C.Z.IsElementVisible(o))return e}catch(e){}}return-1}LogVisibleSelectors(e,t,o,i,r){const a=u.R.VisibleClippingSelectors,n=u.in.Information,s=new c(e,t,o,i);this.logService.SendLogMessage(n,a,"",s,r)}LogClippingResult(e,t,o,i,a,n){const s=i.initialPrice??0,c=i.discount??0,d=Date.now()-e,h=new r.Z(o),p="Amazon Coupon";h.SetResultData(t,d,p,[],c??0,s,!1,this.scenario);const g=u.R.AutoApply,C=u.in.Information;if(this.logService.SendLogMessage(C,g,a,h,n),t===u.ps.Positive){this.logService.SendEdgeAAPositiveResult(p,s,c);try{const e=new l.Z({});e.EventInfoTime=(new Date).toISOString(),e.Domain=o,e.BestCoupon=p,e.StartingPrice=s.toString(),e.Discount=c.toString(),e.AutoApplyScenario=this.scenario,e.AutoApplyProcessTime=d.toString(),this.logService.SaveSavingsTransactionToEdge(e)}catch(e){}}else this.logService.SendEdgeAANegativeResult()}LogError(e,t,o,i,r){const n=d.x.CouponClippingFailed,s=new a.Z(o,n,{FunctionName:"ClipCoupons"},void 0);this.logService.SendLogMessage(u.in.Error,u.R.ClientError,t??"",s,r),this.logService.SendEdgeAAErrorMessage(n),this.LogClippingResult(e,u.ps.Error,o,i,t,r)}}},23825:function(e,t,o){var i=o(72370),r=o(5144),a=o(57176),n=o(82315),s=o(29247),c=o(12953),l=o(4872),u=o(90066),d=o(36493),h=o(27689),p=o(52056),g=o(31656),C=o(64865),S=o(91495);t.Z=class{constructor(e,t=!1){(0,i.Z)(this,"EXPIRY_PERIOD",432e6),(0,i.Z)(this,"PAGE_WAIT_TIME",5e3),(0,i.Z)(this,"MAX_SUGGESTED_COUPONS_COUNT_FOR_AA",3),(0,i.Z)(this,"MAX_SUGGESTED_COUPONS_COUNT_TO_STORE",10),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"key",void 0),(0,i.Z)(this,"AllSuggestedCoupons",void 0),(0,i.Z)(this,"suggestedCoupons",void 0),(0,i.Z)(this,"fromPlatformDetection",void 0),(0,i.Z)(this,"suggestedCouponEnhancementExp",void 0),(0,i.Z)(this,"sendStorageMessage",void 0),(0,i.Z)(this,"invalidCouponList",["NOT_ELIGIBLE_CARD","INVALID_CARD","AMAZON_PAYMENT_V2","ERROR"]),this.sendStorageMessage=e,this.fromPlatformDetection=t,this.domainName=n.Z.getApiResponse().retailerData?.domainName??(0,h.S8)(),this.key="SuggestedCoupons",this.AllSuggestedCoupons=(0,h.BQ)(S.Q.rawStorageObj[this.key])??new Map,this.suggestedCoupons=this.AllSuggestedCoupons[this.domainName]??[]}GetSuggestedCoupons(){return this.suggestedCoupons.slice(0,this.MAX_SUGGESTED_COUPONS_COUNT_FOR_AA)}PostValidation(){return Promise.resolve()}Init(){return this.suggestedCouponEnhancementExp=g.R.isExperimentActive(l.H.suggestedCouponEnhancement)??!1,Object.keys(this.AllSuggestedCoupons).forEach((e=>{this.AllSuggestedCoupons[e]=this.AllSuggestedCoupons[e].filter((e=>e.timestamp+this.EXPIRY_PERIOD>Date.now())),0===this.AllSuggestedCoupons[e].length&&delete this.AllSuggestedCoupons[e]})),Promise.resolve()}async Update(e,t,o,i,r,n,c){let d=this.PAGE_WAIT_TIME;n&&(d=0,o&&await s.ZP.WaitForCondition((async()=>u.Z.HasVisibleElement(o)),this.PAGE_WAIT_TIME)),await s.ZP.Sleep(d).then((()=>{if(o){const n=u.Z.GetFirstVisibleElement(o);let s;if(void 0===i||(0,C.TF)(i))s=n?.textContent;else{const e=n?.textContent?.match(i);s=e&&e[1]?e[1]:""}(0,C.TF)(s)||this.AddCoupons([s],t,e,a.x6.Selector,r)}let n=[];if(this.suggestedCouponEnhancementExp){const e=document.body.cloneNode(!0);let t="";e.querySelectorAll("script").forEach((e=>{t+=e.innerHTML,e.remove()})),n=[...this.GetSuggestedCouponsFromStr(e.innerHTML,this.GetHTMLRegex()),...this.GetSuggestedCouponsFromStr(t,this.GetScriptRegex())],n=[...new Set(n)]}else n=[...new Set([...document.body.innerHTML.matchAll(/[^\w](?<!area\s?|zip\s?|postal\s?|no\s)(?:(?:coupon)?code|promotion)"?(?::|\s|<\w+>|>)+"?(\w+)/gi)].map((e=>e[1])).filter((e=>e.length>3&&e.length<20&&(/\d/.test(e)||e===e.toUpperCase()))))];this.AddCoupons(n,t,e,a.x6.Automated,r),g.R.isExperimentActive(l.H.suppressedCoupons)&&this.RemoveSuppressedCoupons(c,r),this.RemoveInvalidCoupons(),this.suggestedCoupons&&this.suggestedCoupons.length>0&&(this.suggestedCoupons.sort(((e,t)=>t.timestamp-e.timestamp)),this.suggestedCouponEnhancementExp?this.suggestedCoupons=this.suggestedCoupons.slice(0,this.MAX_SUGGESTED_COUPONS_COUNT_TO_STORE):this.suggestedCoupons=this.suggestedCoupons.slice(0,this.MAX_SUGGESTED_COUPONS_COUNT_FOR_AA),this.suggestedCoupons.sort(((e,t)=>this.GetScore(e)-this.GetScore(t))),this.AllSuggestedCoupons[this.domainName]=this.suggestedCoupons),this.sendStorageMessage(this.key,JSON.stringify({value:JSON.stringify(this.AllSuggestedCoupons)}))})).catch((e=>{}))}GetUpdatedAllSuggestedCouponsHistory(e){return e.forEach((e=>{if("NotApplicable"===e.Applicability){const t=e.Code;this.UpdateSuggestedCouponFails(t)}})),this.AllSuggestedCoupons[this.domainName]=this.suggestedCoupons,Object.keys(this.AllSuggestedCoupons).forEach((e=>{this.AllSuggestedCoupons[e]=this.AllSuggestedCoupons[e].sort(((e,t)=>t.timestamp-e.timestamp)),this.AllSuggestedCoupons[e]=this.AllSuggestedCoupons[e].slice(0,this.MAX_SUGGESTED_COUPONS_COUNT_TO_STORE),this.AllSuggestedCoupons[e]=this.AllSuggestedCoupons[e].filter((e=>e.timestamp+this.EXPIRY_PERIOD>Date.now())),0===this.AllSuggestedCoupons[e].length&&delete this.AllSuggestedCoupons[e]})),this.AllSuggestedCoupons}IsSuggestedCouponsEnhancementExpEnabled(){return this.suggestedCouponEnhancementExp}UpdateSuggestedCouponFails(e){const t=this.suggestedCoupons.findIndex((t=>t.couponCode.toLocaleLowerCase()===e.toLocaleLowerCase()));-1!==t&&this.suggestedCoupons[t].numberOfFails++}AddCoupons(e,t,o,i,n){e&&e.length>0&&e.forEach((e=>{const s=this.FindCoupon(t,e),l=this.FindCoupon(this.suggestedCoupons,e);if(l)l.timestamp=Date.now(),l.extraction=Math.min(l.extraction,i),void 0===l.numberOfFails&&(l.numberOfFails=0),o<l.source&&(l.source=o,l.title=`Coupon suggested by ${this.domainName}`);else{const t=new a.ZP;if(t.attribution=this.domainName,t.title=`Coupon suggested by ${this.domainName}`,t.couponCode=e,t.extraction=i,t.numberOfFails=0,t.providerId="SuggestedCoupon",t.source=o,t.timestamp=Date.now(),this.suggestedCoupons.push(t),!s){const o=new c.Z(e,this.domainName,r.M_.SuggestedCoupon,location.pathname,JSON.stringify(t)),i=this.fromPlatformDetection?"Site suggested a coupon we didn't have from platform detection":"Site suggested a coupon we didn't have";p.Z.SendLogEventMessage(o,r.R.CollectedCoupons,n??"",i,r.in.Information)}}}))}FindCoupon(e,t){return e.find((e=>e.couponCode.toLocaleLowerCase()===t.toLocaleLowerCase()))}RemoveInvalidCoupons(){this.suggestedCoupons&&this.suggestedCoupons.length>0&&(this.suggestedCoupons=this.suggestedCoupons.filter((e=>!this.invalidCouponList.find((t=>!(0,C.TF)(e.couponCode)&&t.toLocaleLowerCase()===e.couponCode.toLocaleLowerCase())))),this.AllSuggestedCoupons[this.domainName]=this.suggestedCoupons)}RemoveSuppressedCoupons(e,t){if(e)try{const o=[];if(e.forEach((e=>{const t=this.suggestedCoupons.findIndex((t=>t.couponCode.toLowerCase()===e.toLowerCase()));-1!==t&&(o.push(this.suggestedCoupons[t]),this.suggestedCoupons.splice(t,1))})),0===o.length)return;const i=new c.Z("",this.domainName,r.M_.SuppressedSuggestedCoupons,location.pathname,JSON.stringify(o)),a="Site suggested some coupons which are suppressed coupons";p.Z.SendLogEventMessage(i,r.R.CollectedCoupons,t??"",a,r.in.Information)}catch(e){}}GetScore(e){return this.suggestedCouponEnhancementExp?10*e.extraction+5*e.numberOfFails+e.source:10*e.extraction+e.source}GetSuggestedCouponsFromStr(e,t){return[...e.matchAll(t)].map((e=>e[1])).filter((e=>(e.length>3||3===e.length&&!(0,d.$g)(e))&&(/\d/.test(e)||e===e.toUpperCase())))}GetScriptRegex(){return/[^\w](?<!no\s|product\s)(?:(?:couponcode|aktionscode)"?|code|promotion)(?::|-|\s|<[^>]+>|>)+"?(\w+)/gi}GetHTMLRegex(){return/[^\w](?<!no\s|product\s)(?:(?:coupon|aktions)?code|promotion)"?(?::|-|\s|<[^>]+>|>)+"?(\w+)/gi}}},43916:function(e,t,o){o.d(t,{Z:function(){return E}});var i=o(4872),r=o(31656),a=o(73557),n=o(82315),s=o(72370),c=class{constructor(e){(0,s.Z)(this,"userPersonalizationInfo",void 0),e.userPersonalizationInfo&&(this.userPersonalizationInfo=e.userPersonalizationInfo)}},l=class extends c{constructor(e){if(super(e),(0,s.Z)(this,"coupons",void 0),this.coupons=[],e.coupons)for(const t of e.coupons)this.coupons.push(t)}},u=class extends c{constructor(e){if(super(e),(0,s.Z)(this,"competingPrices",void 0),(0,s.Z)(this,"price",void 0),this.competingPrices=[],e?.comparableOffers?.apiPriceData?.value?.length>0)for(const t of e.comparableOffers.apiPriceData.value)this.competingPrices.push(t);e?.price&&(this.price=e.price)}},d=class extends c{constructor(e){super(e),(0,s.Z)(this,"priceDrop",void 0),e?.priceHistory?.priceHistoryData?.dailyPriceDropPercentage&&(this.priceDrop=e.priceHistory.priceHistoryData.dailyPriceDropPercentage/100)}},h=o(17675),p=o(31714),g=o(13018),C=o(29247),S=class{constructor(e,t,o,i,r,a,n){if((0,s.Z)(this,"popupOrigination",void 0),(0,s.Z)(this,"ruleBasedTriggerMap",new Map),(0,s.Z)(this,"isSpiritedShopper",void 0),(0,s.Z)(this,"mlPopUpProbability",void 0),(0,s.Z)(this,"personalizationAutoOpenTelemetryData",void 0),(0,s.Z)(this,"sendErrorMessage",void 0),(0,s.Z)(this,"sendStorageMessage",void 0),(0,s.Z)(this,"variant",void 0),(0,s.Z)(this,"impressionId",void 0),this.popupOrigination=e,this.sendErrorMessage=t,this.sendStorageMessage=o,this.impressionId=i,this.variant=n,this.personalizationAutoOpenTelemetryData=new class{constructor(){(0,s.Z)(this,"mlCouponAutoApplyPopUpProbability",void 0),(0,s.Z)(this,"mlCashbackProbability",void 0),(0,s.Z)(this,"mlPhProbability",void 0),(0,s.Z)(this,"scoreThreshold",void 0),(0,s.Z)(this,"normalizedScore",void 0),(0,s.Z)(this,"positiveEngagementScore",void 0),(0,s.Z)(this,"totalEngagementsCount",void 0),(0,s.Z)(this,"couponExpectation",void 0),(0,s.Z)(this,"priceDrop",void 0),(0,s.Z)(this,"bestCompetingPrice",void 0),(0,s.Z)(this,"isSpiritedShopper",void 0),(0,s.Z)(this,"noPreviousEngagements",void 0),(0,s.Z)(this,"isMLUsed",void 0),(0,s.Z)(this,"noPreviousUserDataAutoOpenRate",void 0),(0,s.Z)(this,"noPreviousUserDataAlwaysOpenCouponExpectation",void 0),(0,s.Z)(this,"minEngagementCount",void 0),(0,s.Z)(this,"message",void 0)}},this.personalizationAutoOpenTelemetryData.minEngagementCount=h.l.minEngagementCount,this.personalizationAutoOpenTelemetryData.noPreviousUserDataAutoOpenRate=h.l.noPreviousUserDataAutoOpenRate,this.personalizationAutoOpenTelemetryData.noPreviousUserDataAlwaysOpenCouponExpectation=h.l.noPreviousUserDataAlwaysOpenCouponExpectation,this.personalizationAutoOpenTelemetryData.message="",a)try{this.ruleBasedTriggerMap=JSON.parse(JSON.parse(a),C.ZP.ParseMap)}catch(e){this.sendErrorMessage(this.impressionId,`Cannot parse Rule Based Trigger Map: ${e}. ruleBasedTriggerMapStr = ${a}`)}this.isSpiritedShopper=r?.userPersonalizationInfo?.isSpiritedShopper,this.personalizationAutoOpenTelemetryData.isSpiritedShopper=this.isSpiritedShopper?1:0}canAutoOpen(){try{let e=this.canAutoOpenWithPersonalization();if(!e&&this.shouldReintroduceFlyout()){this.personalizationAutoOpenTelemetryData.message+=" - ReintroduceFlyout";let t=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString());t||(t=new g.Z),t.flyoutReintroduceIsForced=!0,this.ruleBasedTriggerMap.set(this.popupOrigination.toString(),t);const o=JSON.stringify({value:JSON.stringify(JSON.stringify(this.ruleBasedTriggerMap,C.ZP.StringifyMap))});this.sendStorageMessage(h.l.ruleBasedTriggerDataKey,o),e=!0}return this.storeFirstTimeAutoOpenDisabled(e),e}catch(e){return this.sendErrorMessage(this.impressionId,`Couldn't check auto open ${e}`),!0}}getPersonalizationAutoOpenTelemetryData(){return this.personalizationAutoOpenTelemetryData}noPreviousEngagements(e){const t=e?.positiveEngagementScore??-1,o=e?.totalEngagementsCount??0,i=void 0!==this.variant?h.l.minEngagementCountV1:h.l.minEngagementCount;return-1===t||o<i}canAutoOpenBasedOnFeatures(e){const t=this.getNormalizedScore(e);return t>h.l.scoreThreshold||this.canAutoOpenWithRate(t)}shouldUseML(){return void 0!==this.mlPopUpProbability&&(this.mlPopUpProbability>h.l.mlSecondHighConfidenceRange||this.mlPopUpProbability<h.l.mlFirstHighConfidenceRange)}getRuleBasedTriggerFeaturesWithML(){return[{feature:this.mlPopUpProbability,name:"MLOutput",weight:h.l.mlWeight}]}canAutoOpenUsingRuleBased(e,t){return this.canAutoOpenBasedOnFeatures([{feature:t,name:"positiveEngagementScore",weight:h.l.positiveEngagementWeight}])}canAutoOpenWithRate(e){const t=Math.random(),o=`Random: ${t}  Open probability: ${e}`;return this.personalizationAutoOpenTelemetryData.message+=` - ${o}`,t<e}getNormalizedScore(e){let t=0,o=0;const i=[];e.forEach((e=>{void 0!==e.feature&&(t+=e.feature*e.weight,o+=e.weight,i.push(`${e.name}(${e.feature}) * ${e.weight}`))}));const r=t/o,a=`score = ${i.join(" + ")} = ${t} => normalizedScore: ${r} [scoreThreshold: ${h.l.scoreThreshold}]`;return this.personalizationAutoOpenTelemetryData.message+=` - ${a}`,this.personalizationAutoOpenTelemetryData.normalizedScore=r,this.personalizationAutoOpenTelemetryData.scoreThreshold=h.l.scoreThreshold,r}canAutoOpenWithPersonalization(){const e=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString())?.userEngagementResults,t=e?.positiveEngagementScore,o=this.noPreviousEngagements(e);if(this.personalizationAutoOpenTelemetryData.noPreviousEngagements=o,this.personalizationAutoOpenTelemetryData.positiveEngagementScore=t??null,this.personalizationAutoOpenTelemetryData.totalEngagementsCount=e?.totalEngagementsCount??0,this.personalizationAutoOpenTelemetryData.message+=`PopupOrigination: ${this.popupOrigination} - No previous client-side engagements: ${o}`,this.variant===p.nV.ML){const e=this.shouldUseML();if(this.personalizationAutoOpenTelemetryData.isMLUsed=e,this.personalizationAutoOpenTelemetryData.message+=` - shouldUseML: ${e}`,e)return this.canAutoOpenBasedOnFeatures(this.getRuleBasedTriggerFeaturesWithML())}return this.variant!==p.nV.RuleBased||this.canAutoOpenUsingRuleBased(o,t)}storeFirstTimeAutoOpenDisabled(e){let t=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString()),o=t?.firstTimeAutoOpenDisabled;e&&(o=void 0),e||void 0!==o||(o=new Date),t||(t=new g.Z),t.firstTimeAutoOpenDisabled=o,this.ruleBasedTriggerMap.set(this.popupOrigination.toString(),t);const i=JSON.stringify({value:JSON.stringify(JSON.stringify(this.ruleBasedTriggerMap,C.ZP.StringifyMap))});this.sendStorageMessage(h.l.ruleBasedTriggerDataKey,i)}shouldReintroduceFlyout(){const e=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString()),t=e?.firstTimeAutoOpenDisabled,o=e?.flyoutReintroduceDays??h.l.flyoutReintroduceDays;if(t){return((new Date).getTime()-new Date(t).getTime())/864e5>=o}return!1}},m=class extends S{constructor(e,t,o,i,r,a,n){super(e,t,o,i,r,a,n),(0,s.Z)(this,"couponExpectation",void 0),this.mlPopUpProbability=r?.userPersonalizationInfo?.mlCouponAutoApplyPopUpProbability,this.personalizationAutoOpenTelemetryData.mlCouponAutoApplyPopUpProbability=this.mlPopUpProbability??null,this.couponExpectation=this.calculateCouponExpectation(r.coupons??[]),this.personalizationAutoOpenTelemetryData.couponExpectation=this.couponExpectation??null}canAutoOpenUsingRuleBased(e,t){if(e||void 0===t)return!0;if(t>=h.l.engagementScoreThreshold){const e=`${this.variant}: open because engagement score is high enough`;return this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!0}{const e=`${this.variant}: open with ${t} rate because engagement score is not high enough.`;return this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,this.canAutoOpenWithRate(t)}}calculateCouponExpectation(e){const t=this.getCouponSuccessRates(e);return this.getExpectation(t)}getCouponSuccessRates(e){return e&&e.length>0?e.filter((e=>void 0!==e.successRate)).map((e=>e.successRate)):[]}getExpectation(e){if(e&&0!==e.length)return Math.max.apply(null,e)/100}getCouponExpectationWeight(){return this.ruleBasedTriggerMap?.get(this.popupOrigination.toString())?.couponExpectationWeight??h.l.defaultCouponExpectationWeight}getRuleBasedTriggerFeaturesWithML(){const e=this.getCouponExpectationWeight();return[{feature:this.mlPopUpProbability,name:"MLOutput",weight:h.l.mlWeight},{feature:this.couponExpectation,name:"couponExpectation",weight:e}]}},A=class extends S{constructor(e,t,o,i,r,a,n){super(e,t,o,i,r,a,n),this.mlPopUpProbability=r?.userPersonalizationInfo?.mlCashbackProbability,this.personalizationAutoOpenTelemetryData.mlCashbackProbability=this.mlPopUpProbability??null}canAutoOpen(){let e="";if(this.variant===p.Nm.Micro){if(this.mlPopUpProbability&&this.mlPopUpProbability<=.6)return e="Cashback ML Micro: can't open normal notification because ML probability <= 0.6",this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1}else if(this.mlPopUpProbability&&this.mlPopUpProbability<=.6){const t=this.getMaxNotificationCountPerMin(),o=this.getMaxNotificationCountPerHour(),i=this.getMaxNotificationCountPerDay(),r=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString());if(!r)return!0;const a=r?.notificationTracker;if(!a)return!0;const n=new Date;return(n.getTime()-new Date(a.perMinFirstTriggered).getTime())/6e4<1&&a.perMinCount>=t?(e=`Cashback ML Limit: can't open normal notification because ML probability <= 0.6 and notification count exceeds the limit ${t} per min`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1):(n.getTime()-new Date(a.perHourFirstTriggered).getTime())/36e5<1&&a.perHourCount>=o?(e=`Cashback ML Limit: can't open normal notification because ML probability <= 0.6 and notification count exceeds the limit ${o} per hour`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1):!((n.getTime()-new Date(a.perDayFirstTriggered).getTime())/864e5<1&&a.perDayCount>=i&&(e=`Cashback ML Limit: can't open normal notification because ML probability <= 0.6 and notification count exceeds the limit ${i} per day`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,1))}return!0}getMaxNotificationCountPerMin(){return this.mlPopUpProbability&&this.mlPopUpProbability<=.2||this.mlPopUpProbability&&this.mlPopUpProbability<=.3||this.mlPopUpProbability&&this.mlPopUpProbability,1}getMaxNotificationCountPerHour(){return this.mlPopUpProbability&&this.mlPopUpProbability<=.2?1:this.mlPopUpProbability&&this.mlPopUpProbability<=.3?2:this.mlPopUpProbability&&this.mlPopUpProbability<=.6?3:4}getMaxNotificationCountPerDay(){return this.mlPopUpProbability&&this.mlPopUpProbability<=.2?2:this.mlPopUpProbability&&this.mlPopUpProbability<=.3?4:this.mlPopUpProbability&&this.mlPopUpProbability<=.6?6:8}},P=class extends S{constructor(e,t,o,i,r,a,n){super(e,t,o,i,r,a,n),(0,s.Z)(this,"bestCompetingPrice",void 0),(0,s.Z)(this,"price",void 0),this.bestCompetingPrice=this.getBestCompetingPrice(r),this.price=r.price,this.personalizationAutoOpenTelemetryData.bestCompetingPrice=this.bestCompetingPrice??null}canAutoOpenUsingRuleBased(e,t){return e||void 0===t?!!(this.bestCompetingPrice&&this.price&&this.bestCompetingPrice/this.price>h.l.noPreviousUserDataAlwaysOpenBestCompetingPrice||this.isSpiritedShopper)||this.canAutoOpenWithRate(h.l.noPreviousUserDataAutoOpenRate):this.canAutoOpenBasedOnFeatures([{feature:t,name:"positiveEngagementScore",weight:h.l.positiveEngagementWeight},{feature:this.bestCompetingPrice,name:"couponExpectation",weight:h.l.defaultBestCompetingPriceWeight}])}getBestCompetingPrice(e){return Math.min.apply(null,e.competingPrices)}getRuleBasedTriggerFeaturesWithML(){return[{feature:this.mlPopUpProbability,name:"MLOutput",weight:h.l.mlWeight},{feature:this.bestCompetingPrice,name:"bestCompetingPrice",weight:h.l.defaultBestCompetingPriceWeight}]}},f=class extends S{constructor(e,t,o,i,r,a,n){super(e,t,o,i,r,a,n),(0,s.Z)(this,"priceDrop",void 0),this.mlPopUpProbability=r?.userPersonalizationInfo?.mlPhProbability,this.personalizationAutoOpenTelemetryData.mlPhProbability=this.mlPopUpProbability??null,this.priceDrop=this.getPriceDrop(r),this.personalizationAutoOpenTelemetryData.priceDrop=this.priceDrop??null}canAutoOpen(){let e="";if(this.variant===p.Gc.Micro){if(this.mlPopUpProbability&&this.mlPopUpProbability<=.5)return e="PH ML Micro: can't open normal notification because ml probability <= 0.5",this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1}else if(this.mlPopUpProbability&&this.mlPopUpProbability<=.5){const t=this.getMaxNotificationCountPerMin(),o=this.getMaxNotificationCountPerHour(),i=this.getMaxNotificationCountPerDay(),r=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString());if(!r)return!0;const a=r?.notificationTracker;if(!a)return!0;const n=new Date;return(n.getTime()-new Date(a.perMinFirstTriggered).getTime())/6e4<1&&a.perMinCount>=t?(e=`PH ML Limit: can't open normal notification because ml probability <= 0.5 and notification count exceeds the limit ${t} per min`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1):(n.getTime()-new Date(a.perHourFirstTriggered).getTime())/36e5<1&&a.perHourCount>=o?(e=`PH ML Limit: can't open normal notification because ml probability <= 0.5 and notification count exceeds the limit ${o} per hour`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1):!((n.getTime()-new Date(a.perDayFirstTriggered).getTime())/864e5<1&&a.perDayCount>=i&&(e=`PH ML Limit: can't open normal notification because ml probability <= 0.5 and notification count exceeds the limit ${i} per day`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,1))}return!0}canAutoOpenUsingRuleBased(e,t){return e||void 0===t?!!(this.priceDrop&&this.priceDrop>h.l.noPreviousUserDataAlwaysOpenPriceDrop||this.isSpiritedShopper)||this.canAutoOpenWithRate(h.l.noPreviousUserDataAutoOpenRate):this.canAutoOpenBasedOnFeatures([{feature:t,name:"positiveEngagementScore",weight:h.l.positiveEngagementWeight},{feature:this.priceDrop,name:"priceDrop",weight:h.l.defaultPriceDropWeight}])}getPriceDrop(e){return e.priceDrop}getRuleBasedTriggerFeaturesWithML(){return[{feature:this.mlPopUpProbability,name:"MLOutput",weight:h.l.mlWeight},{feature:this.priceDrop,name:"priceDrop",weight:h.l.defaultPriceDropWeight}]}getMaxNotificationCountPerMin(){return this.mlPopUpProbability&&this.mlPopUpProbability<=.2||this.mlPopUpProbability&&this.mlPopUpProbability<=.3||this.mlPopUpProbability&&this.mlPopUpProbability,1}getMaxNotificationCountPerHour(){return this.mlPopUpProbability&&this.mlPopUpProbability<=.2?1:this.mlPopUpProbability&&this.mlPopUpProbability<=.3?2:this.mlPopUpProbability&&this.mlPopUpProbability<=.5?3:4}getMaxNotificationCountPerDay(){return this.mlPopUpProbability&&this.mlPopUpProbability<=.2?2:this.mlPopUpProbability&&this.mlPopUpProbability<=.3?4:this.mlPopUpProbability&&this.mlPopUpProbability<=.5?6:8}},E=class{static getRuleBasedTriggerController(e,t,o,s,h){let p,g;const C=n.Z.getApiResponse();switch(e){case a.sR.AUTO_SHOW_COUPONS_CHECKOUT:g=new l(C),p=new m(e,t,o,s,g,h,r.R.getServiceExperimentValue(i.H.CouponsPersonalization));break;case a.sR.AUTO_SHOW_PRICE_HISTORY:g=new d(C),p=new f(e,t,o,s,g,h,r.R.getServiceExperimentValue(i.H.PhPersonalization));break;case a.sR.AUTO_SHOW_REBATES_ORGANIC:g=new c(C),p=new A(e,t,o,s,g,h,r.R.getServiceExperimentValue(i.H.CashbackPersonalization));break;case a.sR.AUTO_SHOW_LOWER_PRICE_FOUND:g=new u(C),p=new P(e,t,o,s,g,h,void 0);break;default:g=new c(C),p=new S(e,t,o,s,g,h,void 0)}return p}}},89366:function(e,t,o){o.d(t,{Z:function(){return i}});class i{initialize(e){e.splice(0,2);try{this.initializeRuntime(e)}catch(e){return!1}return!0}raiseMessageFromHost(e){const t=e.shift();if(t)try{this.handleMessages(e,t)}catch(e){}}postMessageToHost(e,t){try{this.getNativeHandler().sendMessageToHost(e,t)}catch(e){}}}},31024:function(e,t,o){var i=o(27689),r=o(9448),a=o(52056);t.Z=class{static GetBackgroundAAKeyName(){return(0,i.sT)()}static CanCurrentPageDeleteBgaaState(e){return e===(0,i.Ek)()}static CanCurrentDomainDeleteBgaaState(e){return e===(0,i.S8)()}static ValidateBgAAState(e,t,o){return e.InitialPrice===t||e.TrueInitialPrice===t||this.AreEqualOrNear(e.InitialPrice-e.MaxDiscount,t)||e.InitialPrice===o||e.TrueInitialPrice===o||this.AreEqualOrNear(e.InitialPrice-e.MaxDiscount,o)}static AreEqualOrNear(e,t){return Math.abs(e-t)<.05}static SendBackgroundAAStateValidationMessage(e){a.Z.SendMessage(r.H.BackgroundAutoApplyStateValid,[e])}static ResetBackgroundAAStateValidationMessage(){a.Z.SendMessage(r.H.BackgroundAutoApplyStateValid,[""])}}},57459:function(e,t,o){var i=o(93608);class r{static GetCartModelRequestCoupons(e,t){if(!e.length)return[];const o=r.FilterBlockedAutoApplyCoupons(e);return r.AddSuggestedCoupons(o,t)}static GetAutoApplyCoupons(e,t,o){return e.length?(e=r.AddSuggestedCoupons(e,t),e=r.HandleCartModelBlockedCoupons(e,o)):[]}static FilterUnblockedCoupons(e,t,o){return r.FilterBlockedAutoApplyCoupons(r.GetAutoApplyCoupons(e,t,o))}static AddSuggestedCoupons(e,t){if(t.length>0){const o=[...e];for(const e of[...t].reverse()){let t=e;const r=o.findIndex((t=>t.couponCode.toLowerCase()===e.couponCode.toLowerCase()));let a=i.d.NewSuggestedCoupon;-1!==r&&(t=o.splice(r,1)[0],a=i.d.ExistingSuggestedCoupon),t.suggestedCouponType=a,o.unshift(t)}return o}return e}static HandleCartModelBlockedCoupons(e,t){if(!e.length)return[];const o=[...e];if(t)for(const e of t){const t=o.findIndex((t=>t.couponCode.toLowerCase()===e.toLowerCase()));-1!==t&&(o[t].isBlockedByCart=!0)}return o}static FilterBlockedAutoApplyCoupons(e){return e.filter((e=>!e.isLowSuccessRateCoupon&&!e.isBlockedByCart))}}t.Z=r},82315:function(e,t,o){var i=o(72370),r=o(21488),a=o(46557);class n{constructor(){(0,i.Z)(this,"retailerData",void 0),(0,i.Z)(this,"userInfo",void 0),(0,i.Z)(this,"traceId",void 0),(0,i.Z)(this,"disabledNotifications",void 0),(0,i.Z)(this,"impressionId",void 0),(0,i.Z)(this,"coupons",void 0),(0,i.Z)(this,"suppressedCoupons",void 0),(0,i.Z)(this,"cashback",void 0),(0,i.Z)(this,"market",void 0),(0,i.Z)(this,"page_locale",void 0),(0,i.Z)(this,"aFDMarket",void 0),(0,i.Z)(this,"userPersonalizationInfo",void 0),(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"base64ProductImage",void 0),(0,i.Z)(this,"ranking",void 0),(0,i.Z)(this,"extracted_entity",void 0),(0,i.Z)(this,"comparableOffers",void 0),(0,i.Z)(this,"priceHistory",void 0),(0,i.Z)(this,"url",void 0),(0,i.Z)(this,"isAwarenessExpansionEnabled",void 0),(0,i.Z)(this,"personalizedAdsResponse",void 0),(0,i.Z)(this,"isCashbackEstimationSupportedForDomain",void 0),(0,i.Z)(this,"youtubeTemplates",void 0),(0,i.Z)(this,"youtubeData",void 0),(0,i.Z)(this,"trendingCoupons",void 0),(0,i.Z)(this,"productTracking",void 0),(0,i.Z)(this,"recommendations",void 0),(0,i.Z)(this,"isSSOEnabled",void 0),(0,i.Z)(this,"uHId",void 0),(0,i.Z)(this,"itemLevelCashBack",void 0),(0,i.Z)(this,"productItemizedCashBack",void 0),(0,i.Z)(this,"autos",void 0),(0,i.Z)(this,"shoppingDataContainer",void 0),(0,i.Z)(this,"checkoutData",void 0),(0,i.Z)(this,"dealDaysRetailerData",void 0),(0,i.Z)(this,"dealDaysPDP",void 0),(0,i.Z)(this,"isUserEnrolledInDealDays",void 0),(0,i.Z)(this,"completeExtractedEntity",void 0),(0,i.Z)(this,"isAmazonGiftCardEnabled",void 0),(0,i.Z)(this,"productBestCoupon",void 0),(0,i.Z)(this,"isPackageTrackingEnabled",void 0),(0,i.Z)(this,"inboxPriceMatchNotification",void 0)}static getApiResponse(){return this.apiResponse}static setApiResponse(e,t){this.apiResponse=JSON.parse(e),this.apiResponse?.retailerData&&(this.apiResponse.retailerData=a.Z.Create(this.apiResponse.retailerData),this.apiResponse.userInfo=r.Z.Create(this.apiResponse)),this.apiResponse.traceId=t}static createNewApiResponse(e,t,o){const i=JSON.parse(e);return i?.retailerData&&(i.retailerData=a.Z.Create(i.retailerData),i.userInfo=r.Z.Create(i)),i.traceId=t,i.impressionId=o,i}}(0,i.Z)(n,"apiResponse",new n),t.Z=n},49206:function(e,t,o){o.d(t,{f:function(){return h}});var i=o(72370),r=o(31656),a=o(21597),n=o(89366),s=o(86743),c=o(3274),l=o(52056),u=o(60782);class d extends n.Z{constructor(...e){super(...e),(0,i.Z)(this,"initializeStartTime",performance.now()),(0,i.Z)(this,"scriptRunNum",0)}initializeRuntime(e){let t,o;u.M.handleInitializeRuntime(e),window.AutoOpenScriptInjected=!0,0!==this.scriptRunNum&&(this.initializeStartTime=performance.now()),e&&(e.length>a.aE.enabled_features&&(t=e[a.aE.enabled_features]),o=this.GetEnabledServiceFeatures(e)),r.R.Create(t,o);const i=(0,s.XB)();window.isAOCActive=i,l.Z.SetFullAOCActive(i),(0,c.g)(e,!1,this.initializeStartTime)}handleMessages(e,t){this.scriptRunNum=(0,c.U)(e,t,this.scriptRunNum,this.initializeStartTime)}getNativeHandler(){return AutoOpenControllerNativeHandler}GetEnabledServiceFeatures(e){let t;return e.length>a.aE.enabled_service_features&&e[a.aE.enabled_service_features].length>0?t=e[a.aE.enabled_service_features]:e.length>a.aE.enabled_service_features_v2&&e[a.aE.enabled_service_features_v2].length>0&&(t=e[a.aE.enabled_service_features_v2]),t}}const h=new d},23498:function(e,t,o){var i=o(93209),r=o(5144),a=o(27689),n=o(2388),s=o(9448),c=o(52056),l=o(93970),u=o(9839);class d{static executeUrlParamActions(e,t){const o=(0,a.Wf)(t)??window.location.search,i=new URLSearchParams(o),r=d.getParamActionMap();i.forEach(((t,o)=>{const i=r.get(`${o}:${t}`);i&&i.forEach((t=>{t(e)}))}))}static fireAffiliateUrl(e){const t=e.retailerData?.domainName??(0,a.S8)(),o=e?.coupons?.find((e=>(0,a.Mu)(e,t)))?.offerUrl;o&&c.Z.SendNavigateToUrlMessage(o)}static getParamActionMap(){const e=new Map;return e.set("datasource:shoppingsaving",[d.sendBellIconNotificationTelemetry,d.fireAffiliateUrl]),e.set("formcode:edgeshopping",[d.fireAffiliateUrl]),e}static sendBellIconNotificationTelemetry(e){const t=e.retailerData?.domainName??(0,a.S8)();u.Q.sendMessage(s.H.RecordShoppingUserAction,[l.J6.BellIconNotifClick]),u.Q.sendMessage(s.H.RecordShoppingUserEngagement,[l.OE.BellIconNotifClick]);const o=new i.Z(r.$S.BellIconNotification,n.r.BELL_ICON,t);u.Q.sendLogEventMessage(o,r.R.ButtonClick,e.impressionId,"Bell Icon Notification Click",r.in.Information)}}t.Z=d},9839:function(e,t,o){o.d(t,{Q:function(){return w}});var i=o(72370),r=o(4872),a=o(31656),n=o(84830),s=o(59645),c=o(58474);class l extends c.Z{constructor(e,t){super(),(0,i.Z)(this,"JourneyStage",void 0),(0,i.Z)(this,"PageVisitId",void 0),this.JourneyStage=e,this.PageVisitId=t}}var u=l,d=o(5144),h=o(39088),p=o(21597),g=o(87720),C=o(35386),S=o(73557),m=o(96658),A=o(56372),P=o(29247),f=o(71544),E=o(91495),T=o(27689),O=o(33105),I=o(65302),_=o(9448),v=o(43916),R=o(82315),D=o(86743),N=o(93970),y=o(83879),b=o(49206),k=o(68813);class U extends A.Z{constructor(...e){super(...e),(0,i.Z)(this,"traceId",void 0),(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"journeyStage",C.v.UNDEFINED),(0,i.Z)(this,"sentSnoozeTelemetry",!1),(0,i.Z)(this,"snoozedPopupOriginationList",[]),(0,i.Z)(this,"bgaaComplete",void 0)}init(e){this.apiResponse=R.Z.getApiResponse(),this.initCommonInfo(this.apiResponse.impressionId,this.apiResponse.retailerData?.domainName??(0,T.S8)(),this.apiResponse.url??window.location.href,d.G7.Controller),this.traceId=e,this.sendErrorMessage=this.sendControllerErrorMessage.bind(this),this.sendStorageMessage=this.sendControllerStorageMessage.bind(this),this.sentSnoozeTelemetry=!1,this.initialize()}isCheckoutPageUsingUrlMatch(e){return!!this.getNumberParameter(e,p.aE.is_checkout_page_using_url_match)||!!this.apiResponse.retailerData?.checkoutPageUrl&&P.ZP.IsOnPage(this.apiResponse.retailerData.checkoutPageUrl,location.pathname)}isMockedCheckout(){const e=this.apiResponse.retailerData?.getCurrentCheckoutPage();if(e){if(!e?.pageType)return!1;if(e?.pageType!==d.GV.CheckoutPage)return!0}return!1}isProductPageCheckoutPageUsingUrlMatch(){if(!this.apiResponse.retailerData?.updateCurrentCheckoutPage(location.pathname))return!1;const e=this.apiResponse.retailerData?.getCurrentCheckoutPage();return e?.pageType===d.GV.ProductPage}async checkAndTriggerProductTracking(){const{retailerData:e}=this.apiResponse;if(!e)return!1;const t=this.apiResponse.retailerData?.getCurrentCheckoutPage();if(t?.pageType!==d.GV.ProductPage)return!1;const o=this.apiResponse.retailerData?.getCurrentCheckoutPage()?.catalogSelectors;return!!o&&N.ZP.ValidateProductOutOfStock(e,o,this.apiResponse?.impressionId,this.apiResponse?.productTracking)}getCurrentJourneyStage(){return this.journeyStage}resetCurrentJourneyStage(){this.journeyStage=C.v.UNDEFINED}computeCurrentJourneyStage(e){let t=C.v.UNDEFINED;if(a.R.isExperimentActive(r.H.disableJourneyStageComputation)){const e=a.R.getMultipleVariants(r.H.disableJourneyStageComputation),t=a.R.getVariantValue(e,"journeyStage",C.v.UNDEFINED);return void(this.journeyStage=t)}if(!(a.R.isExperimentActive(r.H.shoppingOnDiscover)&&a.R.isExperimentActive(r.H.temporalShoppingOnDiscover)||a.R.isExperimentActive(r.H.computeJourneyStage)))return;const o=a.R.getMultipleVariants(r.H.shoppingOnDiscover),i=a.R.getVariantValue(o,"maxCountThreshold",1),n=a.R.getVariantValue(o,"researchTotalCount",1),s=a.R.getVariantValue(o,"discoverTotalCount",1),c=a.R.getVariantValue(o,"decisionTotalCount",1),l=a.R.getVariantValue(o,"historyThresholdInMinutes",-1),h=R.Z.getApiResponse().shoppingDataContainer,g=h?.baseShoppingDataList;if(g){let e=0,o=0;for(const t of g)if(t?.contentDataType===O.q.PreviouslyViewedSimilar){const i=t;if(i)for(const[t,r]of Object.entries(i.urlTimestamps)){let t=0;for(const e of r)";"===e&&(t+=1);if(-1===l)e+=t,o=Math.max(o,t);else{let t=0;for(const e of r.split(";")){const o=Date.parse(e+" Z");Date.now()-o<1e3*l*60&&(t+=1)}e+=t,o=Math.max(o,t)}}}e>c?t=C.v.DECISION:o>i||e>n?t=C.v.RESEARCH:e>s&&(t=C.v.DISCOVER)}if(this.journeyStage=t,a.R.isExperimentActive(r.H.journeyStageTelemetry)){const o=this.getStringParameter(e,p.aE.session_ids),i=JSON.parse(o),r=new u(t,i?.pageVisitId);this.sendLogEventMessage(r,d.R.JourneyStage,this.impressionId,"",d.in.Information)}}getCurrentCategoryName(){const e=R.Z.getApiResponse().comparableOffers?.attributedatabag?.responseLevelSignals?.queryleafcategoryid;if(e&&"string"==typeof e)return e;const t=R.Z.getApiResponse().shoppingDataContainer;if(t){const e=t.baseShoppingDataList;for(const t of e)if(t?.contentDataType===O.q.CategoryInsights&&t)return t.rRCategoryInsights.leafCategoryId.toString()}return""}setAutoOpenPref(e){this.autoOpenPrefData=e,this.sendStorageMessage(g.cv,JSON.stringify({value:JSON.stringify(this.autoOpenPrefData)}))}async initializeUserPreference(e){try{const t=[],o=Object.keys(S.sR).filter((e=>!isNaN(Number(e))));for(const i of o){const o=parseInt(i,10),r=(0,I.H6)(o),a=this.getNumberParameter(e,p.aE.disabled_scenarios);if(null!=a&&a<117424127&&r&&(a&r)===r){const e=new g.ZP;e.popupOrigination=o,e.timeLastAutoOpen=Date.now(),t.push(e)}if(e.length>p.aE.snoozed_values){const i=JSON.parse(e[p.aE.snoozed_values]);if(i&&i.length>0&&i.includes(r.toString())){const e=new g.ZP;e.popupOrigination=o,e.timeLastAutoOpen=Date.now(),e.snoozeTime=864e5,t.push(e)}}}this.sendStorageMessage(g.cv,JSON.stringify({value:JSON.stringify(t)})),this.autoOpenPrefData=t}catch(e){this.sendErrorMessage(`error setting user pref for the first time ${e}`)}}setPreferenceForDomain(e,t){if(!this.autoOpenDomainPrefData||!this.autoOpenDomainPrefData?.get(t)){const o=new Map,i=[];if(t){const r=Object.keys(S.sR).filter((e=>!isNaN(Number(e))));if(e.length>p.aE.disable_popup_originations_for_current_domain){const t=JSON.parse(e[p.aE.disable_popup_originations_for_current_domain]);if(t&&2===t.length)for(const e of r){const o=parseInt(e,10),r=(0,I.H6)(o);(this.doesGroupHaveEnum(t[0],r)||this.doesGroupHaveEnum(t[1],r))&&i.push(o)}}o.set(t,i);const a=JSON.stringify({value:JSON.stringify(o,P.ZP.StringifyMap)});this.autoOpenDomainPrefData=o,this.sendStorageMessage(g.Sk,a)}}}isPopupOriginationUnblockedByMinCooldown(e){const t=this.lastShownData.get(e);if(t){const o=this.GetMinCooldownForPopupOrigination(e);if(o){return Date.now()-t>=o}}return!0}isPopupOriginationUnblockedByStageAndCategory(e){if(!a.R.isExperimentActive(r.H.shoppingOnDiscover)||!a.R.isExperimentActive(r.H.temporalShoppingOnDiscover))return!0;const t=a.R.getMultipleVariants(r.H.shoppingOnDiscover),o=a.R.getVariantValue(t,"journeyStageCooldownInMinutes",60),i=a.R.getVariantValue(t,"categoryCooldownInMinutes",1440),n=this.stageAndCategoryLastShown.get(e);let s=!0;if(n){const e=this.getCurrentJourneyStage(),t=this.getCurrentCategoryName(),r=n.categoriesBlocked.get(e);if(r&&r.length>0){Date.now()-r[r.length-1].timeLastAutoOpen<1e3*o*60&&(s=!1);for(const e of r)if(Date.now()-e.timeLastAutoOpen<1e3*i*60&&e.categoryName===t){s=!1;break}}}return s}sendControllerStorageMessage(e,t){this.sendMessage(N.EI.SetStorageValue,[e,t])}sendUpdateAddressBarMessage(e){this.sendMessage(N.EI.UpdateAddressBar,[e])}async checkIfCanUpdateOmniboxByCashbackActivationMessage(){a.R.isExperimentActive(r.H.cashbackActivationOmnibar)&&await y.Z.GetLocalDataService().GetIsCheckoutPage(this.apiResponse)&&w.sendUpdateAddressBarMessage(JSON.stringify({type:m.r.ActivateCashbackCTA}))}isPopupOriginationUnblockedByUserPref(e,t,o,i,n=!1){if(this.autoOpenPrefData&&a.R?.isExperimentActive(r.H.autoOpenControllerScript)){const r={PrefSize:this.autoOpenPrefData?.length,Reason:"",TelemetryData:o,Status:""},a=this.autoOpenPrefData.findIndex((e=>e.popupOrigination===t));if(-1!==a){const i=Date.now(),s=this.autoOpenPrefData[a].timeLastAutoOpen,c=this.autoOpenPrefData[a].snoozeTime;if(!c){if(this.reEnabledPopupOriginationForLostUser(t,o,this.autoOpenPrefData[a]))return this.sendLostUsersLogEvent(t,r,d.AM.lostUsers,d.YQ.LostUsers),!0;r.Reason="blocked";const i=this.autoOpenPrefData.filter((e=>!e.snoozeTime));return r.PrefSize=i?.length,i?.length>=29&&(this.autoOpenPrefData=this.autoOpenPrefData.filter((e=>e.snoozeTime)),this.setAutoOpenPref(this.autoOpenPrefData),r.Status="prefReset",r.Reason="maxedOut"),this.sendLogEventMessage(r,d.R.UserPref,this.impressionId,"",d.in.Information),this.sendAutoShowPreventedMessage(t,e),!1}if(i-s<c)return n&&this.snoozedPopupOriginationList.push(t),this.sendAutoShowPreventedMessage(t,e),!1}if(this.autoOpenDomainPrefData&&i&&this.autoOpenDomainPrefData.get(i)){const o=this.autoOpenDomainPrefData.get(i);if(o?.includes(t))return r.Reason="blocked for domain",this.sendLogEventMessage(r,d.R.UserPref,this.impressionId,"",d.in.Information),this.sendAutoShowPreventedMessage(t,e),!1}else{const o=(0,I.H6)(t);if(e?.length>p.aE.disable_popup_originations_for_current_domain){const i=JSON.parse(e[p.aE.disable_popup_originations_for_current_domain]);if(i&&2===i.length&&(this.doesGroupHaveEnum(i[0],o)||this.doesGroupHaveEnum(i[1],o)))return r.Reason="blocked for domain using params",this.sendLogEventMessage(r,d.R.UserPref,this.impressionId,"",d.in.Information),this.sendAutoShowPreventedMessage(t,e),!1}}return!0}if(e){const o=(0,I.H6)(t),i=this.getNumberParameter(e,p.aE.disabled_scenarios);if(null!=i&&o&&(i&o)===o)return this.sendAutoShowPreventedMessage(t,e),!1;if(e?.length>p.aE.disable_popup_originations_for_current_domain){const i=JSON.parse(e[p.aE.disable_popup_originations_for_current_domain]);if(i&&2===i.length&&(this.doesGroupHaveEnum(i[0],o)||this.doesGroupHaveEnum(i[1],o)))return this.sendAutoShowPreventedMessage(t,e),!1}if(e?.length>p.aE.snoozed_values){const i=JSON.parse(e[p.aE.snoozed_values]);if(i&&i.length>0&&i.includes(o.toString()))return this.sendAutoShowPreventedMessage(t,e),!1}}return!0}sendLogEventMessage(e,t,o,i,r){const a={};a.JsonData=JSON.stringify(e),a.EventType=t,a.LogLevel=r,a.Message=i,a.ClientContext=new n.Z(f.Z.GetClientName(),h.HQ,f.Z.GetBuildVersion(),f.Z.enabledServiceFlights),o&&(a.ImpressionId=o);const s=[JSON.stringify(a)];this.sendMessage(N.EI.LogScriptTelemetry,s)}sendLogEventMessageV2(e,t,o,i,r){const a={};a.JsonData=JSON.stringify(e),a.EventType=t,a.LogLevel=r,a.Message=i,a.ClientContext=new n.Z(f.Z.GetClientName(),h.HQ,f.Z.GetBuildVersion(),f.Z.enabledServiceFlights),o&&(a.ImpressionId=o);const s=[JSON.stringify(a)];try{this.sendMessage(N.EI.LogScriptTelemetryV2,s)}catch(e){}}sendThrottledLogEventMessage(e){a.R.getServiceExperimentValue(r.H.loggingThrottle)&&e()}isPopupOriginationUnblockedByServer(e){try{const t=this.apiResponse.retailerData?.disabledPopupOriginationList,o=t?.find((t=>t.popupOrigination===e));if(o){if(!o.jSVersionThreshold&&!o.serverExps)return!1;if(o.jSVersionThreshold&&Number(h.HQ)<Number(o.jSVersionThreshold))return!1;if(o.serverExps){const e=o.serverExps;for(const t of e){const e=`edgeServerUX.shopping.${t}`;if(a.R.isExperimentActive(e))return!1}}}}catch(e){this.sendLogEvent(this.apiResponse.impressionId,`popupOrgination unblocked by server ${e}`,"error")}return!0}isLowPerformingNotificationBlockedByExperiment(e){return a.R.isExperimentActive(r.H.blockLowPerformanceNotifications)&&U.lowPerformingNotificationsExp.includes(e)}CheckIfCanOpenForPopupOrigination(e,t,o,i,r){let a,n=!1,s=!1,c=!1,l=!1,u=!1,d=!1,h=!1;const p=this.apiResponse?.disabledNotifications;if(p){const t={PrefSize:this.autoOpenPrefData?.length};this.sendLogEvent("","NO LOST USERS DATA","Lost users not showing due to no lost users data",e.toString(),t)}let g;if(a=(0,D.Kv)(e),n=a.status,n&&(s=!this.shouldStandDown(t,e),n=s),n&&(n=!i),n&&(c=this.isPopupOriginationUnblockedByServer(e),n=c),n&&(l=this.isPopupOriginationUnblockedByMinCooldown(e),n=l),n&&(n=this.isPopupOriginationUnblockedByStageAndCategory(e)),n&&(n=this.checkIfCanOpenWithPersonalization(e)),n&&(u=this.isPopupOriginationUnblocked(e),n=u),n&&(d=this.isPopupOriginationUnblockedByUserPref(t,e,p,o,!0),n=d),n&&(h=(0,k.Oh)(e,(0,k.tW)(),y.Z.GetLocalDataService().GetUserSettingsData()),n=h),n&&(n=!this.isLowPerformingNotificationBlockedByExperiment(e)),!n){let t="Popup origination blocked";a.status?s?i?(t="Popup origination blocked due to already auto opened",g={featuresAlreadyOpened:JSON.stringify(r)}):c?l?u?d?h||(t="Popup origination blocked due to user cohort (e.g. vulnerable cohort)",g={userSettingsData:y.Z.GetLocalDataService().GetUserSettingsData()}):t="Popup origination blocked due to userPref":t="Popup origination blocked due to domain":t="Popup origination blocked due to MinCooldown":t="Popup origination blocked by server":t="Popup origination blocked due to stand down parameter":t=`Popup origination blocked due to reason: ${a.reason}`,this.sendLogEvent(this.apiResponse.impressionId,"BLOCKED POPUPORIGINATION",t,e.toString(),g)}return!!n}sendMessage(e,t){b.f.postMessageToHost(e,t)}sendCheckoutValidationStatus(e){const t=y.Z.GetLocalDataService(),o=[`${t.GetAutoApplyStatus()}`,t.GetTraceId(),`${e}`];w.sendMessage(_.H.CheckoutPageValidationStatus,o)}triggerExperiment(e){this.sendMessage(N.EI.TriggerExperiment,[e])}sendLogEvent(e,t,o,i,r,a){const n={Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),Status:o,PopupOrigination:i,Metadata:r?JSON.stringify(r):void 0};this.sendLogEventMessage(n,a??d.R.AutoOpenController,e,t,d.in.Information)}logDataRecieved(e,t){this.sendThrottledLogEventMessage((()=>{this.sendLogEvent(e?.impressionId||"",`Data recieved - ${t}`,t)}))}sendSnoozeTelemetry(){if(0===this.snoozedPopupOriginationList.length||this.sentSnoozeTelemetry)return;this.sentSnoozeTelemetry=!0;const e={Domain:(0,T.S8)(),Status:"blockedByPref",PopupOrigination:JSON.stringify(this.snoozedPopupOriginationList),Reason:"snoozed",PrefSize:0},t=this.autoOpenPrefData.filter((e=>e.snoozeTime));e.PrefSize=t?.length,this.sendLogEventMessage(e,d.R.UserPref,this.apiResponse.impressionId,"",d.in.Information)}checkUrlParam(e,t,o){return o.get(e)===t}setIsClientBgaaComplete(e){this.bgaaComplete=e}getIsClientBgaaComplete(){return this.bgaaComplete}sendLostUsersLogEvent(e,t,o,i){t.Reason=o,this.sendLogEvent(this.apiResponse.impressionId,i,"blockedByPref",e.toString(),t,d.R.EdgeFlyoutStatus)}shouldCheckIfCanOpenWithPersonalization(e){return!!(e===S.sR.AUTO_SHOW_COUPONS_CHECKOUT&&a.R.isExperimentActive(r.H.CouponsPersonalization)||e===S.sR.AUTO_SHOW_PRICE_HISTORY&&a.R.isExperimentActive(r.H.PhPersonalization)||e===S.sR.AUTO_SHOW_REBATES_ORGANIC&&a.R.isExperimentActive(r.H.CashbackPersonalization))}checkIfCanOpenWithPersonalization(e){if(!1===this.shouldCheckIfCanOpenWithPersonalization(e))return!0;try{const t=v.Z.getRuleBasedTriggerController(e,this.sendErrorMessage,this.sendStorageMessage,this.apiResponse.impressionId,E.Q?.RuleBasedTriggerData),o=t.canAutoOpen();if(o);else{const o=new s.Z(d.xu.PersonalizedAutoTriggerOff);o.Metadata=JSON.stringify({personalizationAutoOpenTelemetryData:t.getPersonalizationAutoOpenTelemetryData(),popupOriginationEnum:e}),this.sendLogEventMessage(o,d.R.EdgeFlyoutStatus,this.apiResponse.impressionId,"RuleBased Trigger Controller decides to not auto open the flyout",d.in.Information)}return o}catch(e){return this.sendErrorMessage(this.apiResponse.impressionId,`checkIfCanOpenWithPersonalization error ${(0,I.YU)(e)}`),!0}}shouldStandDown(e,t){return!(!w.getNumberParameter(e,p.aE.should_stand_down)||U.shouldNotStandDown.includes(t)||(w.isCheckoutPageUsingUrlMatch(e)&&(this.sendMessage(_.H.PageStatus,[this.traceId,""]),this.sendMessage(_.H.CheckoutPageValidationStatus,["false",this.traceId,"false"])),0))}initialize(){this.autoOpenDataStr=E.Q?.AutoOpenData,this.lastCleanedDataStr=E.Q?.LastCleanedData,this.autoOpenPrefDataStr=E.Q?.AutoOpenPrefData,this.autoOpenDomainPrefDataStr=E.Q?.AutoOpenDomainPrefData,this.lastShownDataStr=E.Q?.LastShownData,this.stageAndCategoryLastShownStr=E.Q?.StageAndCategoryLastShown,this.initializeData()}sendControllerErrorMessage(e,t){try{const o="error";this.sendLogEvent(e,t,o),this.sendMessage(N.EI.AutoOpenError,[o,this.traceId])}catch(e){}}sendAutoShowPreventedMessage(e,t){e?.toString()&&this.sendMessage(N.EI.RecordAutoShowPrevented,[t[p.aE.nagivation_guid],e.toString()])}}(0,i.Z)(U,"lowPerformingNotificationsExp",[S.sR.AUTO_SHOW_REBATES,S.sR.AUTO_SHOW_REBATES_ORGANIC_NEW,S.sR.AUTO_SHOW_EXPRESS_CHECKOUT,S.sR.AUTO_SHOW_SUSTAINABILITY_LANDING,S.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK,S.sR.AUTO_PRODUCT_TRACKING_OUT_OF_STOCK]),(0,i.Z)(U,"shouldNotStandDown",[S.sR.AUTO_SHOW_REBATES_ACTIVATION_FAILED,S.sR.AUTO_SHOW_REBATES_SWITCHED_TO_MSA,S.sR.AUTO_SHOW_REWARDS_ACTIVATION_FAILED,S.sR.AUTO_SHOW_REWARDS_SWITCHED_TO_MSA,S.sR.AUTO_SHOW_PERSONALIZED_CASHBACK,S.sR.AUTO_SHOW_SERVER_DRIVEN_NOTIFICATION,S.sR.AUTO_SHOW_REBATES_CONFIRMATION,S.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION]);const w=new U},60782:function(e,t,o){o.d(t,{M:function(){return a}});var i=o(72370),r=o(21597);class a{static createListener(e,t,o,i){const r=i||window;let n=this.listeners.get(e);if(o&&o&&void 0!==n){for(const t of n)t.listenerContext.removeEventListener(e,t.callback);for(;n.length>0;)n.pop()}r.addEventListener(e,t),n||(n=[],a.listeners.set(e,n)),n.push({callback:t,listenerContext:i||window})}static handleInitializeRuntime(e){const t=e.length>r.aE.nagivation_guid?e[r.aE.nagivation_guid]:void 0;a.previousInitNavigationGuid&&t!==a.previousInitNavigationGuid&&a.removeListeners(),a.previousInitNavigationGuid=t}static removeListeners(){for(const[e,t]of a.listeners)for(const o of t)o.listenerContext.removeEventListener(e,o.callback);a.listeners.clear()}}(0,i.Z)(a,"listeners",new Map),(0,i.Z)(a,"previousInitNavigationGuid",void 0)},56577:function(e,t,o){o.d(t,{Fw:function(){return r}});var i=o(72370);let r=function(e){return e.OrderId="orderId",e}({});t.ZP=class{constructor(){(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"urlRegex",void 0),(0,i.Z)(this,"validationSelector",void 0),(0,i.Z)(this,"details",void 0),(0,i.Z)(this,"urlFields",void 0)}}},27900:function(e,t,o){o.d(t,{D8:function(){return r},OY:function(){return n},Vr:function(){return l},hm:function(){return s},l$:function(){return c},xD:function(){return a}});var i=o(72370);const r="CartProductBrandCollection",a=50,n="CartDataStorageInfo",s="CartDataFastCollection",c=432e5;class l{constructor(){(0,i.Z)(this,"OrderTotal",void 0),(0,i.Z)(this,"OrderSubTotal",void 0),(0,i.Z)(this,"CartDataCreationTime",void 0),(0,i.Z)(this,"CartId",void 0),(0,i.Z)(this,"CartPreTax",void 0),(0,i.Z)(this,"CartEstimatedTax",void 0),(0,i.Z)(this,"ShipmentDate",void 0),(0,i.Z)(this,"Currency",void 0),(0,i.Z)(this,"Products",void 0),(0,i.Z)(this,"ProductIds",void 0),(0,i.Z)(this,"ProductUrls",void 0),(0,i.Z)(this,"ExtractionId",void 0),(0,i.Z)(this,"BlockedCouponsData",void 0)}}},43686:function(e,t,o){var i=o(72370),r=o(14440);class a{constructor(){(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"cartValue",void 0),(0,i.Z)(this,"subTotal",void 0),(0,i.Z)(this,"currency",void 0),(0,i.Z)(this,"cartUrl",void 0),(0,i.Z)(this,"products",void 0),(0,i.Z)(this,"cartId",void 0),(0,i.Z)(this,"productIds",void 0)}static Create(e){const t=new a;return t.domain=e.domain??"",t.cartValue=e.cartValue??"",t.currency=e.currency??"",t.cartUrl=e.cartUrl??"",t.cartId=e.cartId??"",t.products=[],t.productIds="",e.products?.forEach((e=>{t.products.push(r.Z.Create(e))})),t}}t.Z=a},92572:function(e,t,o){o.d(t,{Z:function(){return U}});var i=o(72370),r=o(12727),a=o(9839),n=o(91495),s=o(27689),c=o(15267),l=o(11501),u=o(29247),d=o(4238),h=o(43315),p=o(82960),g=o(5144),C=o(12265),S=o(55590),m=o(36493),A=o(27900),P=o(33491);function f(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function E(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?f(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const T="PurchaseCart",O="TransactionIds";class I{constructor(e,t,o,r){(0,i.Z)(this,"logger",void 0),(0,i.Z)(this,"cashbackDao",void 0),(0,i.Z)(this,"scraperService",void 0),(0,i.Z)(this,"personalDataRemover",void 0),(0,i.Z)(this,"DEFAULT_EXTRACTION_TIMEOUT",5e3),(0,i.Z)(this,"extractionId",""),this.logger=e,this.scraperService=t,this.cashbackDao=o,this.personalDataRemover=r,this.extractionId=(new Date).getTime().toString()}isPurchaseExtractionEnabled(){return this.cashbackDao.getRetailerSettings()?.GetOtherFeatureFlag("isNewCollectionEnabled")??!1}isPurchaseExtractionEnabledLogOnly(){return this.cashbackDao.getRetailerSettings()?.GetOtherFeatureFlag("isNewCollectionEnabledLog",!0)??!1}async runExtraction(){try{let e={status:C._N.NOT_ENABLED,shouldLogFragment:!1,extractionTime:0};if(!this.isPurchaseExtractionEnabled()){if(!this.isPurchaseExtractionEnabledLogOnly())return this.logDebuggMesageToConsole("Purchase extraction not enabled"),e;e.status=C._N.LOG_ONLY}const t=this.cashbackDao.getPageType();if(t===g.GV.CheckoutPage){const o=this.cashbackDao.getCheckoutPageInfo(),i=this.cashbackDao.getAutomatedSelectorsDataForPage(t);this.addCartMonitor(o,i,t),this.addBuyNowButtonListener(o,i,t);const r=performance.now();e=await this.extractDataFromCheckoutPage(o,i,t);const a=performance.now();e.extractionTime=a-r,this.logDebugOrErrorEvent("Extraction ended",t,"",void 0,!1,E({},e))}else if(t===g.GV.ConfirmationPage){const o=performance.now();e=await this.extractConfirmationPageData(t);const i=performance.now();e.extractionTime=i-o,this.logDebugOrErrorEvent("Extraction ended",t,"",void 0,!1,E({},e))}else this.logDebugOrErrorEvent("No extraction on this page",t,"",void 0,!1),this.addBuyNowButtonListener(void 0,void 0,void 0),e={status:C._N.NON_PURCHASE_OR_CHECKOUT_PAGE,shouldLogFragment:!1},this.logDebuggMesageToConsole("No extraction on this page",t);return e}catch(e){return this.logDebugOrErrorEvent("Error in extraction",g.GV.UnknownPage,"",void 0,!0,e),{status:C._N.UNKNOWN_ERROR,shouldLogFragment:!1}}}async extractConfirmationPageData(e=g.GV.ConfirmationPage){if(!this.canLogConfirmationPageData())return{status:C._N.CONFIRMATION_LOG_NOT_ENABLED,shouldLogFragment:!0};const t=this.cashbackDao.getAutomatedSelectorsDataForPage(e),o=this.getPageRegexData(void 0,t,this.cashbackDao.getConfirmationPageRegex()),i=this.getExtractionSelectorsForPurchasePage(),r=this.getExtractionSelectorsAutomated(t),a=this.cashbackDao.isCartCachingEnabled(),n=this.cashbackDao.getLastCommittedURL(),s=this.cashbackDao.getRetailerSettings(),c=a?this.readCartData():void 0;this.logDebugOrErrorEvent("Extraction started",e,o,c);const{extractionResultFromOld:l,extractionResultFromAutomated:u,extractionResult:d,extractedValuesMerged:h}=await this.extractData(i,r,!0,t,e,o,c,this.getFilteredTransactionIdSelector(!0)),p=s?.isDisablePurchaseTotalCollectionOnConfirmation??!1,S=s?.isDisableProductNamesCollectionOnConfirmation??!1,m=this.mergeConfirmationDataWithCartCahing(h,c,p,S,n);this.logDebuggMesageToConsole("result confirmationDetails after merge",m);const A=this.IsAtLeaseOneRequiredFieldPresent(m),P=this.GetMissingRequiredFieldsMessage(m);this.logExtractionResults(d,l,u,h,c,void 0,i,r,P,A,e,o,void 0);const f={isCartCachingEnabled:a,selectorsUsed:i,emptyRequiredFieldsMessage:P,pageType:e,pageRegexData:o};if(!A)return{status:C._N.FAILED_TO_EXTRACT_DATA,shouldLogFragment:!0,dataToLog:f};if(this.isTransactionIdSaved(m.transactionId)){const t=this.personalDataRemover.maskDataInAString(m.transactionId);return this.logDebugOrErrorEvent(`Purchase already recorded: ${t}`,e,o,c),{status:C._N.PURCHASE_ALREADY_RECORDED,shouldLogFragment:!1}}const E=this.cashbackDao.getAnid(),T=this.createLogData(m,E??"",t?.urlFields??null);return this.isPurchaseExtractionEnabled()?this.logPurchasePageData(T,c):this.logPurchasePageDataToDebug(T,c,e,o),this.clearCache(),this.saveTransactionIdToLocalStorage(m.transactionId),P?{status:C._N.EXTRACTION_SUCCESSFULL_BUT_MISSING_FIELDS,shouldLogFragment:!0,dataToLog:f}:{status:C._N.EXTRACTION_SUCCESSFULL,shouldLogFragment:!1}}async extractDataFromCheckoutPage(e=void 0,t=void 0,o=void 0){const i=o??g.GV.CheckoutPage,r=t??this.cashbackDao.getAutomatedSelectorsDataForPage(i),a=e??this.cashbackDao.getCheckoutPageInfo(),n=this.getPageRegexData(a,r),s=a?.cartSelectors,c=this.readCartData();this.logDebugOrErrorEvent("Extraction started",i,n,c);const l=this.getExtractionSelectors(s,a),u=this.getExtractionSelectorsAutomated(r),{extractionResultFromOld:d,extractionResultFromAutomated:h,extractionResult:S,extractedValuesMerged:A}=await this.extractData(l,u,!1,r,i,n,c),P={OrderTotal:(0,m.K)(A.orderTotal),ProductNames:A.productTitle,PricePerItem:A.productPrice,QuantityPerItem:A.productQuantity,Currency:this.getCurrency(A.orderTotal),ProductUrls:A.productSkus,ProductIds:A.productSkus,OrderSubTotal:(0,m.K)(A.orderSubTotal),ExtractionId:p.v.uuidv4(),CartDataCreationTime:Date.now(),CartId:p.v.uuidv4(),ExtractionPageRegex:n,ProductSelllers:A.productSellers};if(this.logDebuggMesageToConsole("newCartDataStorageInfo",P),!this.IsNewCart(P,c))return this.logDebugOrErrorEvent("Cached cart not sent, not new cart",i,n,P),{status:C._N.CACHED_CART_DATA_NOT_SENT,shouldLogFragment:!1};const f=this.mergeCartData(c,P);return this.logExtractionResults(S,d,h,A,c,P,l,u,"",!0,i,n,f),this.saveCartData(f),this.logCheckoutPageData(f,i,n),{status:C._N.EXTRACTION_SUCCESSFULL,shouldLogFragment:!1}}logExtractionError(e){const t=e.metadata||e.errorMessage?E({errorMessage:e.errorMessage??""},e.metadata||{}):void 0,o=this.createEventForSelectorLogger(e.pageType??g.GV.UnknownPage,e.pageRegexData??"",t,"Error in ScrapperService flow",e.msg,!0);o.IsBrokenSelectorDetected=e.isBrokenSelectorDetected??!1,o.IsPartialBrokenSelectorDetected=e.isPartialBrokenSelectorDetected??!1,o.FullSelectorUsed=e.fullSelectorUsed??"",o.PartialSelectorUsed=e.brokenSelectorPart??"",this.logSelectorDataEvent(o)}async extractData(e,t,o,i,r,a,n,s=""){const l=e=>{e.pageType=r,e.pageRegexData=a,e.cartCachingData=n,this.logExtractionError(e)},u=this.shouldEnableOldExtractionMethod()?this.scraperService.extractDataOld(e,l.bind(this)):Promise.resolve(void 0),d=this.scraperService.extractFrom(document,e,l.bind(this),!1),h=this.shouldDisableFallbackToAutomatedSelectors()?Promise.resolve(void 0):this.scraperService.extractFrom(document,t,l.bind(this),!0),[p,g,C]=await Promise.all([u,h,d]);let S="",m="";if(o){const e=this.cashbackDao.getLastCommittedURL();if(i){const t=(0,c.sB)(i);S=(0,c.RT)(t,e)}s&&(m=(0,c.ql)(s,e))}m&&(C&&(C.transactionId=m),p&&(p.transactionId=m)),S&&g&&(g.transactionId=S);const A=this.mergeExtractedData(C,p,g);return(m||S)&&(A.transactionId=m||S),{extractionResultFromOld:p,extractionResultFromAutomated:g,extractionResult:C,extractedValuesMerged:A}}shouldDisableFallbackToAutomatedSelectors(){return this.cashbackDao.getRetailerSettings()?.GetOtherFeatureFlag("isFallbackToAutomatedSelectorsDisabled")??!1}shouldEnableOldExtractionMethod(){return this.cashbackDao.getRetailerSettings()?.GetOtherFeatureFlag("isEnableOldExtractionMethod")??!1}canLogConfirmationPageData(){return this.cashbackDao.getRetailerSettings()?.IsAttibutionEnabled()??!1}async addBuyNowButtonListener(e,t,o){const i=e??this.cashbackDao.getPageInfo(),r=o??i?.pageType??g.GV.UnknownPage,a=i?.buyNowSelector??"";if(!a)return;const n=this.createSelectorSetting(a,"buyNowButton"),s=this.getPageRegexData(i,t),c=await this.scraperService.getElementForSelector(n,(e=>{e.pageType=r,e.pageRegexData=s,e.cartCachingData=void 0,this.logExtractionError(e)}).bind(this));c&&c.addEventListener("click",(()=>{this.logDebugOrErrorEvent("Buy Now clicked",r,s,void 0),this.extractDataFromCheckoutPage(i,t,r)}))}async addCartMonitor(e,t,o=g.GV.CheckoutPage){const i=e?.orderTotalDataElementSelector||t?.details?.orderTotalPrice||"";if(i){const r=this.getPageRegexData(e,t),a=e=>{e.pageType=o,e.pageRegexData=r,e.cartCachingData=void 0,this.logExtractionError(e)},n=()=>{this.extractDataFromCheckoutPage(e,t,o)},s=this.createSelectorSetting(i,"cartMutationObserver");await this.scraperService.addMutationObserver(s,a.bind(this),n.bind(this))}}getPageRegexData(e,t,o=""){return JSON.stringify({automated:t?.urlRegex??"",regular:e?.checkoutPageUrl||o})}saveCartData(e){const t=e?JSON.stringify(e):"";this.cashbackDao.saveToLocalCache(T,t),this.cashbackDao.saveToLocalCachePersistent(T,t)}getCurrency(e){const t=this.cashbackDao.getAfdMarket(),o=(0,m.N6)(t);return(e?(0,m.cU)(e,!0):"")||o||""}mergeCartData(e,t){return{OrderTotal:t?.OrderTotal||e?.OrderTotal||0,ProductNames:t?.ProductNames||e?.ProductNames||"",PricePerItem:t?.PricePerItem||e?.PricePerItem||"",QuantityPerItem:t?.QuantityPerItem||e?.QuantityPerItem||"",Currency:t?.Currency||e?.Currency||"",ProductUrls:t?.ProductUrls||e?.ProductUrls||"",ProductIds:t?.ProductIds||e?.ProductIds||"",OrderSubTotal:t?.OrderSubTotal||e?.OrderSubTotal||0,ExtractionId:t?.ExtractionId||e?.ExtractionId||"",CartDataCreationTime:t?.CartDataCreationTime||e?.CartDataCreationTime||0,CartId:t?.CartId||e?.CartId||"",ExtractionPageRegex:t?.ExtractionPageRegex||e?.ExtractionPageRegex||"",ProductSelllers:t?.ProductSelllers||e?.ProductSelllers||""}}mergeExtractedData(e,t,o){return{productQuantity:e?.productQuantity||t?.productQuantity||o?.productQuantity||"",productTitle:e?.productTitle||t?.productTitle||o?.productTitle||"",productPrice:e?.productPrice||t?.productPrice||o?.productPrice||"",productTitleFromImage:e?.productTitleFromImage||o?.productTitleFromImage||o?.productTitleFromImage||"",productSkus:e?.productSkus||t?.productSkus||o?.productSkus||"",orderTotal:e?.orderTotal||t?.orderTotal||o?.orderTotal||"",orderSubTotal:e?.orderSubTotal||t?.orderSubTotal||o?.orderSubTotal||"",transactionId:e?.transactionId||t?.transactionId||o?.transactionId||"",productSellers:e?.productSellers||t?.productSellers||o?.productSellers||""}}mergeConfirmationDataWithCartCahing(e,t,o,i,r){const a=new h.Z;if(a.orderConfirmationPageUrl=r,a.transactionId=e.transactionId,t&&this.setConfirmationDetailsFromCartCaching(t,a),a.productNames&&i||this.setProductNamesFromPurchasePageIfPresent(e,a),a.purchaseTotal&&o||this.setOrderTotalAndCurrencyIfPresent(e,a),e.orderSubTotal&&(a.orderSubTotalPrice=e.orderSubTotal),e.productQuantity&&(a.quantityPerItem=e.productQuantity),e.productPrice&&(a.pricePerItem=e.productPrice),a.productNames){const e=a.productNames.split(this.scraperService.getSeparator());a.numberOfItems=e.length.toString()}return a}createLogData(e,t,o){const{isElectron:i,isChromeDriver:r,driverEvaluate:a,webdriverEvaluate:n,seleniumUnwrapped:c,windowCallPhantom:l,WINDOW_PHANTOM:u,windowPhantom:d}=this.getBrowserData(),h=this.cashbackDao.getSessionIds(),p=h?.retailerSessionId??"",g=h?.pageVisitId??"";let C=e.productNames,S=e.transactionId??"";const m=this.getDynamicTransactionId();let A=e.orderConfirmationPageUrl,P=!1;S=this.personalDataRemover.maskDataInAString(S),C=this.personalDataRemover.maskDataInAString(C),A=this.personalDataRemover.deleteSecretsInURL(A);const f=this.cashbackDao.getPersonalizedCashback();return this.cashbackDao?.getRetailerSettings()?.transactionIdSettings?.shouldAutoGenerate&&(S=m,P=!0),{Currency:e.currency??"",Domain:(0,s.uE)(window.location.hostname),DriverEvaluate:a?JSON.stringify(a):"",EventId:this.GetEventId(),IsChromeDriver:r,IsElectron:i,NavigatorWebdriver:navigator.webdriver??!1,NumberOfItems:e.numberOfItems??"",OrderConfirmationPageUrl:A??"",OrderConfirmationPageUrlRegex:(0,s.og)(A,this.cashbackDao.getConfirmationPageRegex()),OrderDiscountCode:e.orderDiscountCode??"",OrderDiscountPrice:e.orderDiscountPrice??"",OrderShippingPrice:e.orderShippingPrice??"",OrderSubTotalPrice:e.orderSubTotalPrice??"",OrderTaxesPrice:e.orderTaxesPrice??"",Platform:this.cashbackDao.getPlatform(),PricePerItem:e.pricePerItem??"",ProductIdSku:e.productIdSku??"",ProductNames:C??"",ProductSellerNames:e.productSellerNames??"",PurchaseTotal:e.purchaseTotal??"",QuantityPerItem:e.quantityPerItem??"",PersonalizationDataConsent:this.cashbackDao.getSanConsentFlag(),Rguid:f?.rGuid??"",SeleniumUnwrapped:c??"",TransactionId:S,WebdriverEvaluate:n??"",WindowCallPhantom:l??"",WindowPhantom:d?JSON.stringify(d):"",Window_Phantom:u?JSON.stringify(u):"",DomainCountry:"",RetailerDataDomain:this.cashbackDao.getCurrentDomain(),ExactConfirmationPageUrl:this.cashbackDao.getConfirmationPageRegex()??"",ESF:this.cashbackDao.getESF(),Anid:t,ActiveCashbackOffers:f?JSON.stringify(f):"",IsAADSignedIn:this.cashbackDao.isAadSignedIn(),PageUrlFields:o,PageVisitId:g,RetailerSessionId:p,DynamicTransactionId:m,IsDynamicTransaction:P,ProductBrandNames:this.getBrandNamesFromCachedProductNames(C)??""}}getBrandNamesFromCachedProductNames(e){let t=[];if(e)try{let o=JSON.parse((0,P.Mw)(A.D8)||"[]");const i=e?.split(this.scraperService.getSeparator());i&&i.pop();for(const e of i){let i="";for(const t of o)t?.ProductName?.includes(e)&&(i=t?.ProductBrandName??"");t.push(i)}}catch(e){this.logDebugOrErrorEvent("Couldn't extract brand names from cached product PDP info;",g.GV.UnknownPage,"",void 0,!0,{error:e})}return t?.join(this.scraperService.getSeparator())+this.scraperService.getSeparator()}getDynamicTransactionId(){try{const e=n.Q?.CheckoutPageNavigatedTime,t=n.Q?.DynamicTransactionId??"",o=this.stringToDate(e??""),i=o&&this.isValidTimeDifference(o,new Date)?t:"";return this.logDebuggMesageToConsole("Dynamic Transaction Id ->",i),this.logDebuggMesageToConsole("Dynamic Transaction Id checkout time",o),i??""}catch(e){return""}}saveTransactionIdToLocalStorage(e){if(!e)return;const t=this.getSavedTransactionIds(),o=this.cashbackDao.getCurrentDomain();t[o]||(t[o]={});const i=new Date;t[o][e]=i.getTime().toString(),this.cashbackDao.saveToLocalCache(O,JSON.stringify(t))}isTransactionIdSaved(e){if(!e)return!1;const t=this.getSavedTransactionIds(),o=this.cashbackDao.getCurrentDomain();return Boolean(t&&t[o]&&t[o][e])}getSavedTransactionIds(){return this.cashbackDao.readFromLocalCache(O)??{}}clearCache(){this.cashbackDao.saveToLocalCachePersistent(S.Q.CheckoutPageNavigatedTime,JSON.stringify({value:""})),this.cashbackDao.saveToLocalCachePersistent(S.Q.DynamicTransactionId,JSON.stringify({value:""})),this.saveCartData()}logCheckoutPageData(e,t,o){this.logDebuggMesageToConsole("logging checkout page event",e);const i=this.createEventForSelectorLogger(t,o,void 0,"NewExtraction:::CheckoutData","",!1,e);this.logSelectorDataEvent(i)}logDebugOrErrorEvent(e,t,o,i,r=!1,a){const n=this.createEventForSelectorLogger(t,o,a,e,"",r,i);this.logSelectorDataEvent(n)}logSelectorDataEvent(e){this.logDebuggMesageToConsole(e.Message),this.logger.LogInfoWithEvenType(e.Message,g.R.SelectorDataExtraction,e,this.cashbackDao.getImpressionId())}logPurchasePageDataToDebug(e,t,o,i){e.Anid="",this.logDebuggMesageToConsole("logging purchase event to log table only",e);const r=this.createEventForSelectorLogger(o,i,{confirmationEvent:e},"New purchase extraction event","",!1,t);this.logger.LogInfoWithEvenType(r.Message,g.R.SelectorDataExtraction,r,this.cashbackDao.getImpressionId())}logPurchasePageData(e,t){this.logDebuggMesageToConsole("logging purchase event",e);const o={isNewExtraction:!0,cachedCart:t,extractionId:this.extractionId};this.logger.LogInfoWithEvenType(JSON.stringify(o),g.R.ConfirmationPageDetails,e,this.cashbackDao.getImpressionId())}readCartData(){const e=this.cashbackDao.readFromLocalCachePersistent(T);return this.cashbackDao.readFromLocalCache(T)||e}setProductNamesFromPurchasePageIfPresent(e,t){e.productTitle?t.productNames=e.productTitle:e.productTitleFromImage&&(t.productNames=e.productTitleFromImage)}setOrderTotalAndCurrencyIfPresent(e,t){let o=0;const i=(0,m.K)(e.orderTotal);if(i>0)o=i;else{const t=(0,m.K)(e.orderSubTotal);t>0&&(o=t)}let r=(0,m.cU)(e.orderTotal,!0);r||(r=e.productPrice?(0,m.cU)(e.productPrice,!0):""),r||(r=e.orderSubTotal?(0,m.cU)(e.orderSubTotal,!0):""),r&&(t.currency=r),o>0&&(t.purchaseTotal=`${t.currency}${o}`)}setConfirmationDetailsFromCartCaching(e,t){t.pricePerItem=e.PricePerItem??"",t.quantityPerItem=e.QuantityPerItem??"",t.productUrls=e.ProductUrls??"",t.productNames=e.ProductNames??"";const o=e.Currency??"",i=e.OrderTotal>0?e.OrderTotal:0,r=e.OrderSubTotal&&e.OrderSubTotal>=0?e.OrderSubTotal:0,a=i>0?i:r;t.orderSubTotalPrice=r>0?`${o}${r}`:"",t.purchaseTotal=a>0?`${o}${a}`:"",t.currency=o,t.productSellerNames=e.ProductSelllers??""}GetTimeoutForSelector(e){const t=this.cashbackDao.getRetailerSettings()?.selectorTimeouts;return e&&t&&void 0!==t[e]?t[e]:this.DEFAULT_EXTRACTION_TIMEOUT}IsAtLeaseOneRequiredFieldPresent(e){return Boolean(e.transactionId||e.productNames||e.purchaseTotal&&"0"!==e.purchaseTotal)}logExtractionResults(e,t,o,i,r,a,n,s,c,l,u,d,h=void 0){if(n&&this.logDebuggMesageToConsole("selectors extractByValues",n),s&&this.logDebuggMesageToConsole("selectors extractByValues_Automated",s),e&&this.logDebuggMesageToConsole("result extraction_Result",e),t&&this.logDebuggMesageToConsole("result extraction_Result_Old",t),o&&this.logDebuggMesageToConsole("result extraction_ResultFrom_Automated",o),this.logDebuggMesageToConsole("result extractedData_merged",i),r&&this.logDebuggMesageToConsole("old cartCachingData",r),a&&this.logDebuggMesageToConsole("new cartCachingData",a),h&&this.logDebuggMesageToConsole("mergedCart",h),this.LogMissingExtractedValuesForSelectors(n,e,"general",h??a??r,u,d),t&&this.LogMissingExtractedValuesForSelectors(n,t,"old",h??a??r,u,d),o&&this.LogMissingExtractedValuesForSelectors(s,o,"automated",h??a??r,u,d),!l){const e=this.cashbackDao.isCartCachingEnabled(),t=this.createEventForSelectorLogger(u,d,{isCartCachingEnabled:e,selectorsUsed:n},"No valid required fields",c,!0,h??a??r);this.logSelectorDataEvent(t)}}LogMissingExtractedValuesForSelectors(e,t,o,i,r,a){if(!e){const e=this.createEventForSelectorLogger(r,a,void 0,"No selectors for page",o,!0,i,t);return void this.logSelectorDataEvent(e)}const n={productTitle:!0,productTitleFromImage:!0,orderTotal:!0,orderSubTotal:!0,transactionId:!0,productQuantity:!1,productPrice:!1,productSkus:!1,productSellers:!1};let s={};if(Object.keys(e).forEach((o=>{if(n[o]){const i=e[o],r=t?t[o]:void 0;i?.selector&&!r&&(s[o]?s[o]+=`; ${i.selector}`:s[o]=i.selector)}})),Object.keys(s).length>0){const e=this.createEventForSelectorLogger(r,a,void 0,"Broken selectors found",o,!0,i,t);e.BrokenSelectors=JSON.stringify(s),e.IsBrokenSelectorDetected=!0,this.logSelectorDataEvent(e)}}GetMissingRequiredFieldsMessage(e){return e.productNames&&e.purchaseTotal&&"0"!==e.purchaseTotal&&e.transactionId?"":`${e.productNames?"":"Empty productNames;"}${e.purchaseTotal?"0"==e.purchaseTotal?"PurchaseTotal is 0":"":"Empty purchaseTotal;"}${e.transactionId?"":"Empty transactionId;"}`}GetEventId(){let e=p.v.uuidv4();return e&&""!==e||(e=this.uuidv4()),e}uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}isValidTimeDifference(e,t){try{const o=t.getTime()-e.getTime(),i=Math.floor(o/1e3),r=Math.floor(i/60);return this.logDebuggMesageToConsole("Dynamic Transaction Id - purchase time",t),this.logDebuggMesageToConsole("Dynamic Transaction Id - checkout time",e),this.logDebuggMesageToConsole("Dynamic Transaction Id - minutes",r),r>3&&this.logDebuggMesageToConsole("Dynamic Transaction Id waited more than 3 minutes"),r<=3}catch(e){return!1}}stringToDate(e){try{if(""===e)return;const[t,o]=e.split(" "),[i,r,a]=t.split("-").map(Number),[n,s,c]=o.split(":").map(Number);return new Date(i,r-1,a,n,s,c)}catch(e){return}}getBrowserData(){let e="",t="",o="",i="",r=!1;const a=window?.windowCallPhantom,n=window?._phantom,s=window?.phantom;return document?.documentElement?.hasAttribute("__selenium_unwrapped")&&(e=document.documentElement.getAttribute("__selenium_unwrapped")),document?.documentElement?.hasAttribute("__webdriver_evaluate")&&(t=document.documentElement.getAttribute("__webdriver_evaluate")),document?.documentElement?.hasAttribute("__driver_evaluate")&&(o=document.documentElement.getAttribute("__driver_evaluate")),document?.documentElement?.hasAttribute("$cdc_asdjflasutopfhvcZLmcfl_")&&(i=typeof document.documentElement.getAttribute("$cdc_asdjflasutopfhvcZLmcfl_")),r="undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process?.type||!("undefined"==typeof process||"object"!=typeof process.versions||!process.versions.hasOwnProperty("electron")),{isElectron:r,isChromeDriver:i,driverEvaluate:o,webdriverEvaluate:t,seleniumUnwrapped:e,windowCallPhantom:a,WINDOW_PHANTOM:n,windowPhantom:s}}createEventForSelectorLogger(e,t,o,i,r,a,n=void 0,s=void 0){let c;c=n||this.readCartData();const l=this.cashbackDao.getSanConsentFlag(),u=this.cashbackDao.getSessionIds();return{IsBrokenSelectorDetected:!1,IsPartialBrokenSelectorDetected:!1,BrokenSelectors:"",FullSelectorUsed:"",PartialSelectorUsed:"",Currency:n?.Currency??"",ExtractionResult:l&&s?JSON.stringify(s):"",CartData:l&&c?JSON.stringify(c):"",ErrorMessage:r,Metadata:o?JSON.stringify(o):"",Message:i,IsError:a,PageUrl:this.getCurrentUrlValue(!0),PageType:e,PageRegexUsed:t,Domain:this.cashbackDao.getCurrentDomain(),AFDMarket:this.cashbackDao.getAfdMarket(),IsSignedIn:this.cashbackDao.isSignedIn(),PageVisitId:u?.pageVisitId??"",RetailerSessionId:u?.retailerSessionId??"",PersonalizationDataConsent:l,ExtractionId:this.extractionId}}IsNewCart(e,t){return t?e.ExtractionPageRegex!==t.ExtractionPageRegex?(this.logDebuggMesageToConsole("New and old cart difference: ExtractionPageRegex"),!0):e.Currency!==t.Currency?(this.logDebuggMesageToConsole("New and old cart difference: Currency"),!0):e.OrderTotal!==t.OrderTotal?(this.logDebuggMesageToConsole("New and old cart difference: OrderTotal"),!0):e.ProductNames!==t.ProductNames?(this.logDebuggMesageToConsole("New and old cart difference: ProductNames"),!0):e.OrderSubTotal!==t.OrderSubTotal&&(this.logDebuggMesageToConsole("New and old cart difference: OrderSubTotal"),!0):(this.logDebuggMesageToConsole("no cached cart"),!0)}getExtractionSelectorsForPurchasePage(){const e=this.cashbackDao.getConfirmationPageTelemetryData(),t=e?.productDetailsData&&e.productDetailsData.length>0?e.productDetailsData[0]:void 0;if(!e&&!t)return;const o=this.getFilteredTransactionIdSelector(!1),i={productQuantity:this.createSelectorSetting(t?.productQuantitySelector,"productQuantity"),productTitle:this.createSelectorSetting(t?.productIdSelector,"productNames"),productTitleFromImage:this.createSelectorSetting(t?.productImageSelector,"productNamesFromImg"),productPrice:this.createSelectorSetting(t?.productPriceSelector,"productPrice"),productSkus:this.createSelectorSetting(t?.productIdSkuSelector,"productId"),orderTotal:this.createSelectorSetting(e?.purchaseTotalSelector,"orderTotalPrice"),orderSubTotal:this.createSelectorSetting(e?.orderSubTotalPriceSelector,"orderSubTotalPrice"),transactionId:this.createSelectorSetting(o,"transactionId"),productSellers:{selector:"",timeout:0}};return this.addExtractMultipleFlag(i)}getFilteredTransactionIdSelector(e){const t=this.cashbackDao.getConfirmationPageTelemetryData();return(t?.transactionIdSelector?.split(",")??[]).filter((t=>e?(0,c.Ae)(t):!(0,c.Ae)(t))).join(",")}getExtractionSelectors(e,t){if(!e&&!t)return;const o={productQuantity:this.createSelectorSetting(e?.productQuantitySelector,"productQuantity"),productTitle:this.createSelectorSetting(e?.productTitleSelector,"productNames"),productPrice:this.createSelectorSetting(e?.productPriceSelector,"productPrice"),productSkus:this.createSelectorSetting(e?.productIdSkuSelector,"productId"),productTitleFromImage:this.createSelectorSetting(e?.productImageSelector,"productNamesFromImg"),orderTotal:this.createSelectorSetting(t?.orderTotalDataElementSelector,"orderTotalPrice"),orderSubTotal:this.createSelectorSetting(t?.orderSubTotalElementSelector,"orderSubTotalPrice"),transactionId:{selector:"",timeout:0},productSellers:this.createSelectorSetting(e?.productSellerSelector,"productSeller")};return this.addExtractMultipleFlag(o)}getExtractionSelectorsAutomated(e){const t={productQuantity:this.createSelectorSetting(e?.details?.productQuantity,"productQuantity"),productTitle:this.createSelectorSetting(e?.details?.productName,"productNames"),productPrice:this.createSelectorSetting(e?.details?.productPrice,"productPrice"),productSkus:this.createSelectorSetting(e?.details?.productId,"productId"),productTitleFromImage:this.createSelectorSetting(e?.details?.getProductNamesFromImg,"productNamesFromImg"),orderTotal:this.createSelectorSetting(e?.details?.orderTotalPrice,"orderTotalPrice"),orderSubTotal:this.createSelectorSetting(e?.details?.orderSubTotalPrice,"orderSubTotalPrice"),transactionId:this.createSelectorSetting(e?.details?.orderId,"transactionId"),productSellers:{selector:"",timeout:0}};return this.addExtractMultipleFlag(t)}getCurrentUrlValue(e){return this.personalDataRemover.getCurrentUrlValue(e,this.cashbackDao.getLastCommittedURL())}createSelectorSetting(e,t){return{selector:e??"",timeout:this.GetTimeoutForSelector(t)}}addExtractMultipleFlag(e){const t={productQuantity:!0,productTitle:!0,productPrice:!0,orderTotal:!1,orderSubTotal:!1,transactionId:!1,productTitleFromImage:!0,productSkus:!0,productSellers:!0};return Object.keys(e).forEach((o=>{if(t[o]&&e[o]){const i=t[o]??!1;e[o].shouldExtractAll=i}})),e}logDebuggMesageToConsole(...e){}}class _{LogColdPathTelemetryEvent(e,t,o,i,r=!1){a.Q.sendLogEventMessageV2(o,t,i,e,r?g.in.Error:g.in.Information)}LogInfoWithEvenType(e,t,o,i){a.Q.sendLogEventMessage(o,t,i,e,g.in.Information)}}var v=o(45822),R=o(64865);function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function N(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?D(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):D(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}class y{constructor(){(0,i.Z)(this,"mutationObserver",void 0)}getSeparator(){return y.SEP}async getElementForSelector(e,t){try{return e.timeout>0&&await(0,u._R)(e.timeout),this.GetFirstVisibleElement(e.selector)}catch(o){t({msg:"ERROR getElementForSelector",errorMessage:o.toString(),metadata:N({},e)})}}async extractFrom(e,t,o,i=!1){if(!t)return;let r=!1;const a={productQuantity:"",productTitle:"",productPrice:"",productTitleFromImage:"",productSkus:"",orderTotal:"",orderSubTotal:"",transactionId:"",productSellers:""};try{const n=[],s=Object.keys(t);s.forEach((r=>{const a=t[r];n.push(this.extractFromElement(a,e,a.shouldExtractAll??!1,o,i))}));const c=await Promise.all(n);for(let e=0;e<s.length;e++)a[s[e]]=c[e],r||(r=!!c[e])}catch(r){o({msg:"ERROR extractFrom",errorMessage:r.toString(),metadata:{element:typeof e,valueSelectors:t,isFromAutomated:i}})}return r?a:void 0}async extractDataOld(e,t){if(!e)return;const o=this.GetItemizedProductData(e.productTitle,t),i=this.GetItemizedProductData(e.productPrice,t),r=this.GetItemizedProductData(e.productQuantity,t),a=this.GetItemizedProductData(e.productSkus,t),n=this.GetProductNamesFromImage(e.productTitleFromImage.selector,t),s=this.GetDataBySelector(e.transactionId,this.isValidString,t),c=this.GetDataBySelector(e.orderTotal,this.IsStringContainNumbers,t),l=this.GetDataBySelector(e.orderSubTotal,this.IsStringContainNumbers,t),u=this.GetItemizedProductData(e.productSellers,t),[d,h,p,g,C,S,m,A]=await Promise.all([o,i,r,a,c,l,s,u]);return{productQuantity:p,productTitle:d,productPrice:h,productTitleFromImage:n,productSkus:g,orderTotal:C,orderSubTotal:S,transactionId:m,productSellers:A}}async addMutationObserver(e,t,o){try{const t={attributes:!0,characterData:!0,childList:!0,subtree:!0};if(this.mutationObserver||(this.mutationObserver=new MutationObserver((async e=>{await o()}))),e.selector){e.timeout>0&&await(0,u.dz)((async()=>void 0!==this.GetFirstVisibleElement(e.selector)),e.timeout);const o=this.GetFirstVisibleElement(e.selector);o&&(this.mutationObserver?.disconnect(),this.mutationObserver?.observe(o,t))}}catch(o){t({msg:"error adding monitor",errorMessage:o.toString(),metadata:{selectorSettings:e}})}}async extractFromElement(e,t,o,i,r){let a="";try{if(!e.selector)return"";a=this.extractDataFromElement(e.selector,t,o,i,e.useInnerText??!1,r),!a&&e.timeout&&(await(0,u._R)(e.timeout),a=this.extractDataFromElement(e.selector,t,o,i,e.useInnerText??!1,r))}catch(t){i({msg:"error in extractFromElement",errorMessage:t.toString(),fullSelectorUsed:e.selector,metadata:{isFromAutomated:r}})}return a}extractDataFromElement(e,t,o,i,r,a){if(e.includes(y.SHADOW_ROOT_SEP)){const i=this.getShadowRootData(e,t);return this.extractAsTextShadowRoots(i,o,r)}let n="";if(e&&e.includes(",")){const s=e.split(",").reverse();let c=!1;for(const l of s){const s=this.extractAsText(t,l,o,r);if(s){c=!0,n=s;break}i({msg:"Value not found for partial selector",brokenSelectorPart:l,isPartialBrokenSelectorDetected:!0,fullSelectorUsed:e,metadata:{isFromAutomated:a}})}c||(n=this.extractAsText(t,e,o,r),n||i({msg:"Broken selector full",fullSelectorUsed:e,isBrokenSelectorDetected:!0,metadata:{isFromAutomated:a}}))}else n=this.extractAsText(t,e,o,r),n||i({msg:"Broken selector full",fullSelectorUsed:e,isBrokenSelectorDetected:!0,metadata:{isFromAutomated:a}});return n}extractAsTextShadowRoots(e,t,o){let i="";for(let r of e)if(r){const e=this.getTextContent(r,o);if(e){if(!t)return e;i+=e+y.SEP}}return i}extractAsText(e,t,o,i){let r="";if(o)e.querySelectorAll(t).forEach((e=>{if(e){const t=this.getTextContent(e,i);t&&(r+=t+y.SEP)}}));else{const o=e.querySelector(t);r=this.getTextContent(o,i)}return r}getTextContent(e,t){let o="";if(e&&"select"===e.tagName.toLowerCase()){const t=e;o=t.options&&t.options[t.selectedIndex]?.text||""}else o=e&&"input"===e.tagName.toLowerCase()?e.value:t&&e?e.innerText??"":e?.textContent??"";return(o?this.StripMultipleSpaces(this.StripInvalidJSONCharacters(o)):"").trim()}isValidString(e){return!!e}IsStringContainNumbers(e){return new RegExp("/[0-9]/").test(e)}GetValueCommaSplit(e,t,o){let i="";if((e=e.replace(/;/g,","))&&e.includes(",")){const r=e.split(",").reverse();let a=!1;for(const e of r){const r=this.GetBoxValue(e,o);if(r&&t(r)){a=!0,i=r;break}}a||(i=this.GetBoxValue(e,o))}else i=this.GetBoxValue(e,o);return i?i.trim():""}GetBoxValue(e,t){if(e&&(0,u.UE)(e))try{const t=this.GetTextValue(e);if(t)return t.trim()}catch(e){t(e.message)}return""}GetTextValue(e){const t=e.split(";"),o=this.GetFirstVisibleElement(t[0]);let i=o;if(void 0===i)return"";let r=i.innerText;if(1===t.length)i=this.NormalizeIfSuperscripted(o),r=i?.innerText??"";else{const e=this.GetFirstVisibleElement(t[1]);if(e&&e.innerText){const t="."+e.innerText;if(i.contains(e)){const e=i.cloneNode(!0);e.childNodes.forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&e.removeChild(t)})),r=e?.innerText?e.innerText:r}r+=t}}return this.StripInvalidJSONCharacters(r)}StripMultipleSpaces(e){return e.replace(/\s\s+/g," ")}StripInvalidJSONCharacters(e){return e.replace(/\n/gi,"")}NormalizeIfSuperscripted(e){if(e&&e.innerHTML&&e.innerHTML.toLowerCase().indexOf("</sup>")>-1){const t=e.cloneNode(!0),o=t.childNodes.length;for(let e=0;e<o;e++){const o=t.childNodes[e];if("SUP"===o.tagName){let e=o.innerText;const i=/[0-9\.]+/g.exec(e);if(null!==i)return e="."+i[0],o.innerText=e,t}}}return e}GetProductNamesFromImage(e,t){try{if((0,u.UE)(e)){const t=this.RunQuerySelectorAll(e);let o="";for(const e of t){const t=e?.getAttribute("alt");t&&(o+=t+y.SEP)}return o}return""}catch(o){t({msg:"error in GetProductNamesFromImage",errorMessage:o.toString(),fullSelectorUsed:e})}return""}async GetItemizedProductData(e,t){try{if(!e.selector||(0,R.TF)(e.selector)||!(0,u.UE)(e.selector))return"";let t;return await(0,u.dz)((async()=>(t=this.GetFirstVisibleElement(e.selector??""),void 0!==t)),e.timeout),this.GetItemizedData(e.selector??"",y.SEP)}catch(o){t({msg:"error in GetItemizedProductData",errorMessage:o.toString(),fullSelectorUsed:e.selector})}return""}async GetDataBySelector(e,t,o){return e.selector&&!(0,R.TF)(e.selector)&&(0,u.UE)(e.selector)?await(0,u.dz)((async()=>this.RunQuerySelectorAll(e.selector).length>0),e.timeout).then((async()=>this.GetValueCommaSplit(e.selector,t,o))).catch((t=>(o({msg:"error in GetDataBySelector",errorMessage:t.toString(),fullSelectorUsed:e.selector}),""))):""}GetItemizedData(e,t,o){let i="";if(e){const r=this.RunQuerySelectorAll(e,o);for(const e of r)e&&e.textContent&&(i+=e.textContent.trim()+t)}return i}GetFirstVisibleElement(e,t){if(!(0,u.UE)(e))return;const o=e.split(";");for(const e of o)try{const o=this.RunQuerySelectorAll(e,t);for(const e of o)if(this.IsElementVisible(e))return e}catch(e){}}RunQuerySelectorAll(e,t){if(!(0,u.UE)(e))return[];e=e.replace(/;/g,",");const o=t??document;return this.getShadowRootData(e,o)}getShadowRootData(e,t){const o=e.split(y.SHADOW_ROOT_SEP);let i=t.querySelectorAll(o[0]);for(const e of o.slice(1)){const t=i[0]?.shadowRoot;if(!t)break;i=t.querySelectorAll(e)}return i||[]}IsElementVisible(e){return e&&e.offsetWidth>0&&e.offsetHeight>0}}(0,i.Z)(y,"SEP","<SEP>"),(0,i.Z)(y,"SHADOW_ROOT_SEP","<");var b=y;class k{constructor(e,t,o,r){(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"personalDataRemover",void 0),(0,i.Z)(this,"cashbackDAO",void 0),(0,i.Z)(this,"cartExtractionService",void 0),(0,i.Z)(this,"cashbackLogger",void 0),(0,i.Z)(this,"scraperService",void 0),(0,i.Z)(this,"sessionIds",void 0),(0,i.Z)(this,"anid",""),(0,i.Z)(this,"esf",""),this.apiResponse=e,this.sessionIds=t,this.anid=o||"",this.esf=r||""}getPersonalDataRemover(){return this.personalDataRemover||(this.personalDataRemover=new r.Z(this.getCashbackDao())),this.personalDataRemover}getCashbackLogger(){return this.cashbackLogger||(this.cashbackLogger=new _),this.cashbackLogger}getFragmentCollectionService(){return new class{constructor(e,t,o){(0,i.Z)(this,"cashbackDAO",void 0),(0,i.Z)(this,"cashbackLogger",void 0),(0,i.Z)(this,"personalDataRemover",void 0),(0,i.Z)(this,"DEFAULT_FRAGMENT_COLLECTION_TIMEOUT",2e3),(0,i.Z)(this,"currentUrlMasked",""),(0,i.Z)(this,"DISALLOWED_NAMES",new Set(["addr","city","cell","dob","email","data-gtm","mob","phone","secret","social","ssn","tel","zip","pass","payment","cvv","ccv"])),this.cashbackDAO=e,this.cashbackLogger=t,this.personalDataRemover=o,this.currentUrlMasked=this.getCurrentUrlValue(!0)}getBrokenAttributionCollectionRate(){const e=this.cashbackDAO.getRetailerSettings();if(!e)return 0;const t=this.cashbackDAO.getPageType();return e.GetCollectionRate(this.cashbackDAO.getLastCommittedURL(),t,!0)??0}isNewCollectionFlagEnabled(){return this.cashbackDAO.getFeatureFlagEnabledByDefault("edge.fragmentCollection")}async RunFragmentCollection(e=!1,t="",o){if(!this.isNewCollectionFlagEnabled())return void this.logDebuggMesageToConsole("New fragment collection is not enabled");if(!this.cashbackDAO.getLastCommittedURL()?.startsWith("https:"))return;if(!this.IsCollectionAllowed())return void this.logDebuggMesageToConsole("Collection is not allowed");const i=this.cashbackDAO.getHtmlCollectionRate()||"0",r=void 0!==o?o:parseFloat(i);if(!(0,v.P4)()&&Math.random()>r)return void this.logDebuggMesageToConsole("No collection. Generated number is above rate");const a=this.cashbackDAO.getPageType();if(!e&&!(0,v.Ak)(a))return void this.logDebuggMesageToConsole(`do not collect page of type ${a}`);const n=this.cashbackDAO.getRetailerSettings()?.GetFragmentCollectionTimeout(a)||this.DEFAULT_FRAGMENT_COLLECTION_TIMEOUT;await this.logHtmlFragment(r,a,i,t,n)}IsCollectionAllowed(){if(!this.cashbackDAO.isFragmentCollectionEnabled())return!1;const e=this.cashbackDAO.getAfdMarket();return!!e&&("en-us"!==e||this.isPrivacyBadgeShown())}isPrivacyBadgeShown(){return!!n.Q?.PrivacyBadgeViewCount&&parseInt(n.Q.PrivacyBadgeViewCount,10)>=2}async logHtmlFragment(e,t,o,i,r){this.logDebuggMesageToConsole("log html for pageType",t),await(0,u._R)(r);const a=this.cashbackDAO.getImpressionId(),n=this.getHtmlFragmentTelemetryMetadata(t,o);n.HtmlFragment=this.getHtmlFragment(),n.HtmlFragment?(n.HtmlFragment=btoa(encodeURIComponent(n.HtmlFragment)),this.cashbackLogger.LogColdPathTelemetryEvent(`Fragment collection form NewHtmlFragmentCollectionService;collectionRate:${e}. ${i}`,g.R.HtmlFragment,n,a)):this.logError(`HtmlFragmentTelemetry:::Failed to log fragment. ${i}`,t,"HtmlFragmentTelemetry error",{collectionRate:e,rateFromBackend:o})}logError(e,t,o="",i=void 0){const r=this.cashbackDAO.getSessionIds(),a={Metadata:i?JSON.stringify(i):"",Domain:this.cashbackDAO.getCurrentDomain(),AFDMarket:this.cashbackDAO.getAfdMarket(),IsSignedIn:this.cashbackDAO.isSignedIn(),PageVisitId:r?.pageVisitId??"",RetailerSessionId:r?.retailerSessionId??"",PersonalizationDataConsent:this.cashbackDAO.getSanConsentFlag(),ErrorMessage:o,Message:e,IsError:!0,PageUrl:this.currentUrlMasked,PageType:t??this.cashbackDAO.getPageType(),IsBrokenSelectorDetected:!1,IsPartialBrokenSelectorDetected:!1,BrokenSelectors:"",FullSelectorUsed:"",PartialSelectorUsed:"",Currency:"",ExtractionResult:"",CartData:"",PageRegexUsed:"",ExtractionId:""};this.logDebuggMesageToConsole(a.Message),this.cashbackLogger.LogInfoWithEvenType(e,g.R.SelectorDataExtraction,a,this.cashbackDAO.getImpressionId())}getHtmlFragmentTelemetryMetadata(e,t){const o=this.cashbackDAO.getCurrentDomain(),i=this.cashbackDAO.getSessionIds(),r=i?.retailerSessionId??"",a=i?.pageVisitId??"";return this.logDebuggMesageToConsole("retailerSessionId",r),this.logDebuggMesageToConsole("pageVisitId",a),{Domain:o,TimeToMask:"",PageType:e,PageUrl:this.currentUrlMasked,aOCFragmentCollectionRate:t,HtmlFragment:"",EncryptionKey:"",RetailerSessionId:r,PageVisitId:a}}getCurrentUrlValue(e){return this.personalDataRemover.getCurrentUrlValue(e,this.cashbackDAO.getLastCommittedURL())}getHtmlFragment(){const e=this.cloneNodeWithPlaceholders(document.documentElement,!1,performance.now());return e?.outerHTML??""}cloneNodeWithPlaceholders(e,t,o){if(performance.now()-o>12e4)return this.logError("Execution time exceeded 2 minutes. Aborting.",void 0,"HtmlFragmentTelemetry cloneNodeWithPlaceholders error"),null;if("SCRIPT"===e.tagName?.toLocaleUpperCase())return null;if(e.nodeType===Node.TEXT_NODE){const o=e.cloneNode(!1);return t&&(o.textContent="*****"),o}if(e.nodeType===Node.ELEMENT_NODE){if("hidden"===window.getComputedStyle(e).visibility)return null;const t=e.getAttribute("id");if(t&&t.startsWith("batBeacon"))return null;const i=e.cloneNode(!1);let r=!1;const a=e.getAttributeNames();for(const t of a){if(this.DISALLOWED_NAMES.has(t.toLowerCase())){r=!0;break}for(const o of this.DISALLOWED_NAMES)if(e.getAttribute(t)?.toLowerCase()?.includes(o)){r=!0;break}if(r)break}for(const t of e.childNodes){const e=this.cloneNodeWithPlaceholders(t,r,o);e&&i.appendChild(e)}return i}return null}logDebuggMesageToConsole(...e){}}(this.getCashbackDao(),this.getCashbackLogger(),this.getPersonalDataRemover())}getScrapperService(){return this.scraperService||(this.scraperService=new b),this.scraperService}getPurchaseExtractionService(){return this.cartExtractionService||(this.cartExtractionService=new I(this.getCashbackLogger(),this.getScrapperService(),this.getCashbackDao(),this.getPersonalDataRemover())),this.cartExtractionService}getCashbackDao(){return this.cashbackDAO||(this.cashbackDAO=new class{constructor(e,t,o,r){(0,i.Z)(this,"checkoutPages",void 0),(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"sessionIds",void 0),(0,i.Z)(this,"settings",void 0),(0,i.Z)(this,"anid",""),(0,i.Z)(this,"esf",""),this.apiResponse=e,this.checkoutPages=this.setCheckoutPages(),this.sessionIds=t,this.anid=o,this.esf=r,this.settings=new l.Z(e?.retailerData?.settings)}getDataMaskRules(){const e=this.apiResponse?.retailerData?.dataMaskRules,t=[];if(e&&e.length>0)for(const o of e)if(o?.ruleName&&o?.ruleValue&&o?.maskType){const e=new d.Z(o?.ruleName,o?.maskType,o?.ruleValue);t.push(e)}return t}getConfirmationPageRegex(){return this.apiResponse?.retailerData?.orderConfirmationPageUrl}getPlatform(){return this.apiResponse?.retailerData?.platform??""}getSanConsentFlag(){return(0,u.Nx)(this.apiResponse?.userInfo?.isPersonalizationDataConsentEnabled)}getCurrentDomain(){return this.apiResponse?.retailerData?.domainName??""}getESF(){return this.esf}isAadSignedIn(){return this.apiResponse?.userInfo?.isAADSignedIn??null}isSignedIn(){return Boolean(this.isAadSignedIn()||this.anid)}getSessionIds(){return this.sessionIds}getRetailerSettings(){return this.settings}getImpressionId(){return this.apiResponse?.impressionId??""}getPersonalizedCashback(){return this.apiResponse?.personalizedAdsResponse?.personalizedCashback}getPageType(){return(0,c.E)(this.getLastCommittedURL(),this.getCurrentDomain(),this.getRetailerData(),this.getConfirmationPageTelemetryData(),this.getAfdMarket())}getAutomatedSelectorsDataForPage(e){return(0,c.IL)(e,this.getAutomatedSelectorsData(),this.getLastCommittedURL())}isCartCachingEnabled(){return this.getConfirmationPageTelemetryData()?.isCartCachingEnabled??!0}getAfdMarket(){return this.apiResponse?.aFDMarket??""}getLastCommittedURL(){return window.location.toString()}getCheckoutPageInfo(){return(0,c.aB)(this.getCheckoutPages(),this.getLastCommittedURL())}getAnid(){return this.anid}getPageInfo(){const e=this.apiResponse?.retailerData?.allCheckoutPages;return(0,c.aB)(e,this.getLastCommittedURL())}getConfirmationPageTelemetryData(){return this.apiResponse?.retailerData?.confirmationPageTelemetry}isFragmentCollectionEnabled(){return(0,u.Nx)(this.apiResponse?.retailerData?.isAOCFragmentCollectionEnabled)}getHtmlCollectionRate(){return this.apiResponse?.retailerData?.aOCFragmentCollectionRate?`${this.apiResponse?.retailerData?.aOCFragmentCollectionRate}`:"0"}getFeatureFlagEnabledByDefault(e){return"feature_disabled"!==this.apiResponse?.retailerData?.edgeFeatureFlag?.[e]}saveToLocalCache(e,t){window.localStorage.setItem(e,t)}saveToLocalCachePersistent(e,t){a.Q.sendControllerStorageMessage(e,t)}readFromLocalCachePersistent(e){try{const t=n.Q?n.Q[e]:void 0;return(t?(0,s.BQ)(t):void 0)||void 0}catch(e){return}}readFromLocalCache(e){try{const t=window.localStorage.getItem(e);if(t)return JSON.parse(t)}catch(e){return}}getAutomatedSelectorsData(){return this.apiResponse?.retailerData?.allAutomatedSelectors??[]}getCheckoutPages(){return this.checkoutPages}getRetailerData(){return this.apiResponse?.retailerData}setCheckoutPages(){const e=this.apiResponse?.retailerData?.allCheckoutPages,t=[];if(e)for(const o of e)"CheckoutPage"!==o.pageType&&o.pageType||t.push(o);return t}}(this.apiResponse,this.sessionIds,this.anid,this.esf)),this.cashbackDAO}static initFactory(e,t,o,i){return this.instance||(this.instance=new k(e,t,o,i)),this.instance}static getFactory(){return this.instance||(this.instance=new k(void 0,void 0,"","")),this.instance}static resetFactory(e,t,o,i){this.instance=new k(e,t,o,i),this.instance.resetFactoriesToNull()}resetFactoriesToNull(){this.personalDataRemover=void 0,this.cashbackDAO=void 0,this.cartExtractionService=void 0,this.cashbackLogger=void 0,this.scraperService=void 0}}(0,i.Z)(k,"instance",void 0);var U=k},60269:function(e,t,o){var i=o(72370);t.Z=class{constructor(){(0,i.Z)(this,"retailerData",void 0),(0,i.Z)(this,"impressionId",void 0),(0,i.Z)(this,"coupons",void 0),(0,i.Z)(this,"suppressedCoupons",void 0),(0,i.Z)(this,"market",void 0),(0,i.Z)(this,"userPersonalizationInfo",void 0),(0,i.Z)(this,"cashback",void 0),(0,i.Z)(this,"isCashbackEstimationSupportedForDomain",void 0),(0,i.Z)(this,"userInfo",void 0)}}},29853:function(e,t,o){o.d(t,{Z:function(){return A}});var i=o(72370),r=o(69886),a=o(99182),n=o(6747);class s{constructor(){(0,i.Z)(this,"cartSelector",void 0),(0,i.Z)(this,"collapsedCartProductImageSelector",void 0),(0,i.Z)(this,"productSelector",void 0),(0,i.Z)(this,"productTitleSelector",void 0),(0,i.Z)(this,"productPriceSelector",void 0),(0,i.Z)(this,"productImageSelector",void 0),(0,i.Z)(this,"productUrlSelector",void 0),(0,i.Z)(this,"productQuantitySelector",void 0),(0,i.Z)(this,"productSellerSelector",void 0),(0,i.Z)(this,"productSellerRegex",void 0),(0,i.Z)(this,"productIdSkuSelector",void 0),(0,i.Z)(this,"productIdSkuRegex",void 0),(0,i.Z)(this,"productIdSkuAttribute",void 0),(0,i.Z)(this,"productPriceRegex",void 0),(0,i.Z)(this,"emptyCartText",void 0)}static Create(e){const t=new s;return t.cartSelector=e.cartSelector,t.collapsedCartProductImageSelector=e.collapsedCartProductImageSelector,t.productSelector=e.productSelector,t.productTitleSelector=e.productTitleSelector,t.productPriceSelector=e.productPriceSelector,t.productImageSelector=e.productImageSelector,t.productUrlSelector=e.productUrlSelector,t.productQuantitySelector=e.productQuantitySelector,t.productSellerSelector=e.productSellerSelector,t.productSellerRegex=e.productSellerRegex,t.productIdSkuSelector=e.productIdSkuSelector,t.productIdSkuRegex=e.productIdSkuRegex,t.productIdSkuAttribute=e.productIdSkuAttribute,t.productPriceRegex=e.productPriceRegex,t.emptyCartText=e.emptyCartText,t}}var c=s;class l{constructor(){(0,i.Z)(this,"productTitleSelector",void 0),(0,i.Z)(this,"productSellerSelector",void 0),(0,i.Z)(this,"productBrandSelector",void 0),(0,i.Z)(this,"productImageSelector",void 0),(0,i.Z)(this,"productOutOfStockSelector",void 0),(0,i.Z)(this,"productPriceSelector",void 0),(0,i.Z)(this,"productASIN",void 0),(0,i.Z)(this,"productUPCSelector",void 0),(0,i.Z)(this,"aggregateRatingSelector",void 0),(0,i.Z)(this,"aggregateRatingNumberOfRatingsSelector",void 0),(0,i.Z)(this,"reviewSelector",void 0),(0,i.Z)(this,"reviewRatingSelector",void 0),(0,i.Z)(this,"reviewDateSelector",void 0),(0,i.Z)(this,"reviewerNameSelector",void 0)}static Create(e){const t=new l;return t.productTitleSelector=e.productTitleSelector,t.productSellerSelector=e.productSellerSelector,t.aggregateRatingSelector=e.aggregateRatingSelector,t.aggregateRatingNumberOfRatingsSelector=e.aggregateRatingNumberOfRatingsSelector,t.reviewSelector=e.reviewSelector,t.reviewRatingSelector=e.reviewRatingSelector,t.reviewDateSelector=e.reviewDateSelector,t.reviewerNameSelector=e.reviewerNameSelector,t.productImageSelector=e.productImageSelector,t.productPriceSelector=e.productPriceSelector,t.productOutOfStockSelector=e.productOutOfStockSelector,t.productBrandSelector=e.productBrandSelector,t.productASIN=e.productASIN,t.productUPCSelector=e.productUPCSelector,t}}var u=l;class d{constructor(){(0,i.Z)(this,"otherSellersOverlayLinkSelector",void 0),(0,i.Z)(this,"otherSellerOfferElementSelector",void 0),(0,i.Z)(this,"otherSellerHeadingSelector",void 0),(0,i.Z)(this,"otherSellerPriceSelector",void 0),(0,i.Z)(this,"otherSellerNameSelector",void 0),(0,i.Z)(this,"productImageSelector",void 0),(0,i.Z)(this,"otherSellerRatingSelector",void 0),(0,i.Z)(this,"otherSellerDeliverySelector",void 0),(0,i.Z)(this,"otherSellerAddButtonSelector",void 0),(0,i.Z)(this,"otherSellerAddedConfirmationSelector",void 0),(0,i.Z)(this,"otherSellerLowestPriceSelector",void 0),(0,i.Z)(this,"jSVersionThreshold",void 0)}static Create(e){const t=new d;return t.otherSellersOverlayLinkSelector=e.otherSellersOverlayLinkSelector,t.otherSellerOfferElementSelector=e.otherSellerOfferElementSelector,t.otherSellerHeadingSelector=e.otherSellerHeadingSelector,t.otherSellerPriceSelector=e.otherSellerPriceSelector,t.otherSellerNameSelector=e.otherSellerNameSelector,t.productImageSelector=e.productImageSelector,t.otherSellerRatingSelector=e.otherSellerRatingSelector,t.otherSellerDeliverySelector=e.otherSellerDeliverySelector,t.otherSellerAddButtonSelector=e.otherSellerAddButtonSelector,t.otherSellerAddedConfirmationSelector=e.otherSellerAddedConfirmationSelector,t.otherSellerLowestPriceSelector=e.otherSellerLowestPriceSelector,t.jSVersionThreshold=e.jSVersionThreshold,t}}var h=d;class p{constructor(){(0,i.Z)(this,"checkoutPageUrl",void 0),(0,i.Z)(this,"priceSelector",void 0),(0,i.Z)(this,"startDateSelector",void 0),(0,i.Z)(this,"endDateSelector",void 0),(0,i.Z)(this,"domainType",void 0),(0,i.Z)(this,"nameSelector",void 0),(0,i.Z)(this,"isRoundTripSelector",void 0)}static Create(e){const t=new p;return t.checkoutPageUrl=e.checkoutPageUrl,t.priceSelector=e.priceSelector,t.startDateSelector=e.startDateSelector,t.endDateSelector=e.endDateSelector,t.nameSelector=e.nameSelector,t.domainType=e.domainType,t.isRoundTripSelector=e.isRoundTripSelector,t}}var g=p;class C{constructor(){(0,i.Z)(this,"pageUrlMatchRegex",void 0),(0,i.Z)(this,"flightPriceSelector",void 0),(0,i.Z)(this,"returnFlightPriceSelector",void 0),(0,i.Z)(this,"startDateSelector",void 0),(0,i.Z)(this,"endDateSelector",void 0),(0,i.Z)(this,"domainType",void 0),(0,i.Z)(this,"sourceLocationSelector",void 0),(0,i.Z)(this,"destinationLocationSelector",void 0),(0,i.Z)(this,"isRoundTripSelector",void 0)}static Create(e){const t=new C;return t.pageUrlMatchRegex=e.pageUrlMatchRegex,t.flightPriceSelector=e.flightPriceSelector,t.returnFlightPriceSelector=e.returnFlightPriceSelector,t.startDateSelector=e.startDateSelector,t.endDateSelector=e.endDateSelector,t.domainType=e.domainType,t.sourceLocationSelector=e.sourceLocationSelector,t.destinationLocationSelector=e.destinationLocationSelector,t.isRoundTripSelector=e.isRoundTripSelector,t}}var S=C;class m{constructor(){(0,i.Z)(this,"inputBoxSelector",void 0),(0,i.Z)(this,"applyButtonSelector",void 0),(0,i.Z)(this,"removeCouponButtonSelector",void 0),(0,i.Z)(this,"orderTotalDataElementSelector",void 0),(0,i.Z)(this,"orderTotalDataContainerElementSelector",void 0),(0,i.Z)(this,"orderSubTotalElementSelector",void 0),(0,i.Z)(this,"disabled",void 0),(0,i.Z)(this,"checkoutPageUrl",void 0),(0,i.Z)(this,"layoutClickSelector",void 0),(0,i.Z)(this,"clickBeforeStartSelector",void 0),(0,i.Z)(this,"finalCheckoutButtonSelector",void 0),(0,i.Z)(this,"edgeEnabled",void 0),(0,i.Z)(this,"couponAcceptedMessageElementSelector",void 0),(0,i.Z)(this,"closeModal",void 0),(0,i.Z)(this,"appliedCouponSelector",void 0),(0,i.Z)(this,"errorMessageSelector",void 0),(0,i.Z)(this,"couponSuccessMessageSelectors",void 0),(0,i.Z)(this,"couponFailureMessageSelectors",void 0),(0,i.Z)(this,"enabledTips",void 0),(0,i.Z)(this,"otherSellerSelectors",void 0),(0,i.Z)(this,"clippingSelectors",void 0),(0,i.Z)(this,"cartSelectors",void 0),(0,i.Z)(this,"catalogSelectors",void 0),(0,i.Z)(this,"clickForCartSelector",void 0),(0,i.Z)(this,"socialSelectors",void 0),(0,i.Z)(this,"pinterestSelectors",void 0),(0,i.Z)(this,"automatedCartExtractionEnabled",void 0),(0,i.Z)(this,"shipmentSelector",void 0),(0,i.Z)(this,"preTaxSelector",void 0),(0,i.Z)(this,"estimatedTaxSelector",void 0),(0,i.Z)(this,"waitAfterApplyingCurrentCoupon",void 0),(0,i.Z)(this,"manualCouponApplyTrackingEnabled",void 0),(0,i.Z)(this,"autosDataSelector",void 0),(0,i.Z)(this,"suggestedCouponElementSelector",void 0),(0,i.Z)(this,"suggestedCouponRegex",void 0),(0,i.Z)(this,"suggestedCouponsOnlyPage",void 0),(0,i.Z)(this,"supportedNoOrderTotal",void 0),(0,i.Z)(this,"domMutationEnabled",void 0),(0,i.Z)(this,"pageType",void 0),(0,i.Z)(this,"automaticCouponSavingsSelector",void 0),(0,i.Z)(this,"travelCheckoutSelectors",void 0),(0,i.Z)(this,"isAutoShowDisabled",void 0),(0,i.Z)(this,"productAddToCartSelector",void 0),(0,i.Z)(this,"buyNowSelector",void 0),(0,i.Z)(this,"pageUrlRegex",void 0),(0,i.Z)(this,"pageTypeSelector",void 0),(0,i.Z)(this,"addToCartOverlaySelector",void 0),(0,i.Z)(this,"getProductNamesFromImg",void 0),(0,i.Z)(this,"productTitleSearchSelector",void 0),(0,i.Z)(this,"travelSearchSelectors",void 0),(0,i.Z)(this,"isHomePageSameAsCheckout",void 0),(0,i.Z)(this,"priceDivideByQuantity",void 0)}static Create(e){const t=new m;return t.inputBoxSelector=e.inputBoxSelector,t.removeCouponButtonSelector=e.removeCouponButtonSelector,t.orderTotalDataElementSelector=e.orderTotalDataElementSelector,t.orderTotalDataContainerElementSelector=e.orderTotalDataContainerElementSelector,t.checkoutPageUrl=e.checkoutPageUrl,t.clickBeforeStartSelector=e.clickBeforeStartSelector,t.clickForCartSelector=e.clickForCartSelector,t.layoutClickSelector=e.layoutClickSelector,t.finalCheckoutButtonSelector=e.finalCheckoutButtonSelector,t.disabled=e.disabled,t.edgeEnabled=e.edgeEnabled,t.orderSubTotalElementSelector=e.orderSubTotalElementSelector,t.couponAcceptedMessageElementSelector=e.couponAcceptedMessageElementSelector,t.closeModal=e.closeModal,t.appliedCouponSelector=e.appliedCouponSelector,t.errorMessageSelector=e.errorMessageSelector,t.couponSuccessMessageSelectors=e.couponSuccessMessageSelectors,t.couponFailureMessageSelectors=e.couponFailureMessageSelectors,t.enabledTips=e.enabledTips,t.automatedCartExtractionEnabled=e.automatedCartExtractionEnabled,t.shipmentSelector=e.shipmentSelector,t.preTaxSelector=e.preTaxSelector,t.priceDivideByQuantity=e.priceDivideByQuantity,t.estimatedTaxSelector=e.estimatedTaxSelector,t.applyButtonSelector=e.applyButtonSelector,t.waitAfterApplyingCurrentCoupon=e.waitAfterApplyingCurrentCoupon,t.manualCouponApplyTrackingEnabled=e.manualCouponApplyTrackingEnabled,t.autosDataSelector=e.autosDataSelector,t.suggestedCouponElementSelector=e.suggestedCouponElementSelector,t.suggestedCouponRegex=e.suggestedCouponRegex,t.suggestedCouponsOnlyPage=e.suggestedCouponsOnlyPage,t.supportedNoOrderTotal=e.supportedNoOrderTotal,t.domMutationEnabled=e.domMutationEnabled,t.pageType=e.pageType,t.automaticCouponSavingsSelector=e.automaticCouponSavingsSelector,t.isAutoShowDisabled=e.isAutoShowDisabled,t.productAddToCartSelector=e.productAddToCartSelector,t.buyNowSelector=e.buyNowSelector,t.pageTypeSelector=e.pageTypeSelector,t.pageUrlRegex=e.pageUrlRegex,t.addToCartOverlaySelector=e.addToCartOverlaySelector,t.productTitleSearchSelector=e.productTitleSearchSelector,t.getProductNamesFromImg=e.getProductNamesFromImg,t.isHomePageSameAsCheckout=e.isHomePageSameAsCheckout,e.otherSellerSelectors&&(t.otherSellerSelectors=h.Create(e.otherSellerSelectors)),e.clippingSelectors&&(t.clippingSelectors=r.Z.Create(e.clippingSelectors)),e.cartSelectors&&(t.cartSelectors=c.Create(e.cartSelectors)),e.catalogSelectors&&(t.catalogSelectors=u.Create(e.catalogSelectors)),e.socialSelectors&&(t.socialSelectors=n.Z.Create(e.socialSelectors)),e.pinterestSelectors&&(t.pinterestSelectors=a.Z.Create(e.pinterestSelectors)),e.travelCheckoutSelectors&&(t.travelCheckoutSelectors=g.Create(e.travelCheckoutSelectors)),e.travelSearchSelectors&&(t.travelSearchSelectors=S.Create(e.travelSearchSelectors)),t}}var A=m},77594:function(e,t,o){o.d(t,{p:function(){return d}});var i=o(72370),r=o(31656),a=o(21597),n=o(89366),s=o(86743),c=o(3274),l=o(52056);class u extends n.Z{constructor(...e){super(...e),(0,i.Z)(this,"initializeStartTime",performance.now()),(0,i.Z)(this,"scriptRunNum",0),(0,i.Z)(this,"apiResponseParam",[])}initializeRuntime(e){0!==this.scriptRunNum&&(this.initializeStartTime=performance.now()),this.apiResponseParam=e}handleMessages(e,t){let o,i;this.apiResponseParam&&(this.apiResponseParam.length>a.$R.enabled_features&&(o=this.apiResponseParam[a.$R.enabled_features]),i=this.GetEnabledServiceFeatures()),r.R.Create(o,i);const n=(0,s.XB)();l.Z.SetFullAOCActive(n),n&&"OnGenericDealsServiceResponse"!==t&&"WebAssistQueryResults"!==t||(this.scriptRunNum=(0,c.U)(e,t,this.scriptRunNum,this.initializeStartTime))}getNativeHandler(){return checkoutPageValidatorNativeHandler}GetEnabledServiceFeatures(){let e;return this.apiResponseParam.length>a.$R.enabled_service_features&&this.apiResponseParam[a.$R.enabled_service_features].length>0?e=this.apiResponseParam[a.$R.enabled_service_features]:this.apiResponseParam.length>a.$R.checkout_enabled_service_features_v2&&this.apiResponseParam[a.$R.checkout_enabled_service_features_v2].length>0&&(e=this.apiResponseParam[a.$R.checkout_enabled_service_features_v2]),e}}const d=new u},46261:function(e,t,o){o.d(t,{GA:function(){return n},LE:function(){return a},Wi:function(){return r}});var i=o(72370);const r="CheckoutStatus",a=18e4;class n{constructor(){(0,i.Z)(this,"CheckoutTime",void 0),(0,i.Z)(this,"CheckoutButtonClicked",void 0),(0,i.Z)(this,"CartId",void 0),(0,i.Z)(this,"CartValue",void 0)}}},1094:function(e,t,o){o.d(t,{Z:function(){return I}});var i=o(66933),r=o(21488),a=o(29247),n=o(36493),s=o(91495),c=o(44092),l=o(27689),u=o(9448),d=o(90066),h=o(82315),p=o(72370),g=o(5144),C=o(56372),S=o(52056);class m extends C.Z{constructor(...e){super(...e),(0,p.Z)(this,"traceId",void 0)}init(e,t,o,i){this.initCommonInfo(e,t,o,g.G7.Validator),this.traceId=i,this.sendErrorMessage=this.sendValidatorErrorMessage.bind(this),this.sendStorageMessage=S.Z.SendStorageMessage.bind(this),this.initialize()}initialize(){this.autoOpenDataStr=s.Q?.AutoOpenData,this.lastCleanedDataStr=s.Q?.LastCleanedData,this.initializeData()}sendValidatorErrorMessage(e,t){try{const o="error";S.Z.SendLogEvent(e,t,o,void 0,void 0,void 0),S.Z.SendMessage(u.H.CheckoutPageValidationError,[o,this.traceId])}catch(e){}}}var A=m,P=o(60269),f=o(44922),E=o(46557),T=o(11849);class O{static CreateCheckoutPageData(e){if(e){const t=new P.Z;if(e.retailerData&&(t.retailerData=E.Z.Create(e.retailerData)),e.impressionId&&(t.impressionId=e.impressionId),e.coupons){t.coupons=[];for(const o of e.coupons)t.coupons.push(o)}if(e.suppressedCoupons){t.suppressedCoupons=[];for(const o of e.suppressedCoupons)t.suppressedCoupons.push(o)}return e.userPersonalizationInfo&&(t.userPersonalizationInfo=e.userPersonalizationInfo),e.market&&(t.market=e.market),e.cashback&&(t.cashback=i.Z.Create(e.cashback)),e.userInfo&&(t.userInfo=r.Z.Create(e)),t.isCashbackEstimationSupportedForDomain=e.isCashbackEstimationSupportedForDomain,t}return new P.Z}static GetInitialFields(e){const t=[],o=e.retailerData.getCurrentCheckoutPage();return o&&[o.inputBoxSelector,o.removeCouponButtonSelector,o.clickBeforeStartSelector,o.layoutClickSelector].forEach((e=>{a.ZP.IsValidDataField(e)&&t.push(e)})),t}static GetAndSendOrderTotal(e,t,o){let i=!1,r=!1;o!==f.S.NoCheckoutPageUrl&&o!==f.S.DisabledCheckoutPageData||(i=!0),o!==f.S.NoSelectors&&o!==f.S.PageIsInvalid&&o!==f.S.IsPageValidError||(r=!0);const a=this.getDefaultOrderTotalErrorMessage(o),n=h.Z.getApiResponse(),s=n.retailerData?.domainName;try{const o=n.retailerData.getCurrentCheckoutPage();this.GetOrderTotal(o,e,n.impressionId,s).then((e=>{this.SendValidationLog(t,n.impressionId,n.traceId,i,r,s,e.OrderTotal,e.Currency),e.OrderTotal>0&&((0,c.i8)("orderTotal",e.OrderTotal.toString()),(0,c.i8)("pageCurrency",e.PageCurrency.toString()))}))}catch(e){S.Z.SendLogEvent(n.impressionId,e?.message??a,"error")}}static GetCurrentPathName(){return location.pathname}static async isCheckoutPageBySelectors(e,t){const o=e.retailerData.getCurrentCheckoutPage(),i=location.pathname;if(!o||o.checkoutPageUrl!==i)return!1;const r=O.GetInitialFields(e);return 0!==r.length&&await(0,a.w)((()=>t.IsPageValid(r)),5e3).then((async e=>e)).catch((o=>(t.sendErrorMessage(e.impressionId,o?.message??"checkoutpage selectors check error."),!1)))}static SendValidationLog(e,t,o,i,r,a,n,s){const c=S.Z.GetValidationLogMessage(e,i,r);e?n&&-1!==n&&S.Z.SendLogEvent(t,c,"true",n,s,void 0,void 0,a):S.Z.SendLogEvent(t,c,"false",n,s,void 0,void 0,a),n&&-1!==n&&this.SendGMVMessage(n,s??"$",o)}static SendGMVMessage(e,t,o){const i=(0,n.qm)(t)?t:(0,n.Vv)(t)??"USD";S.Z.SendMessage(u.H.CheckoutPageGMV,[o,e.toString(),i])}static async GetOrderTotal(e,t,o,i){let r={OrderTotal:-1,Currency:(0,n.N6)(t)??"$",PageCurrency:""};e&&a.ZP.IsValidDataField(e.orderTotalDataElementSelector)&&(r=await a.ZP.WaitForCondition((async()=>d.Z.HasVisibleElement(e.orderTotalDataElementSelector)),5e3).then((()=>T.Z.GetCartValue(e.orderTotalDataElementSelector,t))).catch((e=>(S.Z.SendLogEvent(o,e?.message??"checkoutpage GMV error.","error"),r))));try{const e=s.Q?.CartValues,t=(0,l.BQ)(e,!0)??{},o=new Date;t[i]={cartValue:r,timestamp:o};const a=JSON.stringify({value:JSON.stringify(t)});S.Z.SendStorageMessage("CartValues",a)}catch(e){}return r}static GetValidatorAutoOpenController(){const e=h.Z.getApiResponse(),t=location.pathname,o=new A;return o.init(e.impressionId,e?.retailerData?.domainName,t,e.traceId),o}static getDefaultOrderTotalErrorMessage(e){switch(e){case f.S.DisabledCheckoutPageData:return"disabled checkoutpage GMV error.";case f.S.NoSelectors:return"no valid initial fields to check";case f.S.NoCoupons:return"no coupons";case f.S.AllCouponsBlocked:return"all coupons were blocked";case f.S.NoCheckoutPageUrl:return"no checkoutpage data GMV error."}return"checkoutpage GMV error."}}var I=O},50607:function(e,t,o){o.d(t,{$d:function(){return d},LT:function(){return g},WL:function(){return u},cA:function(){return p},iQ:function(){return C},jV:function(){return S},mg:function(){return h}});var i=o(59645),r=o(5144),a=o(11050),n=o(91495),s=o(75434),c=o(41310),l=o(52056);const u=e=>!!e&&!!e.shouldAutoShow&&e.offersType===a.h.SPB&&!!(e.offer||e.relatedOffers&&0!==e.relatedOffers.length),d=(e,t,o)=>{if(e&&e.relatedOffers){const i=m(t),r=new Set([...o,...i]),a=e.relatedOffers.filter((e=>{if(e.cashbackProducts&&e.cashbackProducts.length>0){const t=e.cashbackProducts[0];if(e.value&&t.price&&t.image&&!r.has(e.id))return!0}return!1}));if(a.length>0)return a[0]}return null},h=(e,t,o,i,r)=>{if(!0===r)return!1;if(!e)return!1;if(!e.shouldAutoShow)return!1;if(e.offersType!==a.h.Quotient)return!1;if(!(e.offer||e.relatedOffers&&0!==e.relatedOffers.length))return!1;if(n.Q.ICIsPendingTransactionPresent)return!1;const s=new Set([...i,...m(t)]),c=new Set(o);let l=!1;return e.offer?.id&&(l=!s.has(e.offer.id)&&!c.has(e.offer.id)&&0!==e.offer.cashbackProducts.length),!!l},p=(e,t,o,a=!1)=>{const n=new i.Z(r.xu.ICSpbOffersNoShowHomePage);n.Metadata=JSON.stringify({userInfo:e,isError:a,pageTitle:document?.title,reason:o}),l.Z.SendLogEvent(t,"SPB notification not shown on home page","",void 0,void 0,r.R.EdgeFlyoutStatus,n)},g=(e,t,o,n,s=!1)=>{const c=e?.offersType===a.h.SPB,u=new i.Z(c?r.xu.ICSPBPdpOffersNoShow:r.xu.ICQtPdpOffersNoShow),d=`${e?.offersType} offer not shown`;u.Metadata=JSON.stringify({userInfo:t,responseData:e,isExactMatch:!!e?.offer,relatedOffersLength:e?.relatedOffers?.length||0,isPdpSpb:c,isPdpQt:e?.offersType===a.h.Quotient,isError:s,pageTitle:document?.title}),l.Z.SendLogEvent(o,d,"",void 0,void 0,r.R.EdgeFlyoutStatus,u)},C=(e,t,o)=>{const i={isExactMatch:!!e.offer,relatedOffersLength:e.relatedOffers?.length||0,isPdpSpb:!0,pageTitle:document?.title};c.Z.LogSPBTelemetry(r.xu.ICQtPdpOffersShow,"Qt pdp shown",e,t,o,i)},S=(e,t,o)=>{const i={isExactMatch:!!e.offer,relatedOffersLength:e.relatedOffers?.length||0,isPdpSpb:!0,pageTitle:document?.title};c.Z.LogSPBTelemetry(r.xu.ICSPBPdpOffersShow,"Spb pdp shown",e,t,o,i)},m=e=>{try{const t=n.Q?.GroceryCashbackActivated,o=((0,s.rm)(t)??{})[e]??void 0;return o?.fullItems?Object.keys(o.fullItems):[]}catch(e){return[]}}},44922:function(e,t,o){o.d(t,{S:function(){return r}});var i=o(72370);let r=function(e){return e.ClippingGrocery="ClippingGrocery",e.GroceryNoClipping="GroceryNoClipping",e.Clipping="Clipping",e.SaveSocialCoupons="SaveSocialCoupons",e.GroceryCashback="GroceryCashback",e.Grocery="Grocery",e.OtherSellers="OtherSellers",e.NoRetailerData="NoRetailerData",e.FailUpdateCheckoutPage="FailUpdateCheckoutPage",e.NoCheckoutPageUrl="NoCheckoutPageUrl",e.NoPDPPage="NoPDPPage",e.NotGiftCard="NotGiftCard",e.NotGroceries="NotGroceries",e.PageIsValid="PageIsValid",e.PageIsInvalid="PageIsInvalid",e.IsPageValidError="IsPageValidError",e.NoPinterestDeals="NoPinterestDeals",e.PinterestDeals="PinterestDeals",e.NoSocialCoupons="NoSocialCoupons",e.NoSelectors="NoSelectors",e.FallbackValidation="FallbackValidation",e.FallbackError="FallbackError",e.NoCoupons="NoCoupons",e.AllCouponsBlocked="AllCouponsBlocked",e.PageBecameValid="PageBecameValid",e.CheckingOtherSellers="CheckingOtherSellers",e.AutosMarketplace="AutosMarketplace",e.TrendingDealsChina="TrendingDealsChina",e.SuggestedCouponsOnlyPage="SuggestedCouponsOnlyPage",e.AbandonedCart="AbandonedCart",e.ProductTracking="ProductTracking",e.AutoOpenControllerActive="AutoOpenControllerActive",e.DisabledCheckoutPageData="DisabledCheckoutPageData",e.AAConsent="AAConsent",e.EndofScript_ProductPage="EndofScript_ProductPage",e.EndofScript_CheckoutPage="EndofScript_CheckoutPage",e.EndofScript_HomePage="EndofScript_HomePage",e.EndofScript_SearchPage="EndofScript_SearchPage",e.SponsoredPromotions="SponsoredPromotions",e.EnablePersonalization="EnablePersonalization",e.InvalidCartTotal="InvalidCartTotal",e}({});t.Z=class{constructor(){(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"validationReason",void 0),(0,i.Z)(this,"time",void 0),(0,i.Z)(this,"initializeTime",void 0),(0,i.Z)(this,"preValidationTime",void 0),(0,i.Z)(this,"path",void 0),(0,i.Z)(this,"pageStatus",void 0),(0,i.Z)(this,"scriptRunNum",void 0),(0,i.Z)(this,"validationMsgNum",void 0)}}},34802:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"pageType",void 0),(0,i.Z)(this,"pageUrl",void 0),(0,i.Z)(this,"orderId",void 0),(0,i.Z)(this,"orderIdFromUrl",void 0),(0,i.Z)(this,"orderTotal",void 0),(0,i.Z)(this,"orderSubtotal",void 0),(0,i.Z)(this,"productName",void 0),(0,i.Z)(this,"productItemPrice",void 0),(0,i.Z)(this,"productTotalPrice",void 0),(0,i.Z)(this,"productQuantity",void 0),(0,i.Z)(this,"productId",void 0),(0,i.Z)(this,"currency",void 0),(0,i.Z)(this,"productPrice",void 0),(0,i.Z)(this,"productNameFromImg",void 0),(0,i.Z)(this,"randomId",void 0),(0,i.Z)(this,"pageUrlFields",void 0)}static Create(e){const t=new r;return t.domain=e.domain,t.pageType=e.pageType,t.pageUrl=e.pageUrl,t.currency=e.currency,t.orderId=e.orderId,t.orderIdFromUrl=e.orderIdFromUrl,t.orderSubtotal=e.orderSubtotal,t.orderTotal=e.orderTotal,t.productName=e.productName,t.productItemPrice=e.productItemPrice,t.productTotalPrice=e.productTotalPrice,t.productQuantity=e.productQuantity,t.productId=e.productId,t.productPrice=e.productPrice,t.productNameFromImg=e.productNameFromImg,t.randomId=e.randomId,t}}t.Z=r},50978:function(e,t,o){o.d(t,{JR:function(){return a},Vj:function(){return r}});var i=o(72370);const r="PersonalizedPromotionsRawData";class a{constructor(){(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"PageType",void 0),(0,i.Z)(this,"PageUrl",void 0),(0,i.Z)(this,"OrderId",void 0),(0,i.Z)(this,"OrderIdFromUrl",void 0),(0,i.Z)(this,"OrderTotal",void 0),(0,i.Z)(this,"OrderSubtotal",void 0),(0,i.Z)(this,"ProductName",void 0),(0,i.Z)(this,"ProductItemPrice",void 0),(0,i.Z)(this,"ProductTotalPrice",void 0),(0,i.Z)(this,"ProductPrice",void 0),(0,i.Z)(this,"ProductNameFromImg",void 0),(0,i.Z)(this,"RandomId",void 0),(0,i.Z)(this,"ProductQuantity",void 0),(0,i.Z)(this,"ProductId",void 0),(0,i.Z)(this,"Currency",void 0),(0,i.Z)(this,"ExtractionId",void 0),(0,i.Z)(this,"CartDataCreationTime",void 0)}}},14440:function(e,t,o){var i=o(72370);class r{static Create(e){const t=new r;return t.productTitle=e.productTitle??"",t.productPrice=e.productPrice??0,t.productUrl=e.productUrl??"",t.productImg=e.productImg??"",t.productQuantity=e.productQuantity??0,t.productSeller=e.productSeller??"",t.buyNowItem=e.buyNowItem,t.productBrand=e.productBrand??"",t}constructor(){(0,i.Z)(this,"productTitle",void 0),(0,i.Z)(this,"productPrice",void 0),(0,i.Z)(this,"productUrl",void 0),(0,i.Z)(this,"productImg",void 0),(0,i.Z)(this,"productQuantity",void 0),(0,i.Z)(this,"productSeller",void 0),(0,i.Z)(this,"foundInWebAssist",void 0),(0,i.Z)(this,"webAssistTitle",void 0),(0,i.Z)(this,"webAssistPrice",void 0),(0,i.Z)(this,"webAssistImg",void 0),(0,i.Z)(this,"buyNowItem",void 0),(0,i.Z)(this,"productBrand",void 0),this.foundInWebAssist=!1}}t.Z=r},90650:function(e,t,o){o.d(t,{lD:function(){return i},si:function(){return r}});const i=["confirmation number","confirmation email","thank you for your order","order placed","order was placed","track your order"],r=["cvv"];t.ZP=class{static PageIncludesPaymentKeyWords(e,t){if(e)for(const o of t)if(e.includes(o))return!0;return!1}}},87869:function(e,t,o){o.d(t,{L:function(){return a},c:function(){return r}});var i=o(72370);let r=function(e){return e.finalCheckoutButtonVisible="finalCheckoutButtonVisible",e.successfulPaymentKeywordsFound="successfulPaymentKeywordsFound",e.failurePaymentKeywordsFound="failurePaymentKeywordsFound",e.inputFieldsFound="inputFieldsFound",e}({});class a{constructor(){(0,i.Z)(this,"purchaseFailed",void 0),(0,i.Z)(this,"indicators",void 0)}}},46557:function(e,t,o){o.d(t,{Z:function(){return C}});var i=o(72370);class r{constructor(){(0,i.Z)(this,"hasLink",void 0),(0,i.Z)(this,"couponCodeElement",void 0),(0,i.Z)(this,"couponCodeHash",void 0),(0,i.Z)(this,"retailerElement",void 0),(0,i.Z)(this,"retailerHash",void 0),(0,i.Z)(this,"channelId",void 0),(0,i.Z)(this,"username",void 0)}static Create(e){const t=new r;return t.hasLink=e.hasLink,t.couponCodeElement=e.couponCodeElement,t.couponCodeHash=e.couponCodeHash,t.retailerElement=e.retailerElement,t.retailerHash=e.retailerHash,t.channelId=e.channelId,t.username=e.username,t}}var a=r,n=o(29247),s=o(56577),c=o(29853);class l{constructor(){(0,i.Z)(this,"productPageUrl",void 0),(0,i.Z)(this,"addToCartButtonSelector",void 0),(0,i.Z)(this,"backgroundAAEnabled",void 0),(0,i.Z)(this,"productAddedConfirmationSelector",void 0),(0,i.Z)(this,"addToCartButtonContainer",void 0),(0,i.Z)(this,"suggestedCouponElementSelector",void 0),(0,i.Z)(this,"suggestedCouponRegex",void 0)}static Create(e){const t=new l;return t.productPageUrl=e.productPageUrl,t.addToCartButtonSelector=e.addToCartButtonSelector,t.backgroundAAEnabled=e.backgroundAAEnabled,t.productAddedConfirmationSelector=e.productAddedConfirmationSelector,t.addToCartButtonContainer=e.addToCartButtonContainer,t.suggestedCouponElementSelector=e.suggestedCouponElementSelector,t.suggestedCouponRegex=e.suggestedCouponRegex,t}}var u=l,d=o(5144),h=o(4872),p=o(31656);class g{constructor(){(0,i.Z)(this,"platform",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"orderConfirmationPageUrl",void 0),(0,i.Z)(this,"searchQueryUrlRegex",void 0),(0,i.Z)(this,"allCheckoutPages",void 0),(0,i.Z)(this,"isTravelDomain",void 0),(0,i.Z)(this,"allFinalCheckoutPages",void 0),(0,i.Z)(this,"checkoutPageKey",void 0),(0,i.Z)(this,"finalCheckoutPageKey",void 0),(0,i.Z)(this,"productPageKey",void 0),(0,i.Z)(this,"exclusiveMarket",void 0),(0,i.Z)(this,"multiMsgValidationEnabled",void 0),(0,i.Z)(this,"youtubeTemplates",void 0),(0,i.Z)(this,"allProductPages",void 0),(0,i.Z)(this,"exactCheckoutPageUrl",void 0),(0,i.Z)(this,"productOutOfStockSelector",void 0),(0,i.Z)(this,"productNameSelector",void 0),(0,i.Z)(this,"productPriceSelector",void 0),(0,i.Z)(this,"productPageUrl",void 0),(0,i.Z)(this,"productImageSelector",void 0),(0,i.Z)(this,"aaConsentEnabled",void 0),(0,i.Z)(this,"isStorewideCashbackEstimationEnabled",void 0),(0,i.Z)(this,"storeCartInEdgeStorage",void 0),(0,i.Z)(this,"cartMonitorUrl",void 0),(0,i.Z)(this,"travelCheckoutPageKey",void 0),(0,i.Z)(this,"checkoutPageUrl",void 0),(0,i.Z)(this,"confirmationPageTelemetry",void 0),(0,i.Z)(this,"isAOCFragmentCollectionEnabled",void 0),(0,i.Z)(this,"aOCFragmentCollectionRate",void 0),(0,i.Z)(this,"addressBarExpansionEnabled",void 0),(0,i.Z)(this,"retailerTrivia",void 0),(0,i.Z)(this,"disabledPopupOriginationList",void 0),(0,i.Z)(this,"allAutomatedSelectors",void 0),(0,i.Z)(this,"automatedSelectorsKey",void 0),(0,i.Z)(this,"isAddressBarCashbackEnabled",void 0),(0,i.Z)(this,"isCompositeNotificationPhCExcludedRetailer",void 0),(0,i.Z)(this,"isCompositeNotificationPhCTopRetailer",void 0),(0,i.Z)(this,"productPageUrlRegex",void 0),(0,i.Z)(this,"settings",void 0),(0,i.Z)(this,"edgeFeatureFlag",void 0),(0,i.Z)(this,"isEligibleForRewards",void 0)}static Create(e){const t=new g;return e&&(t.domainName=e.domainName,t.orderConfirmationPageUrl=e.orderConfirmationPageUrl,t.exclusiveMarket=e.exclusiveMarket,t.multiMsgValidationEnabled=e.multiMsgValidationEnabled,t.exactCheckoutPageUrl=e.exactCheckoutPageUrl,t.productOutOfStockSelector=e.productOutOfStockSelector,t.productNameSelector=e.productNameSelector,t.productPriceSelector=e.productPriceSelector,t.productImageSelector=e.productImageSelector,t.aaConsentEnabled=e.aaConsentEnabled,t.storeCartInEdgeStorage=e.storeCartInEdgeStorage,t.cartMonitorUrl=e.cartMonitorUrl,t.checkoutPageUrl=e.checkoutPageUrl,t.isTravelDomain=e.isTravelDomain,t.isStorewideCashbackEstimationEnabled=e.isStorewideCashbackEstimationEnabled,t.createCheckoutPageList(e),t.createFinalCheckoutPageList(e),t.createYoutubeTemplateList(e),t.createProductPagesList(e),t.confirmationPageTelemetry=e.confirmationPageTelemetry,t.isAOCFragmentCollectionEnabled=e.isAOCFragmentCollectionEnabled,t.productPageUrl=e.productPageUrl,t.aOCFragmentCollectionRate=e.aOCFragmentCollectionRate,t.disabledPopupOriginationList=e.disabledPopupOriginationList,t.addressBarExpansionEnabled=e.addressBarExpansionEnabled,t.createTriviaData(e),t.createAutomatedSelectorsPageList(e),t.isAddressBarCashbackEnabled=e.isAddressBarCashbackEnabled,t.isCompositeNotificationPhCExcludedRetailer=e.isCompositeNotificationPhCExcludedRetailer,t.isCompositeNotificationPhCTopRetailer=e.isCompositeNotificationPhCTopRetailer,t.productPageUrlRegex=e.productPageUrlRegex,t.searchQueryUrlRegex=e.searchQueryUrlRegex,t.settings=e.settings,t.edgeFeatureFlag=e.edgeFeatureFlag,t.isEligibleForRewards=e.isEligibleForRewards,t.platform=e.platform,t.checkoutPageKey=e.checkoutPageKey,t.allCheckoutPages=e.allCheckoutPages,t.finalCheckoutPageKey=e.finalCheckoutPageKey,t.allFinalCheckoutPages=e.allFinalCheckoutPages),t}updateCurrentCheckoutPage(e){return this.checkoutPageKey=this.findCurrentPage(e,this.allCheckoutPages,d.GV.CheckoutPage),-1!==this.checkoutPageKey}getCurrentCheckoutPage(e){return null!==this.checkoutPageKey&&-1!==this.checkoutPageKey&&void 0!==this.checkoutPageKey||-1!==this.checkoutPageKey&&e&&(this.updateCurrentCheckoutPage(e),null!==this.checkoutPageKey&&-1!==this.checkoutPageKey&&void 0!==this.checkoutPageKey)?this.allCheckoutPages[this.checkoutPageKey]:void 0}updateCurrentFinalCheckoutPage(e){const t=this.findCurrentPage(e,this.allFinalCheckoutPages);return-1!==t?(this.finalCheckoutPageKey=t,!0):(this.finalCheckoutPageKey=null,!1)}getCurrentFinalCheckoutPage(){if(null!=this.finalCheckoutPageKey)return this.allFinalCheckoutPages[this.finalCheckoutPageKey]}getCurrentProductPage(e){if(null!=this.productPageKey)return this.allProductPages[this.productPageKey];{const t=this.findCurrentProductPage(e,this.allProductPages);return-1!==t?(this.productPageKey=t,this.allProductPages[this.productPageKey]):void(this.productPageKey=null)}}getCurrentAutomatedSelectorsPage(e){return null!==this.automatedSelectorsKey&&void 0!==this.automatedSelectorsKey&&this.automatedSelectorsKey<this.allAutomatedSelectors.length||e&&(this.updateCurrentAutomatedSelectorsPage(e),null!==this.automatedSelectorsKey&&-1!==this.automatedSelectorsKey&&void 0!==this.automatedSelectorsKey)?this.allAutomatedSelectors[this.automatedSelectorsKey]:void 0}getAutomatedSelectorsPageByRegex(e){for(let t=0;t<this.allAutomatedSelectors.length;t++){const o=this.allAutomatedSelectors[t];if(new RegExp(o.urlRegex).test(e))return this.automatedSelectorsKey=t,o}this.automatedSelectorsKey=-1}isConfirmationPage(e){return new RegExp(this.orderConfirmationPageUrl).test(e)}updateCurrentAutomatedSelectorsPage(e){const t=this.findCurrentAutomatedSelectorsPage(e,this.allAutomatedSelectors);return-1!==t?(this.automatedSelectorsKey=t,!0):(this.automatedSelectorsKey=null,!1)}createCheckoutPageList(e){if(this.allCheckoutPages=[],e.allCheckoutPages&&e.allCheckoutPages.length>0)for(const t of e.allCheckoutPages)this.allCheckoutPages.push(c.Z.Create(t))}createFinalCheckoutPageList(e){if(this.allFinalCheckoutPages=[],e.allFinalCheckoutPages&&e.allFinalCheckoutPages.length>0)for(const t of e.allFinalCheckoutPages)this.allFinalCheckoutPages.push(c.Z.Create(t))}createAutomatedSelectorsPageList(e){if(this.allAutomatedSelectors=[],e.allAutomatedSelectors&&e.allAutomatedSelectors.length>0)for(const t of e.allAutomatedSelectors)this.allAutomatedSelectors.push(n.ZP.DeepAssign(new s.ZP,t))}createProductPagesList(e){if(this.allProductPages=[],e.allProductPages&&e.allProductPages.length>0)for(const t of e.allProductPages)this.allProductPages.push(u.Create(t))}createYoutubeTemplateList(e){if(this.youtubeTemplates=[],e.youtubeTemplates&&e.youtubeTemplates.length>0)for(const t of e.youtubeTemplates)this.youtubeTemplates.push(a.Create(t))}findCurrentPage(e,t,o){for(let i=0;t&&i<t.length;i++)if(n.ZP.IsPageMatch(t[i].checkoutPageUrl,t[i].pageUrlRegex,e)){if(p.R.isExperimentActive(h.H.checkoutPageTypeCheck)&&o&&t[i].pageType&&t[i].pageType!==o)continue;return t[i].disabled?-1:i}return-1}findCurrentProductPage(e,t){for(let o=0;o<t.length;o++)if(n.ZP.IsOnPage(t[o].productPageUrl,e))return o;return-1}findCurrentAutomatedSelectorsPage(e,t){for(let o=0;o<t.length;o++)if(n.ZP.IsPageRegexMatch(t[o].urlRegex,e))return o;return-1}createTriviaData(e){this.retailerTrivia={successRate:e?.retailerTrivia?.successRate??null}}isProductPage(e){return null!=this.productPageUrlRegex&&n.ZP.IsPageRegexMatch(this.productPageUrlRegex,e)||null!=this.productPageUrl&&n.ZP.IsPageRegexMatch(this.productPageUrl,e)}getCurrentPageType(){const e=this.getCurrentCheckoutPage()?.pageType??d.GV.UnknownPage;return e!==d.GV.UnknownPage?e:this.isProductPage(location.href)?d.GV.ProductPage:d.GV.UnknownPage}}var C=g},55648:function(e,t,o){o.d(t,{Z:function(){return m}});var i=o(72370),r=o(56005),a=o(93078),n=o(93190),s=o(73557),c=o(91495),l=o(44092),u=o(91897),d=o(44922),h=o(52056),p=o(83879),g=o(86743),C=o(82315),S=o(56854),m=class{constructor(){(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"aaConsentEnabled",void 0),(0,i.Z)(this,"aaConsentData",void 0),(0,i.Z)(this,"validatorModule",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"apiResponse",void 0)}async Init(){if(this.localDataService=p.Z.GetLocalDataService(),this.validatorModule=p.Z.GetValidatorModule(),this.domainName=this.localDataService.GetDomainName(),this.aaConsentEnabled=this.localDataService.GetCheckoutPageData().retailerData?.aaConsentEnabled??!1,this.apiResponse=C.Z.getApiResponse(),!this.aaConsentEnabled)return;const e=this.getAAConsentStr(c.Q.rawStorageObj,this.localDataService.GetDomainName());this.aaConsentData=this.getAAConsentData(e)}GetPopupOriginationList(){return[s.sR.AA_CONSENT]}async CanAutoOpenForFeature(e){if(!this.aaConsentEnabled)return!1;const t=this.apiResponse.retailerData.allProductPages;if((0,S.r)())for(let e=0;e<t.length;e++)if(this.apiResponse.retailerData.allProductPages[e].backgroundAAEnabled)return!1;let o=!0;if(this.aaConsentData){const e=(0,u.r2)(this.aaConsentData?.timeStamp);e>=0&&e<120&&(o=!1)}return o&&((0,l.i8)("CanOpenAAConsent","true"),this.validatorModule.SendValidationMessage(!1,d.S.AAConsent,this.domainName,[n.p.AA_CONSENT],!1,!(0,g.XB)())),o}async PostValidation(){}isAutoTriggeredAAAllowed(){if(!this.aaConsentEnabled||!this.aaConsentData?.allowed)return!1;const e=(0,u.r2)(this.aaConsentData.timeStamp);return e>=0&&e<1}AutoTriggerAutoApply(e){if(!this.aaConsentData)return;this.aaConsentData.allowed=!1;const t=r.Z.GetAAConsentStorageKey(this.localDataService.GetDomainName());h.Z.SendStorageMessage(t,JSON.stringify({value:JSON.stringify(this.aaConsentData)}));const o=new class{constructor(){(0,i.Z)(this,"BgaaResultAvailable",void 0)}};o.BgaaResultAvailable=e,h.Z.StartEdgeDriver("",JSON.stringify({action:a.v.PDPconsentAA,data:o}))}getAAConsentStr(e,t){const o=r.Z.GetAAConsentStorageKey(t);return"string"==typeof e[o]?e[o]:e[o]?.value??""}getAAConsentData(e){try{if(!e)return;return JSON.parse(e)}catch(e){return}}}},59518:function(e,t,o){var i=o(72370),r=o(5144),a=o(55648),n=o(82315),s=o(29247),c=o(44922),l=o(1094),u=o(31714),d=o(59645),h=o(73557),p=o(4872),g=o(90066),C=o(55590),S=o(20546),m=o(52056),A=o(83879),P=o(9839),f=o(31656),E=o(86743),T=o(3634),O=o(91495),I=o(65559),_=o(56854),v=o(57459);t.Z=class{constructor(){(0,i.Z)(this,"checkoutPageUrlData",void 0),(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"isPageValid",void 0),(0,i.Z)(this,"aaValidationReason",void 0),(0,i.Z)(this,"canOpen",void 0),(0,i.Z)(this,"autoOpenReasons",void 0),(0,i.Z)(this,"totalPrice",void 0),(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"validator",void 0),(0,i.Z)(this,"aocValidatorUtilities",void 0),(0,i.Z)(this,"bgaaService",void 0)}GetPopupOriginationList(){return[h.sR.AUTO_SHOW_COUPONS_CHECKOUT]}async CanAutoOpenForFeature(e){if(this.classifiedAsNonCheckoutPage())return Promise.resolve(!1);f.R.isExperimentActive(p.H.autofillAutoPopup)&&this.setAttributeForInputBox(),this.totalPrice=this.GetTotalPrice(),this.aaValidationReason=await this.IsAAValid(),this.isPageValid=this.aaValidationReason===c.S.PageIsValid,this.autoOpenReasons=[];const t=this.localDataService.IsExpressCheckoutPage(),o={auto_apply_status:this.isPageValid,express_checkout_status:t,open_micro_notifcation:!1,page_validations:[],page_validations_auto_open:[],auto_open_reasons:[]};if(!this.isPageValid){if(this.aaValidationReason===c.S.PageIsInvalid&&this.apiResponse.retailerData?.multiMsgValidationEnabled){const e=l.Z.GetInitialFields(this.apiResponse);s.ZP.ObserveUntil((()=>this.validator.IsPageValid(e)),(()=>{this.validator.SendValidationMessage(!0,c.S.PageBecameValid,this.domainName,void 0,!(0,E.XB)(),!1,o);const e=new CustomEvent(T.T2,{detail:{popupOrigination:h.sR.AUTO_SHOW_COUPONS_CHECKOUT}});window.dispatchEvent(e)}))}return this.validator.SendValidationMessage(this.isPageValid,this.aaValidationReason,this.domainName,void 0,!1,!1,o),Promise.resolve(!1)}let i=null;const n=m.Z.ParseBackgroundAutoApplyStateData(O.Q.rawStorageObj);n&&this.checkoutPageUrlData&&(i=await this.bgaaService.TryValidateBackgroundAutoApplyState(n,this.localDataService.GetMarket(),this.checkoutPageUrlData)),this.SetTotalPrice(),this.canOpen=await this.shouldAutoOpenForAA(o);const u=this.canOpen;let g=u;const A=O.Q.BGAAApplyButtonClicked,P=f.R.isExperimentActive(p.H.suppressAAAutoApplyThreshold),v=(0,_.r)();let R;if(v&&this.canOpen&&(i===r.ps.Positive&&A==="true_"+this.domainName||i===r.ps.Negative)&&(this.canOpen=!1,this.autoOpenReasons.push("BGAA is active"),g=!1,m.Z.SendStringStorageMessage(C.Q.BGAAApplyButtonClicked,"false_"+this.domainName)),P)try{const e=f.R.getServiceExperimentValue(p.H.suppressAAAutoApplyThreshold),t=f.R.getServiceExperimentValue(p.H.suppressAADomainSuccessThreshold);if(t&&e){const o=parseInt(t,10),i=parseInt(e,10),a=O.Q.UnsuccessfulAutoApplyCount;a&&i>0&&o>0&&this.canOpen&&a>=i&&(this.canOpen=this.HasHighConfidenceCouponsDomainLevel(o),this.canOpen||this.autoOpenReasons.push("Unsuccessful AA count is above threshold"));const n=new d.Z(r.xu.SuppressAutoApply),s=this.apiResponse?.retailerData?.retailerTrivia?.successRate;s&&0===s&&(this.canOpen=!1,this.autoOpenReasons.push("Domain success rate is 0"));const c=this.canOpen;R=c,n.Domain=this.domainName,n.Metadata=JSON.stringify({unsuccessfulAACount:a,aaFailureThreshold:i,domainThreshold:o,currentDomainSuccesRate:s,canOpen:c,autoOpenReasons:this.autoOpenReasons}),m.Z.SendLogEvent(this.apiResponse.impressionId,"Suppress auto apply experiement result telemetry","",void 0,void 0,r.R.EdgeFlyoutStatus,n,this.domainName)}}catch(e){m.Z.SendLogEvent(this.apiResponse.impressionId,"Suppress auto apply experiment error:"+e?.message,"error",void 0,void 0,r.R.AutoApply)}const D=new a.Z;D.Init();const N=new S.Z;N.Init();const y=new I.Z;if(y.Init(),o.auto_open_reasons.push(...this.autoOpenReasons),D.isAutoTriggeredAAAllowed()?(this.autoOpenReasons.push("Auto Triggered AA Allowed"),o.auto_open_reasons.push("Auto Triggered AA Allowed"),this.validator.SendValidationMessage(this.isPageValid,this.aaValidationReason,this.domainName,void 0,!1,!1,o),this.canOpen=!1,D.AutoTriggerAutoApply(null!=i)):N.isAutoApplyingBestCouponAllowed()?((0,E.XB)()&&(this.autoOpenReasons.push("AOC is active, deferred to AOC"),o.auto_open_reasons.push("AOC is active, deferred to AOC")),this.validator.SendValidationMessage(this.isPageValid,this.aaValidationReason,this.domainName,void 0,!(0,E.XB)()&&this.canOpen,!1,o),N.AutoApplyBestCoupon()):y.isAutoApplyingExclusiveCouponAllowed()?(this.autoOpenReasons.push("Auto Triggered Exclusive Coupon Allowed"),o.auto_open_reasons.push("Auto Triggered Exclusive Coupon Allowed"),this.validator.SendValidationMessage(this.isPageValid,this.aaValidationReason,this.domainName,void 0,!1,!1,o),y.AutoApplyExclusiveCoupon()):((0,E.XB)()&&(this.autoOpenReasons.push("AOC is active, deferred to AOC"),o.auto_open_reasons.push("AOC is active, deferred to AOC")),this.validator.SendValidationMessage(this.isPageValid,this.aaValidationReason,this.domainName,void 0,!(0,E.XB)()&&this.canOpen,!1,o)),v){const e=this.canOpen,t=new d.Z(r.xu.SuppressAutoApply);t.Domain=this.domainName,t.Metadata=JSON.stringify({bgaaApplyButtonClicked:A,bgaaResult:i,canOpenInitial:u,canOpenWithBGAA:g,canOpenFinal:e,isSuppressAAActive:P,canOpenWithIsSuppressAAActive:R}),m.Z.SendLogEvent(this.apiResponse.impressionId,"BGAA checkout page - canOpen status for AUTO_SHOW_COUPONS_CHECKOUT","",void 0,void 0,r.R.EdgeFlyoutStatus,t,this.domainName)}return Promise.resolve(this.canOpen)}Init(){return this.apiResponse=n.Z.getApiResponse(),this.apiResponse.retailerData.updateCurrentCheckoutPage(l.Z.GetCurrentPathName()),this.checkoutPageUrlData=this.apiResponse.retailerData.getCurrentCheckoutPage(),this.domainName=this.apiResponse.retailerData.domainName,this.localDataService=A.Z.GetLocalDataService(),this.validator=A.Z.GetValidatorModule(),this.aocValidatorUtilities=l.Z.GetValidatorAutoOpenController(),this.bgaaService=A.Z.GetBackgroundAAService(),Promise.resolve()}PostValidation(){return this.classifiedAsNonCheckoutPage()||l.Z.GetAndSendOrderTotal(this.localDataService.GetMarket(),this.isPageValid,this.aaValidationReason),Promise.resolve()}classifiedAsNonCheckoutPage(){return(this.checkoutPageUrlData?.pageType??r.GV.CheckoutPage)!==r.GV.CheckoutPage}GetTotalPrice(){return this.checkoutPageUrlData&&!this.checkoutPageUrlData.supportedNoOrderTotal?m.Z.GetOrderTotalString(this.checkoutPageUrlData.orderTotalDataElementSelector):""}SetTotalPrice(){this.aocValidatorUtilities&&!this.checkoutPageUrlData?.supportedNoOrderTotal&&(m.Z.SendStorageMessage("price"+this.domainName,JSON.stringify({value:this.totalPrice})),(0,E.XB)()?P.Q.setTotalPrice(this.totalPrice):this.aocValidatorUtilities.setTotalPrice(this.totalPrice))}async HasEligibleCoupons(){if(!f.R.isExperimentActive(p.H.onlyShowAANotificationWithEligibleCoupons))return!0;try{const e=A.Z.GetSuggestedCouponService().GetSuggestedCoupons(),t=await A.Z.GetCartExtractionService().WaitForCartExtractionAndBlockedCouponsThenGetCartData();return v.Z.FilterUnblockedCoupons(this.apiResponse.coupons,e,t?.BlockedCouponsData?.BlockedCoupons??[]).length>0}catch(e){return!0}}async IsAAValid(){if(!this.checkoutPageUrlData)return this.validator.sendErrorMessage(this.apiResponse.impressionId,"no checkout page url data"),c.S.IsPageValidError;if(!this.IsAutoApplyEnabled())return c.S.DisabledCheckoutPageData;if(0===l.Z.GetInitialFields(this.apiResponse).length)return c.S.NoSelectors;if(this.apiResponse.coupons?.length>0==0)return c.S.NoCoupons;if(this.checkoutPageUrlData.isHomePageSameAsCheckout&&!this.checkoutPageUrlData.supportedNoOrderTotal)try{const e=+this.totalPrice;if(!e||e<=0)return c.S.InvalidCartTotal}catch{return c.S.InvalidCartTotal}try{const e=this.HasEligibleCoupons(),t=this.localDataService.GetIsCheckoutPage(this.apiResponse);return await e?await t?(this.PrefetchAutoApplyResources(),c.S.PageIsValid):c.S.PageIsInvalid:c.S.AllCouponsBlocked}catch(e){return this.validator.sendErrorMessage(this.apiResponse.impressionId,e?.message??"checkoutpage error."),c.S.IsPageValidError}}PrefetchAutoApplyResources(){if(document?.body){let e=!1;const t="https://edgeshoppingstatic.azureedge.net/shoppingjsstatic/v2/Assets";window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(e=!0);const o=document.createElement("LINK");o.setAttribute("rel","prefetch"),o.href=e?t+"Shopping_Progress_Dark_01.mp4":t+"Shopping_Progress_01.mp4",o.setAttribute("as","fetch");const i=document.createElement("LINK");i.setAttribute("rel","prefetch"),i.href=e?t+"Shopping_Success_Dark_01.mp4":t+"Shopping_Success_01.mp4",i.setAttribute("as","fetch");const r=document.createElement("LINK");r.setAttribute("rel","prefetch"),r.href=e?t+"Shopping_Finished_Dark_01.mp4":t+"Shopping_Finished_01.mp4",r.setAttribute("as","fetch"),document.body.appendChild(o),document.body.appendChild(i),document.body.appendChild(r)}}IsAutoApplyEnabled(){return!0===this.checkoutPageUrlData?.edgeEnabled}setAttributeForInputBox(){const e=this.checkoutPageUrlData?.isAutoShowDisabled;if(void 0!==this.checkoutPageUrlData&&this.checkoutPageUrlData.inputBoxSelector&&!e){const e=g.Z.GetFirstVisibleElement(this.checkoutPageUrlData.inputBoxSelector);e?.setAttribute("edge-shopping-apply-coupon-input-box-tag","")}}async shouldAutoOpenForAA(e){const t=e.auto_apply_status;let o=!0;if(!(0,E.XB)()){const e={Reason:""};o=this.aocValidatorUtilities.isPopupOriginationUnblocked(h.sR.AUTO_SHOW_COUPONS_CHECKOUT,e),e.Reason&&this.autoOpenReasons.push(e.Reason)}const i=f.R.isExperimentActive(p.H.CouponsPersonalization),a=this.validator.GetRuleBasedTriggerController();if(o&&i&&a&&this.apiResponse?.coupons&&this.apiResponse.coupons.length>0&&!(0,E.XB)())if(o=a.canAutoOpen(),o)e.personalizationAutoOpenTelemetryData=a.getPersonalizationAutoOpenTelemetryData();else{this.autoOpenReasons.push("RuleBased Trigger Controller decides to not auto open the flyout");const e=new d.Z(r.xu.PersonalizedAutoTriggerOff);e.Metadata=JSON.stringify({personalizationAutoOpenTelemetryData:a.getPersonalizationAutoOpenTelemetryData(),popupOriginationEnum:h.sR.AUTO_SHOW_COUPONS_CHECKOUT}),m.Z.SendLogEvent(this.apiResponse.impressionId,"RuleBased Trigger Controller decides to not auto open the flyout",t?"true":"false",void 0,void 0,r.R.EdgeFlyoutStatus,e)}const n=f.R.getMultipleVariants(p.H.couponsConfidence),s=f.R.getVariantValue(n,u.qG.CouponLevelThreshold,-1),c=f.R.getVariantValue(n,u.qG.DomainLevelThreshold,-1);if(o&&s>=0){const e=this.HasHighConfidenceCouponsCouponsLevel(s);o=o&&e,o||this.autoOpenReasons.push("No high confidence coupons available above threshold at coupons level")}if(o&&c>=0){const e=this.HasHighConfidenceCouponsDomainLevel(c);o=o&&e,o||this.autoOpenReasons.push("No high confidence coupons available above threshold at domain level")}return o}HasHighConfidenceCouponsCouponsLevel(e){let t=!1,o=!1;if(this.apiResponse?.coupons?.length)for(const i of this.apiResponse.coupons){const r=void 0===i.successRate?0:i.successRate;if(o||void 0===r||0===r||(o=!0),r>=e){t=!0;break}}return!o||t}HasHighConfidenceCouponsDomainLevel(e){let t=!0;return this.apiResponse?.retailerData?.retailerTrivia?.successRate&&(t=this.apiResponse?.retailerData?.retailerTrivia?.successRate>=e),t}}},98574:function(e,t,o){var i=o(72370),r=o(5144),a=o(73557),n=o(91495),s=o(82315),c=o(1094),l=o(52056),u=o(11849),d=o(83879),h=o(86743),p=o(31024),g=o(55648),C=o(44922),S=o(27689),m=o(33491),A=o(3634),P=o(56854);t.Z=class{constructor(){(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"canOpen",void 0),(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"validator",void 0),(0,i.Z)(this,"aocValidatorUtilities",void 0),(0,i.Z)(this,"BestCouponConsentData",void 0),(0,i.Z)(this,"checkoutPageUrlData",void 0)}Init(){return this.apiResponse=s.Z.getApiResponse(),this.domainName=this.apiResponse.retailerData.domainName,this.localDataService=d.Z.GetLocalDataService(),this.validator=d.Z.GetValidatorModule(),this.aocValidatorUtilities=c.Z.GetValidatorAutoOpenController(),this.BestCouponConsentData=(0,S.BQ)(n.Q.ProductBestCouponConsent),this.checkoutPageUrlData=this.apiResponse.retailerData.getCurrentCheckoutPage(),Promise.resolve()}PostValidation(){return Promise.resolve()}GetPopupOriginationList(){return[a.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY]}GetAutoOpenParams(){return JSON.stringify({bestCouponConsentData:this.BestCouponConsentData})}async CanAutoOpenForFeature(e){const t=(0,m.WN)("isBgaaComplete");if(this.isCheckoutPage()||!1===t)return Promise.resolve(!1);const o=l.Z.ParseBackgroundAutoApplyStateData(n.Q.rawStorageObj),i=o?.BackgroundAAStatus.domainName===this.domainName;let s=null;if(o&&i&&t&&(s=await this.TryValidateBackgroundAutoApplyState(o,this.localDataService.GetMarket())),this.canOpen=await this.shouldAutoOpenForBGAA(),this.canOpen&&s&&s===r.ps.Positive){const e=new CustomEvent(A.T2,{detail:{popupOrigination:a.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY}});window.dispatchEvent(e)}else this.canOpen=!1;return(new g.Z).Init(),this.canOpen&&t&&this.validator.SendValidationMessage(!0,C.S.PageIsValid,this.domainName,void 0,!(0,h.XB)()&&this.canOpen,!1,void 0),(0,m.Ev)("isBgaaComplete",!1),Promise.resolve(this.canOpen)}async TryValidateBackgroundAutoApplyState(e,t,o){try{return await this.ValidateBackgroundAutoApplyState(e,t,o)}catch(e){}return null}async ValidateBackgroundAutoApplyState(e,t,o){const i=p.Z.GetBackgroundAAKeyName();if(Date.now()-e.StartTime>864e5)return this.validator.DeleteKeyFromPersistentStorage(i),p.Z.SendBackgroundAAStateValidationMessage(""),null;const r=p.Z.CanCurrentDomainDeleteBgaaState(e.BackgroundAAStatus.domainName);if(!r&&e.BackgroundAAStatus.expiredState)return p.Z.SendBackgroundAAStateValidationMessage(""),null;const a=e.BackgroundAAStatus.result,n=p.Z.CanCurrentPageDeleteBgaaState(e.BackgroundAAStatus.pageUrl);if(!n&&e.BackgroundAAStatus.expiredState)return p.Z.SendBackgroundAAStateValidationMessage(""),null;if(n&&o){const r=await u.Z.WaitAndGetCartValue(o.orderTotalDataElementSelector,t),s=await u.Z.WaitAndGetCartValue(o.orderSubTotalElementSelector,t,1e3);return p.Z.ValidateBgAAState(e,r.OrderTotal,s.OrderTotal)?this.GetBgaaResult(e,a):(n?this.validator.DeleteKeyFromPersistentStorage(i):(e.BackgroundAAStatus.expiredState=!0,this.validator.SendStorageMessage(i,JSON.stringify({value:e.ToString()}))),p.Z.SendBackgroundAAStateValidationMessage(""),null)}return r?this.GetBgaaResult(e,a):null}GetBgaaResult(e,t){const o=Math.round(100*e.MaxDiscount)/100;(t===r.ps.InProgress||t===r.ps.Cancelled)&&o>0&&(t=r.ps.Positive);const i={BestCoupon:e.BestCoupon?.couponCode,Result:t,Savings:o,SuccessfulCoupons:e.CouponResults.filter((e=>e.Discount>0)).map((e=>e.Code))};return p.Z.SendBackgroundAAStateValidationMessage(JSON.stringify(i)),t}isCheckoutPage(){return!!this.checkoutPageUrlData&&this.checkoutPageUrlData.pageType!==r.GV.ProductPage&&!(!this.checkoutPageUrlData.checkoutPageUrl||"/"===this.checkoutPageUrlData.checkoutPageUrl)}async shouldAutoOpenForBGAA(){if(!(0,P.r)())return!1;let e=!0;return(0,h.XB)()||(e=this.aocValidatorUtilities.isPopupOriginationUnblocked(a.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY)),e}}},74113:function(e,t,o){o.d(t,{Z:function(){return N}});var i=o(72370),r=o(59645),a=o(58474);class n extends a.Z{constructor(e,t,o,r,a){super(),(0,i.Z)(this,"Discount",void 0),(0,i.Z)(this,"StartingPrice",void 0),(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"ProductUrl",void 0),(0,i.Z)(this,"DiscountString",void 0),this.StartingPrice=t??0,this.Discount=o??0,this.ProductUrl=e,this.DiscountString=r,this.Domain=a}}var s=n,c=o(5144),l=o(5491),u=o(93190),d=o(73557),h=o(55590),p=o(29247),g=o(50616),C=o(36493),S=o(91495),m=o(27689),A=o(9448),P=o(90066),f=o(41290),E=o(44922),T=o(52056),O=o(83879),I=o(93970),_=o(1094),v=o(86743),R=o(31656),D=o(4872),N=class{constructor(){(0,i.Z)(this,"checkoutPageUrlData",void 0),(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"impressionId",void 0),(0,i.Z)(this,"traceId",void 0),(0,i.Z)(this,"validator",void 0),(0,i.Z)(this,"aocValidatorUtilities",void 0),(0,i.Z)(this,"rakutenJP","rakuten.co.jp")}GetPopupOriginationList(){return[d.sR.AUTO_SHOW_COUPONS_CLIPPING]}async CanAutoOpenForFeature(e){const t=await this.waitForIsClippingScenario(this.checkoutPageUrlData);if(R.R.getServiceExperimentValue(D.H.clipCloseSnooze)&&!(0,v.XB)()&&!this.aocValidatorUtilities.isPopupOriginationUnblocked(d.sR.AUTO_SHOW_COUPONS_CLIPPING))return Promise.resolve(!1);if(this.checkoutPageUrlData?.clippingSelectors){const e=new r.Z(c.xu.CouponClippingSelectorsAvailable);e.Metadata=JSON.stringify({Domain:this.domainName,isClippingValid:t,Url:location.pathname}),T.Z.SendLogEventMessage(e,c.R.EdgeFlyoutStatus,this.impressionId,`Clipping selectors is available for ${this.domainName}. The selectors are: ${JSON.stringify(this.checkoutPageUrlData.clippingSelectors)}`,c.in.Information)}if(!t||!this.checkoutPageUrlData?.clippingSelectors)return Promise.resolve(!1);const o=this.getAutoClipData();if(!o?.includes(this.domainName))return t&&(this.validator.SendValidationMessage(!1,E.S.Clipping,this.domainName,[u.p.COUPONS_CLIPPING]),this.localDataService.SetIsClippingSent(!0)),Promise.resolve(t);const i=new f.Z(new class{SendLogMessage(e,t,o,i,r){T.Z.SendLogEventMessage(i,t,r,o,e)}SaveSavingsTransactionToEdge(e){T.Z.SendStorageMessage(c.Sl.CouponClippingTransactionsKey,JSON.stringify({value:JSON.stringify(e)}))}SendEdgeAANegativeResult(){}SendEdgeAAPositiveResult(e,t,o){}SendEdgeAAErrorMessage(e){}},c.KE.AutoCouponClipping);return await i.TryClipCoupons(this.checkoutPageUrlData.clippingSelectors,this.domainName,new l.V,this.impressionId)&&(T.Z.SendMessage(A.H.RecordShoppingUserEngagement,[I.OE.CouponClipping]),T.Z.SendMessage(A.H.RecordShoppingUserAction,[I.J6.CouponClipping])),Promise.resolve(!1)}Init(){return this.localDataService=O.Z.GetLocalDataService(),this.domainName=this.localDataService.GetDomainName(),this.checkoutPageUrlData=this.localDataService.GetCheckoutPageData().retailerData.getCurrentCheckoutPage(location.pathname),this.validator=O.Z.GetValidatorModule(),this.aocValidatorUtilities=_.Z.GetValidatorAutoOpenController(),this.impressionId=this.localDataService.GetImpressionId(),this.checkoutPageUrlData,Promise.resolve()}PostValidation(){return Promise.resolve()}async waitForIsClippingScenario(e){const t=e?.clippingSelectors;if(!t?.discountSelector||!t?.signedInSelector)return!1;const o=t.waitForPageLoad;o&&await p.ZP.Sleep(o);const i=await this.isClippingPage(t),r=await this.isClippingScenario(t,i),a=await this.logIfClippingExist(t,i);return r&&a}getAutoClipData(){if(S.Q?.AutoClipData){let e=new class{constructor(){(0,i.Z)(this,"enabledDomains",void 0)}};try{e=(0,m.BQ)(S.Q.AutoClipData)}catch{T.Z.DeleteKeyFromPersistentStorage(h.Q.AutoClipData)}return e.enabledDomains}}isClippingScenario(e,t){let o;const i=P.Z.HasVisibleElement(e.signedInSelector);if(this.domainName===this.rakutenJP){let r=P.Z.HasVisibleElement(e.clipCouponSelector);if(!r){const t=P.Z.GetFirstVisibleElement(e.clickBeforeClipSelector);t?.click(),r=P.Z.HasVisibleElement(e.clipCouponSelector)}o=t&&(i||!!e.isSignInOptional)&&r}else{const r=P.Z.HasVisibleElement(e.alreadyClippedSelector);o=t&&(i||!!e.isSignInOptional)&&!r}if(o){const t=new r.Z(c.xu.CouponClippingElements);t.Metadata=JSON.stringify({signedInSelector:e.signedInSelector,alreadyClippedSelector:e.alreadyClippedSelector,isSignInOptional:e.isSignInOptional,Url:location.pathname}),T.Z.SendLogEventMessage(t,c.R.EdgeFlyoutStatus,this.impressionId,"isClippingScenario",c.in.Information)}return o}logIfClippingExist(e,t){if(!t)return!1;try{const t=P.Z.GetFirstVisibleElement(e.orderTotalDataElementSelector),o=t?.innerText??"";let i,r;if(o.includes("-")){const e=o.split("-");i=g.Z.getInitialPrice(e[0]),r=g.Z.getInitialPrice(e[1])}else i=g.Z.getInitialPrice(o);const a=this.getDiscount(i,r,e);if(void 0===a||0===a.discount)return!1;const n=new s(location.pathname,i,a?.discount,a?.discountString,(0,m.S8)());T.Z.SendLogEventMessage(n,c.R.ClippingExist,this.impressionId,"There is clipping",c.in.Information)}catch(e){T.Z.SendLogEvent(this.impressionId,"Error while logging clipping data : "+e?.message,"error",void 0,void 0,void 0),T.Z.SendMessage(A.H.CheckoutPageValidationError,["error",this.traceId])}return!0}isClippingPage(e){const t=P.Z.HasVisibleElement(e.clickBeforeClipSelector),o=P.Z.HasVisibleElement(e.clipCouponSelector);if(t||o){const t=new r.Z(c.xu.CouponClippingElements);t.Metadata=JSON.stringify({clickBeforeClipSelector:e.clickBeforeClipSelector,clipCouponSelector:e.clipCouponSelector,Url:location.pathname}),T.Z.SendLogEventMessage(t,c.R.EdgeFlyoutStatus,this.impressionId,"isClippingPage",c.in.Information)}return t||o}getDiscount(e,t,o){let i;if(this.domainName===this.rakutenJP){const t=[];let r=P.Z.GetAllMatchingElements(o.discountSelector);if(!r.length){const e=P.Z.GetFirstVisibleElement(o.clickBeforeClipSelector);if(e?.click(),r=P.Z.GetAllMatchingElements(o.discountSelector),!r)return}r.forEach((o=>{const i="%"===o.childNodes[1].textContent||"%"===o.childNodes[1].textContent?(0,C.K)(o.childNodes[0].textContent??"0")*e:(0,C.K)(o.childNodes[0].textContent??"0");t.push(i)})),t.sort(((e,t)=>e-t)),i={discount:t[0],maxDiscount:t[t.length-1],discountString:t[0].toString()}}else{const r=P.Z.GetFirstVisibleElement(o.discountSelector),a=r?.innerText??"";if(a.includes("-")){const n=a.split("-"),s=g.Z.getAmazonClippingDiscount(e,n[0])??0,c=g.Z.getAmazonClippingDiscount(e,n[1])??0;let l=0,u=0;if(o.isSalePriceNotDiscount)if(t){const o=0===s?0:e-s,i=0===c?0:t-c;l=Math.min(o,i),u=Math.max(o,i)}else u=0===s?0:e-s,l=0===c?0:e-c;else l=s,u=c;i={discount:l,maxDiscount:u,discountString:r?.innerText??""}}else{let t=g.Z.getAmazonClippingDiscount(e,a)??0;o.isSalePriceNotDiscount&&(t=0===t?0:e-t),i={discount:t??0,maxDiscount:t??0,discountString:r?.innerText??""}}}return i}}},65559:function(e,t,o){var i=o(72370),r=o(56005),a=o(93078),n=o(73557),s=o(55590),c=o(91495),l=o(44092),u=o(91897),d=o(27689),h=o(82315),p=o(23498),g=o(52056),C=o(56854);t.Z=class{constructor(){(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"ExclusiveCouponConsentWithDomain",void 0),(0,i.Z)(this,"aaConsentData",void 0)}async Init(){this.apiResponse=h.Z.getApiResponse(),this.domainName=this.apiResponse.retailerData?.domainName??(0,d.S8)(),this.ExclusiveCouponConsentWithDomain=(0,d.BQ)(c.Q.ExclusiveCouponConsent)??{},this.apiResponse.retailerData?.aaConsentEnabled&&(this.aaConsentData=(0,d.BQ)(c.Q.rawStorageObj[r.Z.GetAAConsentStorageKey(this.domainName)]))}GetPopupOriginationList(){return[n.sR.AUTO_SHOW_ABANDONED_CART]}async CanAutoOpenForFeature(e){const t=this.apiResponse.retailerData.allProductPages;if((0,C.r)()&&t.length>0)for(let e=0;e<t.length;e++)if(this.apiResponse.retailerData.allProductPages[e].backgroundAAEnabled)return!1;return"true"!==(0,l.Lt)("CanOpenAAConsent")&&!this.isAutoTriggeredAAAllowed()}async PostValidation(){}isAutoApplyingExclusiveCouponAllowed(){if(!this.ExclusiveCouponConsentWithDomain||!this.ExclusiveCouponConsentWithDomain[this.domainName]?.allowed)return!1;const e=(0,u.r2)(this.ExclusiveCouponConsentWithDomain[this.domainName].timeStamp);return e>=0&&e<1||(delete this.ExclusiveCouponConsentWithDomain[this.domainName],g.Z.SendStorageMessage(s.Q.ExclusiveCouponConsent,JSON.stringify({value:JSON.stringify(this.ExclusiveCouponConsentWithDomain)})),!1)}AutoApplyExclusiveCoupon(){this.ExclusiveCouponConsentWithDomain&&this.ExclusiveCouponConsentWithDomain[this.domainName]?.exclusiveCoupon&&(g.Z.StartEdgeDriver("",JSON.stringify({action:a.v.ApplyExclusiveCoupon,data:{exclusiveCoupon:this.ExclusiveCouponConsentWithDomain[this.domainName].exclusiveCoupon}})),p.Z.fireAffiliateUrl(this.apiResponse),delete this.ExclusiveCouponConsentWithDomain[this.domainName],g.Z.SendStorageMessage(s.Q.ExclusiveCouponConsent,JSON.stringify({value:JSON.stringify(this.ExclusiveCouponConsentWithDomain)})))}isAutoTriggeredAAAllowed(){if(!this.aaConsentData?.allowed)return!1;const e=(0,u.r2)(this.aaConsentData.timeStamp);return e>=0&&e<1}}},98011:function(e,t,o){var i=o(72370),r=o(41865),a=o(3634),n=o(95457),s=o(4872),c=o(31656),l=o(47594),u=o(59645),d=o(59352),h=o(5144),p=o(93078),g=o(93190),C=o(11050),S=o(88767),m=o(73557),A=o(55590),P=o(18491),f=o(71544),E=o(33491),T=o(91495),O=o(27689),I=o(4724),_=o(47746),v=o(8018),R=o(57550),D=o(82315),N=o(9839),y=o(1094),b=o(50607),k=o(44922),U=o(52056),w=o(83879),L=o(86743);class M{constructor(){(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"hasSpbExpiryNotifyVariation",!1),(0,i.Z)(this,"hasSpbAddToCartNotifyVariation",!1),(0,i.Z)(this,"autoActivationOnCartPage",!1),(0,i.Z)(this,"itemLevelCashback",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"cartExtractionService",void 0)}Init(){this.apiResponse=D.Z.getApiResponse();const e=this.apiResponse?.itemLevelCashBack?.variations?new Map(Object.entries(this.apiResponse?.itemLevelCashBack?.variations)):new Map;this.hasSpbExpiryNotifyVariation=e?.get("spbExpiryNotifyVariation")===d.b.variation1;const t=c.R.getServiceExperimentValue(s.H.spbAddToCart);if(this.hasSpbAddToCartNotifyVariation="variation1"===t,this.autoActivationOnCartPage=c.R.isTestFlagActive(l.t.msShoppingTestExp10)||c.R.isExperimentActive(s.H.spbCheckoutAutoActivation)||c.R.isExperimentActive(s.H.qtCartPageAutoActivation),this.itemLevelCashback=this.apiResponse.itemLevelCashBack,this.domainName=this.apiResponse.retailerData.domainName,this.autoActivationOnCartPage){try{if("amazon.com"===this.domainName||"target.com"===this.domainName||"walmart.com"===this.domainName){const e=w.Z.GetLocalDataService(),t=(e?.GetCheckoutPageData()||this.apiResponse).retailerData.getCurrentCheckoutPage(location.pathname);if(t?.pageType===h.GV.CheckoutPage){let e;const t=new Promise((t=>setTimeout(e=t,2e3)));return this.cartExtractionService=w.Z.GetCartExtractionService(),this.cartExtractionService.subscribe(e),this.cartExtractionService.Init(),t}}}catch(e){const t=new u.Z(h.xu.CartPageCashbackNotification);t.Metadata=JSON.stringify({}),t.Domain=this.domainName,U.Z.SendLogEventMessage(t,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,e.message,h.in.Error)}this.autoActivationOnCartPage=!1}return Promise.resolve()}PostValidation(){return Promise.resolve()}GetPopupOriginationList(){return[m.sR.AUTO_SHOW_SPB_CASHBACK_LANDING,m.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK,m.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING,m.sR.AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION]}async CanAutoOpenForFeature(e){const t=T.Q?.ICIsPendingTransactionPresent??!1,o=w.Z.GetICValidatorService();if(o.GetPopupOriginationList().includes(e)){if((0,L.XB)()&&(await o.Init(),await o.CanAutoOpen(e))){const e=w.Z.GetLocalDataService(),t=w.Z.GetValidatorModule();(e.GetICNotificationType()===v.c.GroceryAutoShow||e.GetICNotificationType()===v.c.AddedToCartPDP||e.GetICNotificationType()===v.c.SpbHomePage)&&t.SendValidationMessage(!1,k.S.GroceryCashback,this.apiResponse.retailerData?.domainName??"",[g.p.GROCERY_ITEMIZED_CASHBACK_LANDING])}return await this.handleICGroceryCashback(e,t)}if(this.isSpbCheckoutFlagActive()&&e===m.sR.AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION)try{if(this.isCheckoutPage()){const t=this.cartExtractionService.GetAvailableCartData(),o=[];this.GetSpbCartOffers(o).then((()=>{const i=this.ProcessSpbCheckOutPage(o,t);if(i&&i.length>0){N.Q.sendControllerStorageMessage(A.Q.GroceryMatchedCartSpbOffers,JSON.stringify({value:i})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:v.c.SpbCartPageNotification}));const t=new CustomEvent(a.T2,{detail:{popupOrigination:e}});window.dispatchEvent(t)}}))}}catch(e){const t=new u.Z(h.xu.SPBCheckoutNotification);t.Metadata=JSON.stringify({}),t.Domain=this.domainName,U.Z.SendLogEventMessage(t,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,e.message,h.in.Error)}return Promise.resolve(!1)}handleICGroceryCashback(e,t){if(e===m.sR.AUTO_SHOW_SPB_CASHBACK_LANDING){if(this.hasHomePageSpbData(this.apiResponse)){const e=v.c.SpbHomePage;return N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:e})),Promise.resolve(!0)}const t=this.apiResponse.retailerData?.domainName;if(function(e,t=!1){const o=(e?.value||[]).find((e=>e.position===S.zE.SPB_OFFERS));return!(!(o&&o?.offer&&o?.promotionInformation)||t&&"true"!==o.offerLevelSignals?.autoshow)}(this.apiResponse.comparableOffers)){if(c.R.isExperimentActive(s.H.cpsPDPcontrolFlag)){const o={spbOffer:M.GetSpbOffer(this.apiResponse.comparableOffers),exp:"pdp won't be shown due to control flag"};return this.logCanAutoOpenForFeature(e,t,!1,o),Promise.resolve(!1)}const o={spbOffer:M.GetSpbOffer(this.apiResponse.comparableOffers)};return this.logCanAutoOpenForFeature(e,t,!0,o),Promise.resolve(!0)}const o=this.hasDataForPdpSpb(this.apiResponse);return o&&this.logCanAutoOpenForFeature(e,t,o),Promise.resolve(o)}if(e===m.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING)return t?((0,b.LT)(this.apiResponse.productItemizedCashBack,this.apiResponse.userInfo,this.apiResponse.impressionId,"Pending transaction is present"),Promise.resolve(!1)):Promise.resolve(this.hasDataForPdpQt(this.apiResponse));if(e===m.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK){if(this.autoActivationOnCartPage){const e=this.ActivateQTOfferOnCartPageNotification();return Promise.resolve(e)}const e=this.IsInstantAddToCart(),t=this.hasActivatedQt()||this.shouldShowcofirmationNotification();if(e&&t)try{const e=this.apiResponse.productItemizedCashBack.offer?.value,t=this.apiResponse.productItemizedCashBack.offer?.minQty,o=this.apiResponse.productItemizedCashBack.offer?.description,i=this.apiResponse.productItemizedCashBack.offer?.expiryDate,r=this.apiResponse.productItemizedCashBack.offer?.source,a=this.apiResponse.productItemizedCashBack.offer?.id,n=this.domainName,s=(0,O.Ek)(),c=this.apiResponse.productItemizedCashBack.offer?.cashbackProducts.find((e=>e.url===s));return U.Z.StartEdgeDriver("",JSON.stringify({action:p.v.InstantAddToCart,data:{value:e,minQty:t,description:o,expiryDate:i,source:r,id:a,domain:n,productUrl:s,quotientProductDetails:c}})),Promise.resolve(!1)}catch{return Promise.resolve(!1)}return Promise.resolve(t)}return Promise.resolve(!1)}hasHomePageSpbData(e){try{const t=e?.itemLevelCashBack?.spbHomePageOffers;if(!t)return!1;if(!t.find((e=>e.shouldAutoshow&&e.offersType===C.h.SPB&&e.offers?.length>0)))return(0,b.cA)(e.userInfo,e.impressionId,"no spb home offer to autoshow for micro notification",!1),!1;const o=w.Z.GetLocalDataService(),i=o?.GetCheckoutPageData()||e,r=i?.retailerData?.getCurrentCheckoutPage();return r?.pageType===h.GV.HomePage}catch(t){(0,b.cA)(e.userInfo,e.impressionId,"has error processing home page data for SPB",!0)}return!1}static GetSpbOffer(e){const t=(e?.value||[]).find((e=>e.position===S.zE.SPB_OFFERS));if(t&&t.offer&&t.promotionInformation)return t}logCanAutoOpenForFeature(e,t,o,i){const r={Domain:t,PageUrl:(0,O.Ek)(),Status:"",PopupOrigination:e,Metadata:i?JSON.stringify(i):void 0};N.Q.sendLogEventMessage(r,h.R.AutoOpenController,this.apiResponse.impressionId,`Can ${o?"":"not "}auto open cashback notification`,h.in.Information)}IsInstantAddToCart(){const e=this.domainName,t=c.R.isExperimentActive(s.H.instantAddToCart)||c.R.isExperimentActive(s.H.instantAddToCartExperiment),o="amazon.com"===e,i=this.hasInstantAddToCartConsent();return t&&o&&i}hasInstantAddToCartConsent(){const e=!!T.Q?.GroceryInstantAddToCart;return e&&N.Q.sendControllerStorageMessage(A.Q.GroceryInstantAddToCart,JSON.stringify({value:!1})),e}IsConfirmationPage(e){const t=w.Z.GetLocalDataService(),o=t?.GetCheckoutPageData()||e,i=o?.retailerData?.getCurrentCheckoutPage();return i?.pageType===h.GV.ConfirmationPage}ActivateQTOfferOnCartPageNotification(){this.apiResponse.personalizedAdsResponse;try{const e=w.Z.GetLocalDataService(),t=e?.GetCheckoutPageData()||this.apiResponse,o=t.retailerData.getCurrentCheckoutPage(location.pathname);if(t&&this.cartExtractionService&&o?.pageType===h.GV.CheckoutPage&&this.itemLevelCashback?.itemizedCashback&&this.itemLevelCashback?.itemizedCashback?.length>0&&this.itemLevelCashback?.domainData){const e=n.Z.Create(this.itemLevelCashback.domainData);if(t.retailerData.getCurrentCheckoutPage(location.pathname)){const t=new Map,o=new Map;this.itemLevelCashback.itemizedCashback.forEach((e=>{e.cashbackProducts.forEach((i=>{t.set(i.productId,i),o.set(i.productId,e)}))}));const i=c.R.isExperimentActive(s.H.autosJatoDeals);if(this.itemLevelCashback.activatedOffers&&!i){this.itemLevelCashback.activatedOffers.forEach((e=>{e.cashbackProducts.forEach((e=>{t.delete(e.productId)}))}));const e=(0,E.Mw)("activatedProductId");e&&t.delete(e)}const r=this.cartExtractionService.GetAvailableCartData();if(r?.Products){let i;if(r.Products.forEach((r=>{const a=this.normalizeUrl(this.domainName,r.productUrl);if(a){const r=(0,R.xJ)(a,e),n=o.get(r.productId),s=t.get(r.productId);n&&s&&(i=_.Z.CreateFromUAPI(n),i.cashbackProducts=[],i.cashbackProducts.push(I.Z.CreateFromUAPI(s)))}})),null!==i&&i){(0,E.Xo)("activatedProductId",i.cashbackProducts[0].productId),i.expAfterActivatingDate||(i.expAfterActivatingDate=(new Date).getTime()+864e5),N.Q.sendControllerStorageMessage(A.Q.CartPageCashbackNotification,JSON.stringify({value:i})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:v.c.CartPageNotification}));const e=new u.Z(h.xu.CartPageCashbackNotification);return e.Metadata=JSON.stringify({offer:i}),e.Domain=this.domainName,U.Z.SendLogEventMessage(e,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,"QT product for auto actiovation found",h.in.Information),!0}}}}}catch(e){const t=new u.Z(h.xu.CartPageCashbackNotification);t.Metadata=JSON.stringify({}),t.Domain=this.domainName,U.Z.SendLogEventMessage(t,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,e.message,h.in.Error)}return!1}shouldShowcofirmationNotification(){const e=(0,O.BQ)(T.Q.ICPendingTransaction)??{},t=this.apiResponse.retailerData?.domainName||"";return!!(e&&e[t]&&this.IsConfirmationPage(this.apiResponse))}hasActivatedQt(){const e=!!T.Q?.GroceryCashbackItem&&!!T.Q?.ICActivatedPending;if(e){const e=v.c.Activated;N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:e})),N.Q.sendControllerStorageMessage(A.Q.ICActivatedPending,JSON.stringify({value:!1}))}return e}hasDataForPdpSpb(e){try{if(!(0,b.WL)(e.productItemizedCashBack))return!1;const t=v.c.PdpSPB,o={};return o.cashbackData=this.apiResponse.productItemizedCashBack,o.currentUrl=(0,O.Ek)(),o.type=t,o.pageTitle=(0,O.AL)(),(0,b.jV)(e.productItemizedCashBack,e.userInfo,e.impressionId),N.Q.sendControllerStorageMessage(A.Q.ICCurrentPageInfo,JSON.stringify({value:JSON.stringify(o)})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:t})),!0}catch(t){(0,b.LT)(e.productItemizedCashBack,e.userInfo,e.impressionId,"has error processing pdp data for SPB",!0)}return!1}ProcessSpbCheckOutPage(e,t){try{if(t){const o=this.GetCartProductIds(t),i=this.GetRelatedCartSpbOffers(e),r=this.FilterActivatedOffers(i);return this.GetMatchedSpbOffers(o,r)}}catch(e){const t=new u.Z(h.xu.SPBCheckoutNotification);return t.Metadata=JSON.stringify({}),t.Domain=this.domainName,void U.Z.SendLogEventMessage(t,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,e.message,h.in.Error)}}GetMatchedSpbOffers(e,t){const o=[];return e.forEach((e=>{const i=t[e];i&&i.adsOffer&&i.adsOffer.promotionInformation&&o.push(i)})),o}GetCartProductIds(e){const t=[],o=e?.Products.map((e=>this.normalizeUrl(this.domainName,e.productUrl)));for(const e of o)if(e){const o=this.GetProductId(e);o&&t.push(o)}return t}GetProductId(e){if(this.itemLevelCashback?.domainData){const t=n.Z.Create(this.itemLevelCashback.domainData);if(e){const o=(0,R.xJ)(e,t);if(o)return o.productId}}}FilterSpbOffers(e,t){return e.forEach((e=>{e&&e.source&&"spb"===e.source&&t.push(e)})),t}FilterActivatedOffers(e){const t=[],o=Object.keys(e),i=this.apiResponse?.personalizedAdsResponse?.personalizedCashback,r=i||void 0;if(r?.adsCashback&&r?.adsCashback?.length>0){const e=r?.adsCashback;e.forEach((e=>{if(e&&e?.destinationUrl){const o=this.normalizeUrl(this.domainName,e?.destinationUrl);if(o){const e=this.GetProductId(o);e&&t.push(e)}}}))}const a=o.filter((e=>!t.includes(e))),n={};for(const t of a)n[t]=e[t];return n}GetRelatedCartSpbOffers(e){const t=[];e.forEach((e=>{if(e.cashbackData&&e.cashbackData.itemizedCashBackResponse&&e.cashbackData.itemizedCashBackResponse.offers){const o=e.cashbackData.itemizedCashBackResponse.offers;this.FilterSpbOffers(o,t)}}));const o={};for(const e of t)if(e.adsOffer&&e.adsOffer.destinationUrl){const t=this.GetProductId(new URL(e.adsOffer.destinationUrl));t&&(o[t]=e)}return o}normalizeUrl(e,t){return t?t.startsWith("http")?new URL(t):new URL(`https://www.${e}${t}`):null}hasDataForPdpQt(e){try{const t=e.retailerData?.domainName||"",o=e.itemLevelCashBack?.submittedOfferIds||[],i=e.itemLevelCashBack?.activatedOffers?.map((e=>e.id))||[];if(!(0,b.mg)(e.productItemizedCashBack,t,o,i))return!1;const r=v.c.PDP,a={};return a.cashbackData=e.productItemizedCashBack,a.currentUrl=(0,O.Ek)(),a.type=r,a.pageTitle=(0,O.AL)(),N.Q.sendControllerStorageMessage(A.Q.ICCurrentPageInfo,JSON.stringify({value:JSON.stringify(a)})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:r})),(0,b.iQ)(e.productItemizedCashBack,e.userInfo,e.impressionId),!0}catch(t){(0,b.LT)(e.productItemizedCashBack,e.userInfo,e.impressionId,"Error procesing PDP data for Quotient auto show",!0)}return!1}async GetSpbCartOffers(e){return new Promise((t=>{const o=this.cartExtractionService.GetAvailableCartData();if(o?.Products&&this.isCheckoutPage()&&this.isSpbCheckoutFlagActive()){const i=o?.Products.map((e=>e.productTitle));this.searchWithKeywords(i);const r=o=>{e.push(o?.detail?.jsonResponse),e.length===i.length&&t(!0)};window.addEventListener(a.fU,r),setTimeout((()=>{window.removeEventListener(a.fU,r),t(!0)}),700)}else t(!0)}))}isCheckoutPage(){const e=y.Z.CreateCheckoutPageData(this.apiResponse).retailerData.getCurrentCheckoutPage(location.pathname);return e&&e.pageType===h.GV.CheckoutPage}isSpbCheckoutFlagActive(){return"amazon.com"===this.domainName&&c.R.isExperimentActive(s.H.spbCheckoutAutoActivation)}async searchWithKeywords(e){const t=this.apiResponse.retailerData.domainName,o=r.Z.Create(this.apiResponse),i=w.Z.GetICValidatorService();await i.Init();const a={appName:f.Z.GetClientName(),buildVersion:o?.buildVersion,enabledfeatures:c.R.GetExpRawData()},n=e.map((async e=>{try{return i.SendGetCashbackMessage(t,e,P.x.Search,a)}catch(e){return null}}));return await Promise.all(n)}}t.Z=M},43263:function(e,t,o){o.d(t,{Z:function(){return R}});var i=o(72370),r=o(64865),a=o(4872),n=o(31656),s=o(79308);class c{constructor(){(0,i.Z)(this,"heading",void 0),(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"delivery",void 0),(0,i.Z)(this,"soldBy",void 0),(0,i.Z)(this,"rating",void 0),(0,i.Z)(this,"sellerUrl",void 0),(0,i.Z)(this,"index",void 0),(0,i.Z)(this,"totalPrice",void 0),(0,i.Z)(this,"currency",void 0),(0,i.Z)(this,"addedToCart",void 0)}static Create(e){const t=new c;return t.heading=e.heading,t.price=e.price,t.soldBy=e.soldBy,t.delivery=e.delivery,t.rating=e.rating,t.sellerUrl=e.sellerUrl,t.currency=e.currency,t.addedToCart=e.addedToCart,t}}var l=c,u=o(15612),d=o(5144),h=o(93190),p=o(39088),g=o(73557),C=o(29247),S=o(36493),m=o(91495),A=o(27689),P=o(90066),f=o(1094);class E{constructor(){(0,i.Z)(this,"ProductAddedNotification",void 0),(0,i.Z)(this,"Url",void 0)}static Create(e){const t=new E;return t.ProductAddedNotification=e.ProductAddedNotification,t.Url=e.Url,t}}var T=E,O=o(44922),I=o(52056),_=o(83879),v=o(86743),R=class{constructor(){(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"validatorModule",void 0),(0,i.Z)(this,"isConfirmationScenario",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"checkoutPageUrlData",void 0)}async Init(){try{if(this.localDataService=_.Z.GetLocalDataService(),this.validatorModule=_.Z.GetValidatorModule(),this.domainName=this.localDataService.GetDomainName(),this.checkoutPageUrlData=this.localDataService.GetCheckoutPageData().retailerData.getCurrentCheckoutPage(f.Z.GetCurrentPathName()),!this.checkoutPageUrlData||!this.ShouldTriggerOtherSellers(this.checkoutPageUrlData))return;this.ManageOtherSellersData(f.Z.GetCurrentPathName(),m.Q.storageObjStr,m.Q.rawStorageObj);const e=this.GetOtherSellersNotificationData(f.Z.GetCurrentPathName(),m.Q.rawStorageObj);this.isConfirmationScenario=this.ValidateOtherSellerConfirmationScenario(this.domainName,this.checkoutPageUrlData,e)}catch(e){}}GetPopupOriginationList(){return[g.sR.AUTO_SHOW_OTHER_SELLERS]}async CanAutoOpenForFeature(e){if(!this.checkoutPageUrlData||!this.ShouldTriggerOtherSellers(this.checkoutPageUrlData))return!1;if(n.R.getServiceExperimentValue(a.H.disableNotificationForSimilarSellers)||!(0,v.XB)()&&this.validatorModule.validationMsgNum>0)return this.ValidateOtherSellersScenario(this.domainName,this.checkoutPageUrlData,this.localDataService.GetMarket(),this.isConfirmationScenario),!1;this.validatorModule.SendValidationMessage(!1,O.S.CheckingOtherSellers,this.domainName);const t=await this.ValidateOtherSellersScenario(this.domainName,this.checkoutPageUrlData,this.localDataService.GetMarket(),this.isConfirmationScenario);return t&&this.validatorModule.SendValidationMessage(!1,O.S.OtherSellers,this.domainName,[h.p.OTHER_SELLERS],!1,!(0,v.XB)()),t}async PostValidation(){}ShouldTriggerOtherSellers(e){return void 0!==e.otherSellerSelectors&&this.IsVersionAllowed(p.W1,e.otherSellerSelectors.jSVersionThreshold)}isOtherSellersScenario(e){const t=e?.otherSellerSelectors?.otherSellersOverlayLinkSelector;return!(!t||(0,r.TF)(t))&&P.Z.HasVisibleElement(t)}CheckOtherSellersAutoOpen(e){const t=e.otherSellerSelectors.otherSellerLowestPriceSelector,o=P.Z.GetFirstVisibleElement(t);if(o&&o.innerText){const o=I.Z.GetOrderTotalString(e.orderTotalDataElementSelector),i=new l;if(i.price=I.Z.GetOrderTotalString(t),i.delivery="",!this.OtherSellerHasLowerPrice("amazon",o,i,""))return!1}return!0}async StoreOtherSellersInfo(e,t,o){if(!t)return null;if(!this.ValidateDataFields(e,t))return null;const i="OtherSellersData_"+f.Z.GetCurrentPathName(),r="OtherSellersIframe";try{const a=t.otherSellerSelectors.otherSellersOverlayLinkSelector,n=P.Z.GetFirstVisibleElement(a);if(n){const c=n.getAttribute("href");if(c&&e.includes("amazon")){const a=this.CreateIframe(r,c);document.body.insertBefore(a,document.body.children[0]);const n=await this.CollectOtherSellersInfo(e,t,r,o);try{this.RankOtherSellers(n)}catch(t){const o="Error while ranking other sellers. "+t,i=new s.Z;i.SetResultData(e,0,(0,S.K)(n?.productPrice??""),"",n?.currency??"$","Error"),I.Z.SendLogEventMessage(i,d.R.OtherSellers,this.validatorModule.impressionId,o,d.in.Information)}if(n&&n.otherSellers?.length>0)return I.Z.SendStorageMessage(i,JSON.stringify({value:JSON.stringify(n)})),n}else if("walmart.com"===e){const n=this.CreateIframe(r,f.Z.GetCurrentPathName());document.body.appendChild(n),await C.ZP.WaitForCondition((async()=>{const e=document.querySelectorAll("#"+r)[0],t=e?.contentDocument?.body,o=t?.querySelector(a);return void 0!==o?.innerText}),13e4);const s=document.querySelectorAll("#"+r)[0],c=s?.contentDocument?.body,l=c?.querySelector(a);l&&(l.click(),await setTimeout((()=>{l.click()}),3e3));const u=await this.CollectOtherSellersInfo(e,t,r,o);if(u&&u.otherSellers?.length>0)return I.Z.SendStorageMessage(i,JSON.stringify({value:JSON.stringify(u)})),u}}}catch(t){const o="Error while getting collecting other sellers data. "+t,i=new s.Z;i.SetResultData(e,0,0,"","","Error"),I.Z.SendLogEventMessage(i,d.R.OtherSellers,this.validatorModule.impressionId,o,d.in.Information)}return null}ResetOtherSellersNotificationFlag(){I.Z.SendStorageMessage("OtherSellersNotificationData_"+f.Z.GetCurrentPathName(),JSON.stringify({value:null}))}ValidateOtherSellerConfirmationScenario(e,t,o){return!(!this.ShouldTriggerOtherSellers(t)||!this.isOtherSellersConfirmationScenario(o)||(this.ResetOtherSellersNotificationFlag(),0))}IsVersionAllowed(e,t){if((0,r.TF)(t))return!0;try{return parseFloat(e)>=parseFloat(t)}catch(e){}return!1}isOtherSellersConfirmationScenario(e){if(e?.ProductAddedNotification){if(e?.Url===f.Z.GetCurrentPathName())return!0;this.ResetOtherSellersNotificationFlag()}return!1}ManageOtherSellersData(e,t,o){const i="OtherSellersData_"+e;!(0,r.TF)(o[i])&&I.Z.DeleteKeyFromPersistentStorage(i);const a=t.replace(/[,{]"OtherSellersData_[^\s{]*":null/g,"").replace(/[,{]"OtherSellersConfirmationData_[^\s{]*":null/g,"").match(/[,{]"OtherSellersData_[^\s{]*":|[,{]"OtherSellersConfirmationData_[^\s{]*":/g);a&&a.length>20&&this.ClearOtherSellersStorage(a,o)}ClearOtherSellersStorage(e,t){if(null!==e&&null!=t)for(const o of e){const e=o.slice(2,-2);if((0,r.TF)(t[e])){const e="Tried to delete key that doesn't exist from persistent storage",t=new s.Z;t.SetResultData((0,A.S8)(),0,0,"","","Error"),I.Z.SendLogEventMessage(t,d.R.OtherSellers,this.validatorModule.impressionId,e,d.in.Information)}else I.Z.DeleteKeyFromPersistentStorage(e)}}GetOtherSellersNotificationData(e,t){const o="OtherSellersNotificationData_"+e;return(0,r.TF)(t[o])?new T:T.Create((0,A.BQ)(t[o]))}async ValidateOtherSellersScenario(e,t,o,i){return!!this.isOtherSellersScenario(t)&&(i?(this.TryStoreOtherSellersInfo(e,t,o,!1),!1):this.ShouldAutoShowForOtherSellers(e,m.Q.OtherSellersAutoShowCount??0,m.Q.OtherSellersLastAutoShowTime)?e.includes("amazon")&&!this.CheckOtherSellersAutoOpen(t)?(this.TryStoreOtherSellersInfo(e,t,o,!1),!1):await this.TryStoreOtherSellersInfo(e,t,o,!0):(this.TryStoreOtherSellersInfo(e,t,o,!1),!1))}async TryStoreOtherSellersInfo(e,t,o,i){const r=await this.StoreOtherSellersInfo(e,t,o),a=null!==r;if(!a)return!1;let n=!0;if("amazon.com"===e&&r&&r.otherSellers?.length>0){const e=r.otherSellers[0].heading?.toLowerCase()??"";n=e.includes("new")&&!e.includes("like")}return!!(a&&n&&i)}ShouldAutoShowForOtherSellers(e,t,o){if((0,r.TF)(o)||t<2)return!0;const i=this.ParseLastAutoShowTime(e,o);return i<=0||Date.now()-i>72e5&&(I.Z.SendStorageMessage("OtherSellersAutoShowCount",JSON.stringify({value:null})),I.Z.SendStorageMessage("OtherSellersLastAutoShowTime",JSON.stringify({value:null})),!0)}ParseLastAutoShowTime(e,t){try{return Date.parse(t)}catch(t){const o="Error while parsing other sellers autoshow date. "+t,i=new s.Z;return i.SetResultData(e,0,0,"","","Error"),I.Z.SendLogEventMessage(i,d.R.OtherSellers,this.validatorModule.impressionId,o,d.in.Information),0}}OtherSellerHasLowerPrice(e,t,o,i,r,a){try{const n=(0,S.K)(t);let s=(0,S.K)(o.price);const c=this.GetDeliveryRegex(e,i,a??"");let l=0;const u=o.delivery.trim().match(c);u&&u.length>0&&(l=(0,S.K)(u[0])),l>0&&(s+=l),o.totalPrice=s;const d=n-s;if(n&&s&&d>=(r??.6)&&d/n>=.01)return!0}catch(e){}return!1}GetDeliveryRegex(e,t,o){if("walmart.com"===e)return/\$[0-9.,]+/;try{const e=(0,S.Cl)(t,o),i="^"+(0,S.So)(e)+"\\s*[0-9.,]+",r="[0-9.,]+\\s*"+(0,S.So)(e);return new RegExp(i+"|"+r)}catch(t){switch(e){case"amazon.com":return/^\$[0-9.,]+/;case"amazon.co.uk":return/^\£[0-9.,]+/;default:return/\$[0-9.,]+/}}}async CollectOtherSellersInfo(e,t,o,i){const a=new u.Z;a.otherSellers=[];const n=t.otherSellerSelectors;await C.ZP.WaitForCondition((async()=>{const e=document.querySelectorAll("#"+o)[0],t=e?.contentDocument?.body,i=t?.querySelector(n.otherSellerOfferElementSelector);return void 0!==i?.innerText}),13e4);const s=document.querySelectorAll("#"+o)[0],c=s?.contentDocument?.body,d=c?.querySelectorAll(n.otherSellerOfferElementSelector);if(!d)return a;let h=I.Z.GetOrderTotalString(t.orderTotalDataElementSelector);h?.includes("(")&&h?.includes(")")&&(h=h.slice(0,h.indexOf("("))),a.productPrice=h,a.currency=(0,S.cU)(h);let p=0;for(const t of d){if(0===p&&"walmart.com"===e){p+=1;continue}const o=new l,r=t.querySelector(n.otherSellerPriceSelector);o.price=r?.innerText??"",o.currency=(0,S.cU)(r?.innerText??"");const s=t.querySelector(n.otherSellerDeliverySelector);if(o.delivery=s?.innerText??"","walmart.com"===e){const e=r?.innerText?.split("\n");if(e&&(o.price=e[0],o.currency="$",e.length>1)){const t=e[1];!t.toLowerCase().includes("free")&&o.delivery&&(o.delivery+=t)}}if(!this.OtherSellerHasLowerPrice(e,h,o,o.currency,void 0,i))break;const c=t.querySelector(n.otherSellerHeadingSelector),u=t.querySelector(n.otherSellerNameSelector),d=t.querySelector(n.otherSellerRatingSelector),g=/a-star-mini-([0-9\-]+)/.test(d?.className)?RegExp.$1:"-1";o.heading=c?.innerText,o.soldBy=u?.innerText,o.sellerUrl=u?.getAttribute("href")??"","-1"!==g&&(o.rating=parseFloat(g.replace("-","."))),o.index=p,a.otherSellers.push(o),p+=1}const g=c?.querySelector(n.productImageSelector);return g&&!(0,r.TF)(g.src)&&(a.productImage=g.src),a.productUrl=f.Z.GetCurrentPathName(),a.dataCreationTime=Date.now(),a}ValidateDataFields(e,t){const o=t.otherSellerSelectors;if(void 0===o)return!1;const i=C.ZP.IsValidDataField(o.otherSellersOverlayLinkSelector)&&C.ZP.IsValidDataField(o.otherSellerOfferElementSelector)&&C.ZP.IsValidDataField(o.otherSellerHeadingSelector)&&C.ZP.IsValidDataField(o.otherSellerPriceSelector)&&C.ZP.IsValidDataField(o.otherSellerDeliverySelector)&&C.ZP.IsValidDataField(o.productImageSelector)&&C.ZP.IsValidDataField(o.otherSellerNameSelector)&&C.ZP.IsValidDataField(o.otherSellerAddButtonSelector)&&C.ZP.IsValidDataField(o.otherSellerAddedConfirmationSelector),r=C.ZP.IsValidDataField(o.otherSellerRatingSelector),a=C.ZP.IsValidDataField(t.errorMessageSelector);if(e.includes("amazon"))return i&&r;if("walmart.com"===e)return i&&a;{const t="Other sellers scenario for wrong domain: "+e,o=new s.Z;return o.SetResultData(e,0,0,"","","Error"),I.Z.SendLogEventMessage(o,d.R.OtherSellers,this.validatorModule.impressionId,t,d.in.Information),!1}}CreateIframe(e,t){const o=document.createElement("iframe");return o.id=e,o.src=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.border="none",o.style.visibility="hidden",o.style.left="0",o.style.top="0",o.hidden=!0,o.tabIndex=-1,o.title="empty",o.style.display="none",o}RankOtherSellers(e){const t=[],o=[];for(const i of e.otherSellers){let r=!1;if(i.heading?.toLowerCase().includes("new")){const t=i.totalPrice,o=(0,S.K)(e.productPrice);let a=1;i.heading?.toLowerCase().includes("like new")&&(a=3),o-t>=a&&(r=!0)}r?t.push(i):o.push(i)}return e.otherSellers=t.concat(o),e}}},20546:function(e,t,o){var i=o(72370),r=o(56005),a=o(3634),n=o(5144),s=o(93078),c=o(73557),l=o(55590),u=o(29247),d=o(91495),h=o(44092),p=o(91897),g=o(27689),C=o(90066),S=o(82315),m=o(23498),A=o(9839),P=o(52056),f=o(56854);t.Z=class{constructor(){(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"BestCouponConsentData",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"aaConsentData",void 0)}async Init(){this.apiResponse=S.Z.getApiResponse(),this.domainName=this.apiResponse.retailerData?.domainName??(0,g.S8)(),this.BestCouponConsentData=(0,g.BQ)(d.Q.ProductBestCouponConsent),this.apiResponse.retailerData?.aaConsentEnabled&&(this.aaConsentData=(0,g.BQ)(d.Q.rawStorageObj[r.Z.GetAAConsentStorageKey(this.domainName)]))}GetPopupOriginationList(){return[c.sR.AUTO_SHOW_PRODUCT_BEST_COUPON_CONSENT]}async CanAutoOpenForFeature(e){const t=this.apiResponse.retailerData.allProductPages;if((0,f.r)()&&t.length>0)for(let e=0;e<t.length;e++)if(this.apiResponse.retailerData.allProductPages[e].backgroundAAEnabled)return!1;return!!("true"!==(0,h.Lt)("CanOpenAAConsent")&&!this.isAutoTriggeredAAAllowed()&&this.apiResponse.productBestCoupon?.coupon||await this.searchHasBestCoupon(e))}async PostValidation(){}isAutoApplyingBestCouponAllowed(){if(!this.BestCouponConsentData||!this.BestCouponConsentData[this.domainName]?.allowed)return!1;const e=(0,p.r2)(this.BestCouponConsentData[this.domainName].timeStamp);return e>=0&&e<1||(delete this.BestCouponConsentData[this.domainName],P.Z.SendStorageMessage(l.Q.ProductBestCouponConsent,JSON.stringify({value:JSON.stringify(this.BestCouponConsentData)})),!1)}AutoApplyBestCoupon(){this.BestCouponConsentData&&this.BestCouponConsentData[this.domainName]?.productBestCoupon&&(P.Z.StartEdgeDriver("",JSON.stringify({action:s.v.ApplyProductBestCoupon,data:{productBestCoupon:this.BestCouponConsentData[this.domainName].productBestCoupon}})),m.Z.fireAffiliateUrl(this.apiResponse),delete this.BestCouponConsentData[this.domainName],P.Z.SendStorageMessage(l.Q.ProductBestCouponConsent,JSON.stringify({value:JSON.stringify(this.BestCouponConsentData)})))}isAutoTriggeredAAAllowed(){if(!this.aaConsentData?.allowed)return!1;const e=(0,p.r2)(this.aaConsentData.timeStamp);return e>=0&&e<1}async searchHasBestCoupon(e){const t=this.apiResponse.retailerData.allCheckoutPages.find((e=>e.pageType===n.GV.SearchPage)),o=t?.checkoutPageUrl,i=window.location.href.toLocaleLowerCase();let r=!1;if(o&&i&&t.productTitleSearchSelector){const e=o.split(",");for(const t of e){const e=new RegExp(t).exec(i);if(e&&e.length>0){r=!0;break}}}return t&&r&&u.ZP.WaitForCondition((async()=>C.Z.HasVisibleElement(t.productTitleSearchSelector)),1e3).then((async()=>{const o=document.querySelectorAll(t.productTitleSearchSelector);if(o?.length>0)for(let t=0;t<o.length&&t<3;t++){let i=o[t].textContent?.replace(/[\n\r]+|[\s]{2,}/g," ")?.trim()??"";const r=this.apiResponse.retailerData?.domainName??(0,g.S8)();"macys.com"===r&&i&&(i=i.replace(/[\w]+   /g,"")),await this.fetchBestCouponForProduct(i,r).then((t=>{if(void 0!==t?.coupon&&void 0!==t?.couponType){t.product=i,A.Q.sendControllerStorageMessage(l.Q.ProductBestCoupon,JSON.stringify({value:JSON.stringify(t)}));const o=new CustomEvent(a.T2,{detail:{popupOrigination:e}});return window.dispatchEvent(o),!0}}))}})),!1}async fetchBestCouponForProduct(e,t){const o={Domain:t,ProductName:e},i={headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(o)};try{const e="https://www.bing.com/api/shopping/v1/savings/cartProcessing/getProductBestCoupon",t=await fetch(e,i);return await t.json()}catch(e){}}}},73688:function(e,t,o){var i=o(72370),r=o(51329),a=o(4872),n=o(31656),s=o(93190),c=o(3634),l=o(88767),u=o(73557),d=o(55590),h=o(96658),p=o(71455),g=o(33491),C=o(27689),S=o(9448),m=o(44922),A=o(52056),P=o(83879),f=o(86743),E=o(84178);class T{constructor(){(0,i.Z)(this,"lastUrl",""),(0,i.Z)(this,"validationMessageService",new E.Z)}InvokeOEMScenario(e,t,o){let i=!1;const r=this.ExtractVehicleDetails(o?.autosDataSelector);return this.isAutosCommunityDomain(e)?!0!==this.autosCommunityDomainIgnoreVehicleDetails(e)&&null==r||this.InvokeSERPScenario(t?.retailerData?.domainName,r):!0===t?.autos?.isAutosSupportedDomain&&this.passCheckAutoShowInStorage(p.a.AutosReviewString)&&this.canOEMReviewsAutoShow(o?.autosDataSelector)&&(this.InvokeSERPScenario(t?.retailerData?.domainName,r),this.updateNotificationModuleToStorage(l.yA.REVIEW),this.sendCanOpenMessage(e),this.AddGlobalCoolDownSignal(),i=!0),i}processCashBackResponseForAutosMarketplace(e){const t={};t.autosData=e,t.currentUrl=(0,C.Ek)();const o=JSON.stringify(t),i=(0,C.S8)();if(this.validationMessageService.SendStringStorageMessage(d.Q.AutosMarketplace,o),this.updateAddressBar(),this.isLastNotificationInsideCooldownPeriod())return;const r=this.CanMyGarageAutoShow(e?.vehicleInfo);if(r&&this.CanMyGarageAutoShowFirst(e?.vehicleInfo)&&this.passCheckAutoShowInStorage(p.a.AutosMyGarageString))return this.updateNotificationModuleToStorage(l.yA.MYGARAGE),this.sendCanOpenMessage(i),void this.AddGlobalCoolDownSignal();e?.shouldAutoshow&&this.canComparableOffersAutoshow(e?.comparableOffers)&&this.passCheckAutoShowInStorage(p.a.AutosMarketplaceString)?(this.updateNotificationModuleToStorage(l.yA.LISTING),this.sendCanOpenMessage(i),this.AddGlobalCoolDownSignal()):r&&this.passCheckAutoShowInStorage(p.a.AutosMyGarageString)?(this.updateNotificationModuleToStorage(l.yA.MYGARAGE),this.sendCanOpenMessage(i),this.AddGlobalCoolDownSignal()):e?.shouldAutoshow&&this.canReviewsAutoShow(e?.ratingReview)&&this.passCheckAutoShowInStorage(p.a.AutosReviewString)&&(this.updateNotificationModuleToStorage(l.yA.REVIEW),this.sendCanOpenMessage(i),this.AddGlobalCoolDownSignal())}canComparableOffersAutoshow(e){if(e&&e?.length>0){let t=!1;return e.forEach((e=>{e&&e?.offerLevelSignals&&"true"===e?.offerLevelSignals?.autoshow&&(t=!0)})),t}return!1}canReviewsAutoShow(e){return!1}passCheckAutoShowInStorage(e,t){const o=e+t,i=(0,g.Mw)(o);if(null==i)return(0,g.Xo)(o,(new Date).toString()),!0;try{let e=216e5;const t=new Date,o=new Date(i);if(t.getTime()-o.getTime()<e)return!1}catch{}return(0,g.Xo)(o,(new Date).toString()),!0}AddGlobalCoolDownSignal(){(0,g.Xo)(p.a.AutosGlobalCoolDownString,(new Date).toString())}isLastNotificationInsideCooldownPeriod(){const e=(0,g.Mw)(p.a.AutosGlobalCoolDownString);if(null==e)return!1;try{const t=3e5,o=new Date,i=new Date(e);if(o.getTime()-i.getTime()<t)return!0}catch{return!1}return!1}updateNotificationModuleToStorage(e){this.validationMessageService.SendStringStorageMessage(d.Q.AutosMarketplaceNotification,e)}InvokeSERPScenario(e,t){if(this.lastUrl===(0,C.Ek)())return;this.lastUrl=(0,C.Ek)();const o=[];o.push({keyword:""});const i={domainName:e,queries:o,autosQuery:{url:(0,C.Ek)(),vehicleDetails:t,title:(0,C.AL)()},queryType:"search"};A.Z.SendMessage(S.H.GetCashBack,[JSON.stringify(i)])}sendCanOpenMessage(e){if((0,f.XB)()){const e=new CustomEvent(c.T2,{detail:{popupOrigination:u.sR.AUTO_SHOW_AUTOS_MARKETPLACE}});window.dispatchEvent(e)}else P.Z.GetValidatorModule().SendValidationMessage(!0,m.S.AutosMarketplace,e,[s.p.AUTOS_MARKETPLACE])}CanMyGarageAutoShow(e){if(!n.R.isExperimentActive(a.H.autosMyGarageEntryPoint)&&!n.R.isExperimentActive(a.H.autosMyGarageEntryPointV2)&&!n.R.isExperimentActive(a.H.autosMarketValueV2))return!1;const t=new r.Z(e);return t?.isValid}CanMyGarageAutoShowFirst(e){if(!n.R.isExperimentActive(a.H.autosMyGarageEntryPoint))return!1;const t=new r.Z(e);return t?.isValid}ExtractVehicleDetails(e){let t=null;try{if(void 0===e)return t;const o=JSON.parse(e),i=o?.Make||o?.ratingReview?.metaData?.make,r=o?.Model||o?.ratingReview?.metaData?.model,a=o?.Year||(new Date).getFullYear();return null===i&&null===r&&null===a?null:(t={Make:i,Model:r,Year:a},t)}catch(e){return t}}canOEMReviewsAutoShow(e){try{if(void 0===e)return!1;const t=JSON.parse(e);return t?.ratingReview?.videoReviews?.reviews?.length>0}catch(e){return!1}}isAutosCommunityDomain(e){return null!=e&&T.CommunityDomains.has(e)}autosCommunityDomainIgnoreVehicleDetails(e){return null!=e&&!0===T.CommunityDomains.get(e)}updateAddressBar(){(new E.Z).SendMessage(S.H.UpdateAddressBar,[JSON.stringify({type:h.r.AutosMarketplaceOffers})])}}(0,i.Z)(T,"CommunityDomains",new Map([["reddit.com",!1],["motortrend.com",!0]])),t.Z=T},7664:function(e,t,o){o.d(t,{X:function(){return x}});var i=o(72370),r=o(27900),a=o(5144);const n="TravelDataStorageInfo";class s{constructor(){(0,i.Z)(this,"Price",void 0),(0,i.Z)(this,"TravelDataCreationTime",void 0),(0,i.Z)(this,"CheckoutId",void 0),(0,i.Z)(this,"StartDate",void 0),(0,i.Z)(this,"EndDate",void 0),(0,i.Z)(this,"Currency",void 0),(0,i.Z)(this,"Name",void 0),(0,i.Z)(this,"DomainType",void 0),(0,i.Z)(this,"flightLegs",void 0),(0,i.Z)(this,"isRoundTrip",void 0),(0,i.Z)(this,"PageUrl",void 0)}}var c=o(33491),l=o(29247),u=o(43686),d=o(18435),h=o(84830),p=o(71544),g=o(4872);class C{constructor(){(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"startDate",void 0),(0,i.Z)(this,"endDate",void 0)}static Create(e){const t=new C;return t.name=e.name,t.startDate=e.startDate,t.endDate=e.endDate,t}}var S=C,m=o(39088),A=o(82960),P=o(3634),f=o(90066),E=o(55590),T=o(36493),O=o(14440);class I{}(0,i.Z)(I,"ProductIdsGetter",{"amazon.com":e=>{const t=document.querySelectorAll(e);if(t){let e="";return t.forEach((t=>{const o=t.defaultValue.split("|")[0];e+=o+I.sep})),e}return null},"walmart.com":e=>{const t=document.querySelector(e);if(t){const e=t?.src,o=/item_ids=([^&]*)/,i=e?.match(o);let r="";return i&&i.length>=2&&i[1].split("%2C").forEach((e=>{r+=e+I.sep})),r}return null},"jcpenney.com":e=>{const t=document.querySelectorAll(e);if(t){let e="";return t.forEach((t=>{const o=t.dataset.ppid;e+=o+I.sep})),e}return null}}),(0,i.Z)(I,"sep","<SEP>");var _=I;class v{constructor(){(0,i.Z)(this,"checkoutUrl",void 0),(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"domainType",void 0),(0,i.Z)(this,"checkoutId",void 0),(0,i.Z)(this,"startDate",void 0),(0,i.Z)(this,"endDate",void 0),(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"currency",void 0),(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"flightLegs",void 0),(0,i.Z)(this,"isRoundTrip",void 0)}static Create(e){const t=new v;return t.domain=e.domain,t.price=e.price,t.currency=e.currency,t.checkoutUrl=e.checkoutUrl,t.domainType=e.domainType,t.startDate=e.startDate,t.endDate=e.endDate,e.flightLegs?.forEach((e=>{t.flightLegs.push(S.Create(e))})),t}}var R=v,D=o(27689),N=o(11849),y=o(52056),b=o(83879),k=o(93970),U=o(31656),w=o(64865),L=o(91495),M=o(57459);function Z(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function B(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Z(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}class F{constructor(){(0,i.Z)(this,"cartExtractionSuccessful",void 0),(0,i.Z)(this,"mutationObserver",void 0),(0,i.Z)(this,"isPersonalizationDataConsentEnabled",void 0),(0,i.Z)(this,"onCartExtractionCallback",void 0)}subscribe(e){this.onCartExtractionCallback=e}async Init(){const e=b.Z.GetLocalDataService(),t=e.GetCheckoutPageData();if(this.isPersonalizationDataConsentEnabled=t.userInfo?.isPersonalizationDataConsentEnabled??e.IsP13nEnabled()??!1,!t.retailerData)return;this.logInfo("Starting cart collection",t.retailerData.domainName??"","","");const o=e.GetIsFinalCheckoutPage(),i=(0,D.uf)(t?.market,t.retailerData?.exclusiveMarket),r=e.GetImpressionId(),n=e.GetDomainName(),s=t?.retailerData?.cartMonitorUrl,c=t.retailerData.getCurrentFinalCheckoutPage(),l=t?.retailerData?.storeCartInEdgeStorage||!1,u=e.GetIsAOCActive(),d=t.retailerData.getCurrentAutomatedSelectorsPage(location.href);if(o){const e=A.Z.uuidv4();this.logInfo("Attempting cart extraction from final checkout page",n,r,e),this.TryCheckAndCollectCartInformation(n,r,c,i,u,d,!1,t.isCashbackEstimationSupportedForDomain,l,s,void 0,e)}const h=this.ShouldAddCartButtonListener(t.retailerData.getCurrentCheckoutPage(),n);if(h.shouldAddListener&&h.cartButtonSelector){const e=A.Z.uuidv4();this.AddCartButtonListener(h.cartButtonSelector,location.pathname,t,n,r,i,t,l,s,u,d,e)}const p=t.retailerData?.getCurrentCheckoutPage(location.pathname);if(!p)return;const g=p.pageType??a.GV.CheckoutPage;if(g===a.GV.CheckoutPage||o){const e=this.dateToString(new Date);y.Z.SendStorageMessage(E.Q.CheckoutPageNavigatedTime,JSON.stringify({value:e}))}if(g===a.GV.CheckoutPage)if(o){const e=A.Z.uuidv4();this.TryShouldAttemptCartCollectionAgain(n,r,p,i,u,d,p?.automatedCartExtractionEnabled,t.isCashbackEstimationSupportedForDomain,l,void 0,e)}else{const e=A.Z.uuidv4();this.logInfo("Attempting cart extraction from not final checkout page",n,r,e),this.TryCheckAndCollectCartInformation(n,r,p,i,u,d,p?.automatedCartExtractionEnabled,t.isCashbackEstimationSupportedForDomain,l,s,void 0,e)}if(g===a.GV.ProductPage){const e=A.Z.uuidv4();this.logInfo("Attempting cart extraction from product page",n,r,e),this.CollectCartInfoFromProductPage(n,t,r,i,u,d,l,s,e)}}async PostValidation(){}dateToString(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}async TryShouldAttemptCartCollectionAgain(e,t,o,i,r,n,s,c,l,u,d){this.ShouldAttemptCartCollectionAgain(o,s).then((a=>{a&&this.TryCheckAndCollectCartInformation(e,t,o,i,r,n,s,c,l,u,void 0,d)})).catch((o=>{const i={domain:e,cartUrl:location.pathname};this.LogCartExtractionEvent(i,a.R.CartExtractionError,o?.message,a.in.Error,t,d)}))}async ShouldAttemptCartCollectionAgain(e,t){return e&&(e?.cartSelectors||!0===t||e?.travelCheckoutSelectors)?(await l.ZP.WaitForCondition((async()=>void 0!==this.cartExtractionSuccessful),3e4),!0!==this.cartExtractionSuccessful):(this.notifyCartDataListeners(),!1)}async TryCheckAndCollectCartInformation(e,t,o,i,r,n,s,c,l,u,d,h){o?.travelCheckoutSelectors&&this.CheckAndCollectTravelCheckoutInformation(e,t,o.travelCheckoutSelectors,i,l).catch((o=>{const i={domain:e,cartUrl:location.pathname,isTravel:!0};this.LogCartExtractionEvent(i,a.R.CartExtractionError,o?.message,a.in.Error,t,h)})),this.CheckAndCollectCartInformation(e,t,o,i,r,n,s,c,l,u,d,o?.getProductNamesFromImg,h).catch((o=>{const i={domain:e,cartUrl:location.pathname};this.LogCartExtractionEvent(i,a.R.CartExtractionError,o?.message,a.in.Error,t,h)}))}GetLastTravelData(){const e=(0,c.Mw)(n);return e&&!(0,w.TF)(e)?JSON.parse(e):null}async WaitForBlockedCouponsThenGetCartData(){return await l.ZP.WaitForCondition((async()=>!0!==this.GetBlockedCouponsRequestPending()),1e4,1e3),this.GetLastCartData()}async WaitForCartExtractionAndBlockedCouponsThenGetCartData(){return await l.ZP.WaitForCondition((async()=>!this.GetBlockedCouponsRequestPending()&&void 0!==this.cartExtractionSuccessful),1e4,1e3),this.GetLastCartData()}GetLastCartExtractionId(){const e=this.GetLastCartData();if(e&&e?.ExtractionId?.length>0)return e.ExtractionId}GetLastCartData(){const e=(0,c.Mw)(r.OY);return e&&!(0,w.TF)(e)?JSON.parse(e):null}GetFastCart(){try{const e=(0,c.Mw)(r.hm);if(e&&!(0,w.TF)(e))return JSON.parse(e)}catch(e){}return null}GetAvailableCartData(){const e=this.GetLastCartData(),t=(0,c.Mw)(r.hm);let o=null;t&&!(0,w.TF)(t)&&(o=JSON.parse(t));const i=o?.CartDataCreationTime??0;return e?.CartDataCreationTime&&e?.CartDataCreationTime>i?e:o}async CheckAndCollectCartInformation(e,t,o,i,r,n,s,c,u,d,h,p,g){if(!o||!o?.cartSelectors&&!0!==s&&!n?.details?.productName){this.cartExtractionSuccessful=!1;const o="Unable to get cart data: No Selectors",i={cartId:"",cartUrl:location.pathname,domain:e};return"rei.com"===e&&(i.cartUrl=location.pathname+location.hash),void this.LogCartExtractionEvent(i,a.R.CartExtractionError,o,a.in.Error,t,g)}const C=o?.pageType===a.GV.ProductPage,S=this.GetLastCartData(),m=performance.now(),A=o.orderTotalDataElementSelector;let P={OrderTotal:-1,Currency:(0,T.N6)(i)??"",PageCurrency:""};l.ZP.IsValidDataField(A)&&(P=await l.ZP.WaitForCondition((async()=>f.Z.RunQuerySelectorAll(A)?.length>0),5e3).then((async()=>await N.Z.WaitAndGetCartValue(A,i))).catch((o=>{const i={cartId:S?.CartId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(i,a.R.CartExtractionError,o?.message,a.in.Error,t,g),P}))),P.OrderTotal>0||(P=await N.Z.WaitAndGetCartValue2(A,i));const E=performance.now(),O=this.GetTimeDiff(m,E);this.logInfo(`Cart value extracted. timeToExtract: ${O} ms, extracted total: ${P?.OrderTotal}`,e,t,g);try{const a=new URL(window.location.href);d&&this.MonitorCart(e,t,a,o,i,r,n,s,c,u,d,g)}catch(o){const i={cartId:S?.CartId??"",cartUrl:location.pathname,domain:e};this.LogCartExtractionEvent(i,a.R.CartExtractionError,"error adding cart monitor: "+o?.message,a.in.Error,t,g)}if(S&&!this.ShouldCollectStorageData(P,S))return this.notifyCartDataListeners(),void this.logInfo("Stopping cart extraction: cart hasn't changed",e,t,g);if(!o?.cartSelectors&&!n?.details?.productName)return this.logInfo("Extracting cart from automatedSelectorsData",e,t,g),void b.Z.GetAutomaticCartExtractionService().TryCollectCartInformation(e,P,i,t,k.ZP.traceId,r,S?.CartId);const I=o.cartSelectors;try{await this.CollectCartInformation(e,P,I,t,o,r,i,n,S?.CartId,u,C,h,p,g)}catch(o){const i={cartId:S?.CartId??"",cartUrl:location.pathname,domain:e};"rei.com"===e&&(i.cartUrl=location.pathname+location.hash),this.LogCartExtractionEvent(i,a.R.CartExtractionError,o?.message,a.in.Error,t,g)}const _=performance.now(),v=this.GetTimeDiff(m,_);this.logInfo(`Cart extraction finished. Total time: ${v} ms`,e,t,g)}async TryCheckAndCollectTravelCheckoutInformation(e,t,o,i){this.CheckAndCollectTravelCheckoutInformation(e,t,o,i).catch((e=>{}))}async CheckAndCollectTravelCheckoutInformation(e,t,o,i,r){if(!o)return;const n=this.GetLastTravelData(),s=o.priceSelector;let c={OrderTotal:-1,Currency:"$",PageCurrency:""};if(l.ZP.IsValidDataField(s)&&(c=await l.ZP.WaitForCondition((async()=>f.Z.RunQuerySelectorAll(s)?.length>0),5e3).then((async()=>await N.Z.WaitAndGetCartValue2(s,i))).catch((o=>{const i={cartId:n?.CheckoutId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(i,a.R.CartExtractionError,o?.message,a.in.Error,t),c}))),!n||this.ShouldCollectTravelStorageData(c,n))try{await this.CollectTravelCheckoutInformation(e,t,o,n?.CheckoutId,r)}catch(o){const i={cartId:n?.CheckoutId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(i,a.R.CartExtractionError,o?.message,a.in.Error,t),c}}ShouldCollectTravelStorageData(e,t){return!(t&&t.Price===e.OrderTotal&&-1!==e.OrderTotal&&!(0,w.TF)(t.CheckoutId)&&Date.now()-t.TravelDataCreationTime<=432e5)}async CollectTravelCheckoutInformation(e,t,o,i,r){const u=new R;let d;if(u.domain=e,u.domainType=o.domainType,u.checkoutId=i??A.Z.uuidv4(),u.checkoutUrl=location.pathname,await l.ZP.WaitForCondition((async()=>(d=f.Z.GetFirstVisibleElement(o.startDateSelector),void 0!==d)),5e3),void 0===d)return;u.flightLegs=[];const h=f.Z.GetAllVisibleElements(o.startDateSelector),p=f.Z.GetAllVisibleElements(o.endDateSelector),g=f.Z.GetAllVisibleElements(o.nameSelector);if(h.length>1)for(let e=0;e<h.length;e++){const t=new S;t.startDate=h[e].innerText?.trim()??"",e<p.length&&(t.endDate=p[e].innerText?.trim()??""),e<g.length&&(t.name=g[e].innerText?.trim()??""),u.flightLegs.push(t)}u.startDate=d?.innerText?.trim();const C=f.Z.GetFirstVisibleElement(o.endDateSelector),m=f.Z.GetFirstVisibleElement(o.nameSelector);u.endDate=C?.innerText?.trim()??"",u.name=m?.innerText?.trim()??"";const P=y.Z.GetOrderTotalString(o.priceSelector),E=(0,T.cU)(P),O=(0,T.K)(P);u.price=O,u.currency=E,this.LogCartExtractionEvent(u,a.R.TravelCheckoutExtraction,"Successfully extracted Travel Checkout Information",a.in.Information,t);const I=new s;I.Price=u.price,I.CheckoutId=u.checkoutId,I.StartDate=u.startDate,I.EndDate=u.endDate,I.Name=u.name,I.DomainType=u.domainType,I.Currency=u.currency,I.TravelDataCreationTime=Date.now(),I.PageUrl=location.pathname,(0,c.Xo)(n,JSON.stringify(I)),r&&this.SendPersistentTravelCheckoutMessage(e,I,t)}async MonitorCart(e,t,o,i,r,a,n,s,c,u,d,h){if(d===o.pathname||c){const s={attributes:!0,characterData:!0,childList:!0,subtree:!0};this.mutationObserver||(this.mutationObserver=new MutationObserver((async o=>{this.CheckAndCollectCartInformation(e,t,i,r,a,n,i?.automatedCartExtractionEnabled,c,u,d,void 0,i?.getProductNamesFromImg,h),window.dispatchEvent(new Event("CartUpdate"))})));const p=i?.orderTotalDataElementSelector,g=i?.orderTotalDataContainerElementSelector;if(p){await l.ZP.WaitForCondition((async()=>{const e=f.Z.GetFirstVisibleElement(p);return void 0!==e?.innerText}),5e3);const e=f.Z.GetFirstVisibleElement(p);if(e&&(this.mutationObserver?.disconnect(),this.mutationObserver?.observe(e,s),g)){const e=f.Z.GetFirstVisibleElement(g);e&&this.mutationObserver?.observe(e,s)}}if("kohls.com"===e&&"/checkout/shopping_cart.jsp"===o.pathname){const e="shoppingBagHook",t=document.getElementById(e);t&&this.mutationObserver?.observe(t,s)}else if("bedbathandbeyond.com"===e&&"/store/checkout"===o.pathname){const e="ul[class*='ProgressBar']",t=f.Z.GetFirstVisibleElement(e);t&&(this.mutationObserver?.disconnect(),this.mutationObserver?.observe(t,s))}else if("macys.com"===e&&o.pathname===d){const e="bag-summary",t=document.getElementById(e);t&&this.mutationObserver?.observe(t,s)}else if("rei.com"===e&&o.pathname===d){const e=f.Z.GetFirstVisibleElement("section-navigation");e&&this.mutationObserver?.observe(e,s)}}else this.mutationObserver?.disconnect()}ShouldCollectStorageData(e,t){return!(t&&t.OrderTotal===e.OrderTotal&&-1!==e.OrderTotal&&!(0,w.TF)(t.CartId)&&Date.now()-t.CartDataCreationTime<=r.l$)||(this.cartExtractionSuccessful=!0,!1)}async GetProductNamesDirectly(e,t,o,i,r,n,s,c,u,d,h){let p;if(await l.ZP.WaitForCondition((async()=>(p=this.QueryAllWithAutomatedFallback(document,o?.productTitleSelector,s?.details?.productName,t,i,!1),void 0!==p&&p.length>0)),5e3),p=this.QueryAllWithAutomatedFallback(document,o?.productTitleSelector,s?.details?.productName,t,i,!0),!(p&&p.length>0)){const t="No cart selector provided, unable to find products with product title selector.";return void this.LogCartExtractionEvent(e,a.R.CartExtractionError,t,a.in.Error,i,h)}for(const t of p){const o=new O.Z;o.productTitle=t?.textContent?.trim()??"",e.products.push(o)}const C=U.R.isExperimentActive(g.H.improvedCartModelCouponHandling);C&&this.SetBlockedCouponsRequestPending(!0),this.logInfo("Log cart from product names directly",t,i,h),this.LogCartInfo(e,t,i,r,n,c,u,d,void 0,h),C&&this.CheckAndSendCartProcessingRequest(r,e,t).then((()=>this.SetBlockedCouponsRequestPending(!1))).catch((e=>{this.SetBlockedCouponsRequestPending(!1)}))}QueryWithAutomatedFallback(e,t,o,i,r){const a=this.QueryAllWithAutomatedFallback(e,t,o,i,r,e===document);return a&&a.length>0?a[0]:void 0}QueryAllWithAutomatedFallback(e,t,o,i,r,n,s){const c=t?e.querySelectorAll(t):void 0,l=o?e.querySelectorAll(o):void 0;if(n&&t&&o){const e={Domain:i,PageUrl:location.href,ManualSelector:t,AutomatedSelector:o,ManualMatchCount:c?.length??0,AutomatedMatchCount:l?.length??0},n="QueryAll with automated fallback";this.LogCartExtractionEvent(e,a.R.AutomatedSelectorsDiagnostic,n,a.in.Information,r,s,!0)}return c??l}isEmptyCart(e){try{const t=document?.body?.innerText?.toLocaleLowerCase()??"",o="",i=e?.emptyCartText?.toLocaleLowerCase()??"";if(o&&t.includes(o))return!0;if(!(0,w.TF)(i)&&t.includes(i))return!0}catch(e){}return!1}async CollectCartInformation(e,t,o,i,r,n,s,c,d,h,p,C,S,m){const P=new u.Z;P.domain=e,P.cartValue=t.OrderTotal,P.currency=t.Currency,P.cartUrl=location.pathname,P.cartId=d??A.Z.uuidv4(),P.products=[],"rei.com"===e&&(P.cartUrl=location.pathname+location.hash),!o||"amazon.com"!==e&&"walmart.com"!==e&&"jcpenney.com"!==e||(P.productIds=_.ProductIdsGetter[e](o.productIdSkuSelector));const E=U.R.isExperimentActive(g.H.cartExtractionFromBody);if(!(o?.cartSelector||(0,w.TF)(o?.productTitleSelector??"")&&(0,w.TF)(c?.details?.productName??""))){const t="no cart selector provided but has product title selector.";return P.cartUrl=location.pathname,this.LogCartExtractionEvent(P,a.R.CartExtractionError,t,a.in.Error,i,m),this.GetProductNamesDirectly(P,e,o,i,r,s,c,h,p,C,m),void this.notifyCartDataListeners()}if(!o||!o.cartSelector||!o.productSelector){const e="Unable to find cart, no cartSelector and no title/name selector provided.";return P.cartUrl=location.pathname,void this.LogCartExtractionEvent(P,a.R.CartExtractionError,e,a.in.Error,i,m)}const T=performance.now();let I;await l.ZP.WaitForCondition((async()=>(I=f.Z.GetFirstVisibleElement(o.cartSelector),void 0!==I)),5e3);const v=performance.now();let R;if(this.GetTimeDiff(T,v),void 0===I){if(this.isEmptyCart(o))return void this.handleSuccessfulCartExtraction(P,e,i,r,n,s,h,p,C,!0);if(!E){const e="Unable to find cart";return void this.LogCartExtractionEvent(P,a.R.CartExtractionError,e,a.in.Error,i,m)}{const e="Unable to find cart, using document body as fallback";this.LogCartExtractionEvent(P,a.R.CartExtractionError,e,a.in.Error,i,m),I=document.body}}if(await l.ZP.WaitForCondition((async()=>(R=I?.querySelectorAll(o.productSelector),void 0!==R&&R.length>0)),"bedbathandbeyond.com"===e?1e4:5e3),"bedbathandbeyond.com"===e||"target.com"===e||"cvs.com"===e){let e;await l.ZP.WaitForCondition((async()=>(e=I?.querySelectorAll(o.productTitleSelector),void 0!==e&&e.length>0&&e.length===R?.length)),1e4),R=I?.querySelectorAll(o.productSelector)}if("walmart.com"===e){const e=this.CollectProductInformationFromCollapsedCart(r,I);P.products.push(...e)}const D=this.GetLastCartData(),N=void 0!==D?.Products?.find((e=>!e.productTitle||""===e.productTitle));if("walmart.com"===e&&(void 0===R||R.length<=0)&&(null==D||null!=D&&N)){const e=I?.querySelectorAll(o.productImageSelector);if(void 0!==e&&e.length>0)for(const t of e){const e=t.getAttribute("alt");if(e){const o=new O.Z;o.productTitle=e.trim(),o.productImg=t?.src??"",P.products.push(o)}}else if(P.products.length<=0){const e="Unable to find products in cart by product image";return void this.LogCartExtractionEvent(P,a.R.CartExtractionError,e,a.in.Error,i,m)}}else if((void 0===R||R.length<=0)&&P.products.length<=0){const t="Unable to find products in cart";return this.LogCartExtractionEvent(P,a.R.CartExtractionError,t,a.in.Error,i,m),void(!E||(0,w.TF)(o?.productTitleSelector??"")&&(0,w.TF)(c?.details?.productName??"")||this.GetProductNamesDirectly(P,e,o,i,r,s,c,h,p,C,m))}if(R&&R.length>0)for(const t of R){const n=await this.CollectProductInfo(t,o,c,e,i,S,r.priceDivideByQuantity);if(null!=n)p&&!C&&(n.buyNowItem=!0),P.products.push(n);else{const e="Could not extract product info";this.LogCartExtractionEvent(P,a.R.CartExtractionError,e,a.in.Error,i,m)}}if(this.IsNewCart(P,D))this.handleSuccessfulCartExtraction(P,e,i,r,n,s,h,p,C,!1,m);else{const e="Unneccessary Cart Extraction: Cart is the same as the last cart, not collecting again";this.LogCartExtractionEvent(P,a.R.CartExtractionError,e,a.in.Error,i,m)}}async handleSuccessfulCartExtraction(e,t,o,i,r,a,n,s,c,l,u){this.saveNonAugmentedCart(e);const d=performance.now();try{const o=b.Z.GetAutomaticCartExtractionService();await o.augmentWithWebAssist(e.products,t,k.ZP.traceId,r)}catch(e){this.logInfo("Error augmenting cart with WebAssist",t,o,u)}const h=performance.now(),p=`Time to augment with WebAssist:, ${this.GetTimeDiff(d,h)} ms`;this.SetBlockedCouponsRequestPending(!0),this.logInfo(`Log cart from handleSuccessfulCartExtraction. ${p}`,t,o,u),this.LogCartInfo(e,t,o,i,a,n,s,c,l),this.CheckAndSendCartProcessingRequest(i,e,t).then((()=>this.SetBlockedCouponsRequestPending(!1))).catch((e=>{this.SetBlockedCouponsRequestPending(!1)}))}async saveNonAugmentedCart(e){const t=new r.Vr;t.OrderTotal=e.cartValue,t.CartDataCreationTime=Date.now(),t.CartId=e.cartId,t.ProductIds=e.productIds,t.Products=e.products,(0,c.Xo)(r.hm,JSON.stringify(t)),this.notifyCartDataListeners()}async CheckAndSendCartProcessingRequest(e,t,o){const i=e?.pageType??a.GV.CheckoutPage;if("amazon.com"!==o&&i===a.GV.CheckoutPage&&t.products.length>0){const e=await this.SendBlockedCouponsRequest(b.Z.GetLocalDataService().GetMuid(),o,t);this.ProcessBlockedCoupons(e)}}async SendBlockedCouponsRequest(e,t,o){if(e&&e.length>0&&t&&t.length>0)try{const i=b.Z.GetLocalDataService(),r=new h.Z(p.Z.GetClientName(),m.Kr,void 0,p.Z.enabledServiceFlights,U.R.GetServiceExperiments()),a=this.GetCartModelRequestCoupons(),n={muid:e,domain:t,clientContext:r,cartExtractionId:this.GetLastCartExtractionId(),impressionId:i.GetImpressionId(),coupons:a},s=o.products.filter((e=>e.productTitle&&e.productTitle.length>0)).map((e=>e.productTitle));n.productNames=s.slice(0,10);const c=b.Z.GetClientRequestsService(),l=(await c.SendRequest("cartProcessing","getBlockedCoupons",n)).couponCodes;return{OriginalCoupons:a?.map((e=>e.couponCode))??null,BlockedCoupons:l??null}}catch(e){}return{OriginalCoupons:[],BlockedCoupons:[]}}GetCartModelRequestCoupons(){const e=b.Z.GetLocalDataService();if(U.R.isExperimentActive(g.H.sendCouponsToCartModel))try{const t=b.Z.GetSuggestedCouponService().GetSuggestedCoupons();return M.Z.GetCartModelRequestCoupons(e.GetCoupons()??[],t).map((e=>({couponCode:e.couponCode,couponTitle:e.title})))}catch(e){}}ProcessBlockedCoupons(e){const t=this.GetLastCartData();t&&(t.BlockedCouponsData=e,(0,c.Xo)(r.OY,JSON.stringify(t)))}SetBlockedCouponsRequestPending(e){(0,c.Xo)("blockedCouponsRequestPending",e.toString())}GetBlockedCouponsRequestPending(){return"true"===(0,c.Mw)("blockedCouponsRequestPending")}CartProductNameResolution(e,t,o){try{let i=!1;for(const e of t.products)if(void 0===e.productTitle||""===e.productTitle){i=!0;break}if(!i)return{cartInfo:t,message:"products from current cart used"};if(o?.Products){i=!1;for(const e of o.Products)if(void 0===e.productTitle||""===e.productTitle){i=!0;break}if(!i)return t.products=o.Products,{cartInfo:t,message:"products from last cached cart used"}}const r=L.Q?.PersistentCartData,a=((0,D.BQ)(r)??{})[e]??{},n=a?.cartDataStorageInfo??{};if(n?.Products){i=!1;for(const e of n.Products)if(void 0===e.productTitle||""===e.productTitle){i=!0;break}if(!i)return t.products=n.Products,{cartInfo:t,message:"products from persistent cart used"}}for(const e of t.products)if(void 0===e.productTitle||""===e.productTitle){let t=this.FindProductByUrl(e.productUrl,e.productImg,o);null==t&&(t=this.FindProductByUrl(e.productUrl,e.productImg,n)),t&&(e.productTitle=t.productTitle,void 0===e.productQuantity&&(e.productQuantity=t.productQuantity))}}catch(e){return{cartInfo:t,message:"error getting products from cache or persistent cart: "+e}}return{cartInfo:t,message:"could not get products from cache or persistent cart"}}FindProductByUrl(e,t,o){if(!o?.Products)return null;for(const i of o.Products)if((i.productUrl===e||i.productImg===t)&&i.productTitle&&""!==i.productTitle)return i;return null}CollectProductInfo(e,t,o,i,a,n,s){const u=this.QueryWithAutomatedFallback(e,t.productTitleSelector,o?.details?.productName,i,a),h=e.querySelector(t.productUrlSelector),p=e.querySelector(t.productImageSelector),g=e.querySelector(t.productSellerSelector);let C=u?.innerText?.trim()||u?.textContent?.trim()||"";const S=y.Z.GetOrderTotalString(t.productPriceSelector,e),m=(0,T.K)(S)??-1,A=d.Z.getQuantity(t.productQuantitySelector,e);let P=g?.innerText?.trim()||g?.textContent?.trim()||"";const f=p?.src??"",E=h?.getAttribute("href")??"";if(P&&l.ZP.IsValidDataField(t.productSellerRegex)&&(P=P.replace(t.productSellerRegex,"")),("walmart.com"===i||"target.com"===i||"jcpenney.com"===i||n)&&(0,w.TF)(C)){const e=p?.getAttribute("alt");e&&(C=e.trim())}if((0,w.TF)(C)&&(0,w.TF)(E)&&(0,w.TF)(f))return null;let I="";try{let e=JSON.parse((0,c.Mw)(r.D8)||"[]");for(const t of e)if(C.includes(t?.ProductName)){I=t?.ProductBrandName??"";break}}catch(e){}const _=new O.Z;return _.productTitle=C,_.productBrand=I,_.productPrice=m,_.productUrl=E,_.productImg=f,_.productQuantity=A,_.productSeller=P,s&&A>1&&(_.productPrice=Number((m/A).toFixed(2))),_}IsNewCart(e,t){if(null==e?.products||0===e.products.length)return!1;if(null==t?.Products||0===t.Products.length)return!0;if(e.products.length!==t.Products.length)return!0;let o=!0,i=!1;for(let r=0;r<e.products.length;r++){const a=e.products[r];if(-1===t.Products.findIndex((e=>e.productTitle===a.productTitle)))return!0;o=o&&Boolean(a.productUrl),i=i||Boolean(a.productSeller)}let r=!0,a=!0;t.Products.forEach((e=>{r=r&&Boolean(e.productUrl),a=a&&Boolean(e.productSeller)}));const n=i&&!a,s=o&&!r;return!(!U.R.isExperimentActive(g.H.fixCartUpdate)||!n)||s}LogCartInfo(e,t,o,i,n,s,l,u,d,h){let p={OrderTotal:-1,Currency:(0,T.N6)(n)??"",PageCurrency:""};p=N.Z.GetCartValue(i.orderTotalDataElementSelector,n),p.OrderTotal>0||(p=N.Z.TrySimpleGetCartValue(i.orderTotalDataElementSelector,n)),e.cartValue=p.OrderTotal,e.currency=p.Currency;const C=this.GetLastCartData(),S=U.R.isExperimentActive(g.H.fixCartUpdate);if((0,w.TF)(i.orderSubTotalElementSelector)||(e.subTotal=y.Z.GetOrderTotalString(i.orderSubTotalElementSelector)),d||e.products?.length>0){const n=performance.now();let p=d?"Empty Cart Extraction":"Successfully extracted Cart Information",g={cartInfo:e,message:""},m=!1;("walmart.com"===t&&"/checkout/review-order"===e.cartUrl||"kohls.com"===t&&"/checkout/shopping_cart.jsp"!==e.cartUrl)&&(g=this.CartProductNameResolution(t,e,C),p+="; "+g.message+"; "+JSON.stringify(g.cartInfo),m=!0);const f=A.Z.uuidv4();if(this.LogCartExtractionEvent(e,a.R.CartExtraction,p,a.in.Information,o,`${f}_${h}`),S&&!this.IsNewCart(e,C))return void this.logInfo("No cart log. fixCartUpdate and not new cart",t,o,h);y.Z.SendStorageMessage(E.Q.DynamicTransactionId,JSON.stringify({value:f}));const O=new r.Vr;if(O.OrderTotal=e.cartValue,O.CartDataCreationTime=Date.now(),O.CartId=e.cartId,O.ProductIds=e.productIds,O.Products=m?g.cartInfo.products:e.products,O.Currency=e.currency??"",e.subTotal&&(O.OrderSubTotal=(0,T.K)(e.subTotal)??-1),(0,c.NN)()||this.LogCartExtractionEvent(e,a.R.CartExtractionError,"No access to local storage",a.in.Error,o,h),l&&void 0!==C?.Products){const t=e.products[0],o=location.pathname;if(!(0,w.TF)(t.productTitle)){let e=!1;for(const i of C.Products)if(i.productQuantity>0&&(0===i.productUrl.indexOf(o)||i.productTitle===t.productTitle)){t.productQuantity&&!isNaN(t.productQuantity)?i.productQuantity=i.productQuantity+t.productQuantity:i.productQuantity=i.productQuantity+1,i.buyNowItem=!u,e=!0;break}if(!e){const e=C.Products;t.buyNowItem=!u,e.push(t),O.Products=e}}}const I=this.CollectGroceryInfo(i);O.CartPreTax=I.preTaxTotal,O.CartEstimatedTax=I.estimatedTax,O.ShipmentDate=I.shipmentDate,O.ExtractionId=f;const _=performance.now();this.logInfo(`Writing to local storage, timeTook:  ${this.GetTimeDiff(n,_)}`,t,o,h),(0,c.Xo)(r.OY,JSON.stringify(O)),(0,c.TJ)(r.hm);const v=P.PK[t]?.useCartAtPathname;v&&location.pathname.toLocaleLowerCase().includes(v)&&y.Z.SendStorageMessage(E.Q.PostPurchasePathnameProducts,JSON.stringify({value:O.Products})),s&&this.SendPersistentCartMessage(t,O,o,h)}else{const t="Unable to get enough info about products in cart";this.LogCartExtractionEvent(e,a.R.CartExtractionError,t,a.in.Error,o,h)}}CollectGroceryInfo(e){const t=e.shipmentSelector,o=e.preTaxSelector,i=e.estimatedTaxSelector;let r,a,n;if(l.ZP.IsValidDataField(t)&&l.ZP.IsValidDataField(o)&&l.ZP.IsValidDataField(i))try{r=this.GetShipmentDate(t);const e=y.Z.GetOrderTotalString(o);a=(0,T.K)(e)??-1;const s=y.Z.GetOrderTotalString(i);n=(0,T.K)(s)??-1}catch(e){}return{shipmentDate:r,preTaxTotal:a,estimatedTax:n}}GetShipmentDate(e,t){const o=e.split(","),i=y.Z.GetOrderTotalString(o[0]);if(i)try{const e=y.Z.parseDate(i);return"Invalid Date"===e.toString()?"":e}catch(e){}else if(4===o.length){const e=y.Z.GetOrderTotalString(o[1])?.trim(),t=y.Z.GetOrderTotalString(o[2])?.trim(),i=y.Z.GetOrderTotalString(o[3])?.trim();return new Date(`${e} ${t} ${i}`)}return""}SendPersistentCartMessage(e,t,o,i){try{const o=L.Q?.PersistentCartData??"",i=(0,D.BQ)(o)??{};i[e]={cartDataStorageInfo:t,timestamp:new Date};const r=JSON.stringify({value:JSON.stringify(i)});y.Z.SendStorageMessage("PersistentCartData",r)}catch(e){this.LogCartExtractionEvent(t,a.R.CartExtractionError,"Could not send cart data to storage:  "+e?.message,a.in.Error,o,i)}}SendPersistentTravelCheckoutMessage(e,t,o,i){try{const o=L.Q?.PersistentTravelData??"",i=(0,D.BQ)(o)??{};i[e]={travelDataStorageInfo:t,timestamp:new Date};const r=JSON.stringify({value:JSON.stringify(i)});y.Z.SendStorageMessage("PersistentTravelData",r)}catch(e){this.LogCartExtractionEvent(t,a.R.CartExtractionError,"Could not send travel data to storage:  "+e?.message,a.in.Error,o,i)}}ShouldSendTelemetryData(e){return this.isPersonalizationDataConsentEnabled||e!==a.R.CartExtraction&&e!==a.R.TravelCheckoutExtraction}LogCartExtractionEvent(e,t,o,i,r,n,s){let c={};if(this.ShouldSendTelemetryData(t)&&(c=e),!s){void 0===this.cartExtractionSuccessful&&(t===a.R.CartExtraction?this.cartExtractionSuccessful=!0:this.cartExtractionSuccessful=!1);const e=b.Z.GetLocalDataService(),o=e.GetSessionIds()?.retailerSessionId??"",i=e.GetSessionIds()?.pageVisitId??"";c=B(B({},c),{},{isPersonalizationDataConsentEnabled:this.isPersonalizationDataConsentEnabled,extractionId:n??null,PageVisitId:i,RetailerSessionId:o})}y.Z.SendLogEventMessage(c,t,r,o,i)}logInfo(e,t,o,i){const r=b.Z?.GetLocalDataService(),n=r?.GetSessionIds()?.retailerSessionId??"",s=r?.GetSessionIds()?.pageVisitId??"",c={domain:t||location.hostname,cartUrl:location.pathname,isPersonalizationDataConsentEnabled:this.isPersonalizationDataConsentEnabled,extractionId:i??null,PageVisitId:s,RetailerSessionId:n};y.Z.SendLogEventMessage(c,a.R.CartExtractionError,o,e,a.in.Information)}CollectProductInformationFromCollapsedCart(e,t){let o;const i=[];o=e.cartSelectors.collapsedCartProductImageSelector?e.cartSelectors.collapsedCartProductImageSelector:"[aria-label='collapsed item list'] img";const r=t?.querySelectorAll(o);if(void 0!==r&&r.length>0)for(const e of r){const t=e.getAttribute("alt");if(t){let o,r;const a=t.match(" quantity \\d+$");a&&a.length>0?(o=t.replace(a[0],""),r=parseInt(a[0].split(" quantity ")[1],10)):(o=t,r=1);const n=new O.Z;n.productTitle=o.trim(),n.productQuantity=r,n.productImg=e?.src??"",i.push(n)}}return i}ShouldAddCartButtonListener(e,t){let o=e?.clickForCartSelector;return o||"walmart.com"!==t||(o="#cart-button-header"),o&&f.Z.GetAllVisibleElements(o).length>0?{shouldAddListener:!0,cartButtonSelector:o}:{shouldAddListener:!1,cartButtonSelector:""}}AddCartButtonListener(e,t,o,i,r,a,n,s,c,u,d,h){const p=f.Z.GetFirstVisibleElement(e);p?.addEventListener("click",(async()=>{l.ZP.WaitForCondition((async()=>{const e=this.GetCartCheckoutPage(o.retailerData.allCheckoutPages);if(e&&e.checkoutPageUrl!==t)return!1;o.retailerData.updateCurrentCheckoutPage(t);const i=o.retailerData.getCurrentCheckoutPage();return!!i?.cartSelectors?.cartSelector&&f.Z.HasVisibleElement(i?.cartSelectors?.cartSelector)}),1e3).then((e=>{if(e){o.retailerData.updateCurrentCheckoutPage(t);const e=o.retailerData.getCurrentCheckoutPage();this.TryCheckAndCollectCartInformation(i,r,e,a,u,d,e?.automatedCartExtractionEnabled,n.isCashbackEstimationSupportedForDomain,s,c,void 0,h)}}))}))}GetTimeDiff(e,t){return(t-e).toFixed(1)}GetCartCheckoutPage(e){const t=e.filter((e=>e.pageType&&e.pageType===a.GV.CheckoutPage));return t.length>0?t[0]:null}async CollectCartInfoFromProductPage(e,t,o,i,r,a,n,s,c){const u=t.retailerData.getCurrentCheckoutPage();if(u)if(u.addToCartOverlaySelector&&u.cartSelectors){let l=!1;const d={attributes:!0,characterData:!0,childList:!0,subtree:!0};new MutationObserver((async d=>{if(!f.Z.GetFirstVisibleElement(u.addToCartOverlaySelector))return void(l=!1);if(l)return;l=!0;const h=t.retailerData.getCurrentCheckoutPage();this.TryCheckAndCollectCartInformation(e,o,h,i,r,a,h?.automatedCartExtractionEnabled,t.isCashbackEstimationSupportedForDomain,n,s,!0,c)})).observe(document.body,d)}else if(u?.buyNowSelector&&u?.cartSelectors){const d=u.buyNowSelector,h=await l.ZP.WaitForCondition((async()=>f.Z.HasVisibleElement(d)),5e3).then((async()=>f.Z.GetFirstVisibleElement(d)));h?.addEventListener("click",(async()=>{const l=t.retailerData.getCurrentCheckoutPage();this.TryCheckAndCollectCartInformation(e,o,l,i,r,a,l?.automatedCartExtractionEnabled,t.isCashbackEstimationSupportedForDomain,n,s,void 0,c)}))}}notifyCartDataListeners(){try{this.onCartExtractionCallback&&this.onCartExtractionCallback()}catch(e){}}}let G;function x(){return G||(G=new F),G}},61241:function(e,t,o){o.d(t,{Z:function(){return N}});var i=o(72370),r=o(33491),a=o(95457),n=o(4872),s=o(31656),c=o(5144),l=o(29247),u=o(36493),d=o(27689),h=o(93978),p=o(41310),g=o(90066),C=o(82315),S=o(9839),m=o(1094);class A{constructor(){(0,i.Z)(this,"Domain",void 0),(0,i.Z)(this,"ProductName",void 0),(0,i.Z)(this,"ProductSellerName",void 0),(0,i.Z)(this,"ProductBrandName",void 0),(0,i.Z)(this,"Url",void 0),(0,i.Z)(this,"PageUrl",void 0),(0,i.Z)(this,"Price",void 0),(0,i.Z)(this,"ImageUrl",void 0),(0,i.Z)(this,"ProductUpc",void 0),(0,i.Z)(this,"ProductAsin",void 0),(0,i.Z)(this,"Currency",void 0),(0,i.Z)(this,"Market",void 0),(0,i.Z)(this,"ProductVariant",void 0),(0,i.Z)(this,"Badges",void 0),(0,i.Z)(this,"OutOfStock",void 0)}static Create(e){const t=new A;return t.ProductName=e.ProductName,t.Url=e.Url,t.Price=e.Price,t.ImageUrl=e.ImageUrl,t}}var P=A;class f{constructor(){(0,i.Z)(this,"ProductName",void 0),(0,i.Z)(this,"Url",void 0),(0,i.Z)(this,"AggregateRating",void 0),(0,i.Z)(this,"AggregateRatingCount",void 0)}static Create(e){const t=new f;return t.ProductName=e.ProductName,t.Url=e.Url,t.AggregateRating=e.AggregateRating,t.AggregateRatingCount=e.AggregateRatingCount,t}}var E=f;class T{constructor(){(0,i.Z)(this,"ProductName",void 0),(0,i.Z)(this,"Url",void 0),(0,i.Z)(this,"Reviews",void 0)}static Create(e){const t=new T;return t.ProductName=e.ProductName,t.Url=e.Url,t.Reviews=e.Reviews,t}}var O=T,I=o(52056),_=o(83879),v=o(93970),R=class{static CreateVariant(e){return"amazon.com"===e.toLowerCase()?new class{constructor(){(0,i.Z)(this,"pdpUrl","pdp_url"),(0,i.Z)(this,"imageUrl","image_icon_url"),(0,i.Z)(this,"asin","asin"),(0,i.Z)(this,"productVariant","product_variant")}ExtractVariants(){let e="{product_variant: {",t="";const o={};for(let e=0;e<25&&(t="#color_name_"+e,null!=g.Z.GetFirstMatchingElement(t));e++){const i=this.ExtractVariantUrl(t);if(null===i)continue;const r=this.ExtractVariantImageUrl(t);if(null===r)continue;const a=this.ExtractVariantAsin(t);if(null===a)continue;const n=this.ExtractVariantAttribute(t),s={};s[this.pdpUrl]=i,s[this.imageUrl]=r,s[this.asin]=a,"none"!==n[0]&&(s[n[0]]=n[1]),o["variant_"+(e+1)]=s}const i={};return i[this.productVariant]=o,e=JSON.stringify(i),e}ExtractVariantUrl(e){const t=g.Z.GetFirstMatchingElement(e);let o="default-data-url";const i=t?.getAttribute("data-dp-url");return""!==i&&null!=i&&(o=i),"default-data-url"===o||null==o?null:o}ExtractVariantImageUrl(e){const t=e+" .a-button",o=g.Z.GetFirstMatchingElement(t),i=o?.getAttribute("id");if(null==i)return null;const r="#"+i+"-announce > div > div > img",a=g.Z.GetFirstMatchingElement(r),n=a?.src??"";return null==n?null:n}ExtractVariantAsin(e){const t=g.Z.GetFirstMatchingElement(e),o=t?.getAttribute("data-defaultasin");return o}ExtractVariantAttribute(e){const t=g.Z.GetFirstMatchingElement("#variation_color_name > div > label")?.innerText,o=g.Z.GetFirstMatchingElement("#variation_color_name > div > span")?.innerText;return void 0!==t&&void 0!==o&&null!==t&&null!==o?[t,o]:["none","none"]}}:new class{ExtractVariants(){return""}}}},D=o(27900),N=class{constructor(){(0,i.Z)(this,"currentPageUrl",void 0),(0,i.Z)(this,"cashBackResponseStr",void 0)}SetServiceUrl(e){this.currentPageUrl=e}SetCashbackResponseStr(e){this.cashBackResponseStr=e}async Init(){this.SetServiceUrl(new URL(window.location.href));const e=_.Z.GetLocalDataService(),t=e.GetCheckoutPageData(),o=e.GetItemLevelCashbackData();t.retailerData.updateCurrentCheckoutPage(m.Z.GetCurrentPathName());const i=t.retailerData.getCurrentCheckoutPage(),r=i?.catalogSelectors,l=t.retailerData.domainName,u=t.impressionId;if(i?.pageType===c.GV.ProductPage){let e=r?.productPriceSelector,o=r?.productImageSelector,i=r?.productTitleSelector,a=r?.productOutOfStockSelector;s.R.isExperimentActive.bind(n.H.pdpSelectorExtraction)&&(e=e??t?.retailerData?.productPriceSelector,o=o??t?.retailerData?.productImageSelector,i=i??t?.retailerData?.productNameSelector,a=a??t?.retailerData?.productOutOfStockSelector),this.ExtractReviews(l,u,r?.reviewSelector,r?.reviewRatingSelector,r?.reviewDateSelector,r?.reviewerNameSelector,r?.productTitleSelector).catch((e=>{})),this.ExtractRatings(l,u,r?.aggregateRatingSelector,r?.aggregateRatingNumberOfRatingsSelector,r?.productTitleSelector).catch((e=>{}));const d=(new Date).getTime();this.ExtractPDPOffer(l,u,e,o,i,r?.productSellerSelector,r?.productBrandSelector,r?.productUPCSelector,r?.productASIN,a).catch((e=>{const t=(new Date).getTime();this.LogCatalogExtractionEvent({},c.R.CatalogExtractionPDPOffer,JSON.stringify({extractionTime:t-d}),c.in.Information,u),s.R.isExperimentActive(n.H.pdpSelectorExtraction)&&S.Q.sendMessage(v.EI.DataExtracted,[C.Z.getApiResponse().traceId,"{}"])})).then((e=>{this.CachePdpOffer(e);const t=(new Date).getTime();this.LogCatalogExtractionEvent(e??{},c.R.CatalogExtractionPDPOffer,JSON.stringify({extractionTime:t-d}),c.in.Information,u),s.R.isExperimentActive(n.H.pdpSelectorExtraction)&&S.Q.sendMessage(v.EI.DataExtracted,[C.Z.getApiResponse().traceId,JSON.stringify(e)])}))}else if(i?.pageType===c.GV.SearchPage&&o?.domainData){const e=a.Z.Create(o.domainData),t=p.Z.IsSearchPage(this.currentPageUrl,e);t?.searchKey&&this.ExtractSearchProduct(l,u,r?.productTitleSelector,r?.productPriceSelector,t.searchKey)}}async CachePdpOffer(e){try{let t=JSON.parse((0,r.Mw)(D.D8)||"[]");e?.ProductName&&t.push(e),t.length>D.xD&&t.shift(),(0,r.Xo)(D.D8,JSON.stringify(t))}catch(e){}}async PostValidation(){}async ExtractReviews(e,t,o,i,r,a,n){if(o){await l.ZP.WaitForCondition((async()=>{if(void 0===o)return!1;const e=g.Z.RunQuerySelectorAll(o);return void 0!==e&&e.length>0}),5e3);try{const s=o?g.Z.RunQuerySelectorAll(o):[],l=i?g.Z.RunQuerySelectorAll(i):[],u=r?g.Z.RunQuerySelectorAll(r):[],d=a?g.Z.RunQuerySelectorAll(a):[],h=n?g.Z.GetFirstVisibleElement(n)?.innerText:"",p=new URL(window.location.href),C=Array.from(s).flatMap((e=>e.innerText)),S=Array.from(l).flatMap((t=>this.GetReviewRating(t,e))),m=Array.from(u).flatMap((e=>e.innerText)),A=Array.from(d).flatMap((e=>e.innerText)),P=new O;P.Reviews=JSON.stringify([C,S,m,A,[this.currentPageUrl.toString().split("?")[0]]]),P.Url=p.toString().split("?")[0],void 0!==h&&(P.ProductName=h),this.LogCatalogExtractionEvent(P,c.R.CatalogExtractionReviews,"",c.in.Information,t)}catch(e){}}}async ExtractRatings(e,t,o,i,r){if(o&&i){await l.ZP.WaitForCondition((async()=>void 0!==o&&void 0!==g.Z.GetFirstVisibleElement(o)),5e3);try{const a=new URL(window.location.href),n=g.Z.GetFirstVisibleElement(o)??void 0,s=g.Z.GetFirstVisibleElement(i)?.innerText,l=r?g.Z.GetFirstVisibleElement(r)?.innerText:"";if(void 0!==n&&void 0!==s){const o=new E;o.AggregateRating=this.GetAggregateRating(n,e),o.AggregateRatingCount=s,o.Url=a.toString().split("?")[0],o.ProductName=l??"",this.LogCatalogExtractionEvent(o,c.R.CatalogExtractionRating,"",c.in.Information,t)}}catch(e){}}}async ExtractPDPOffer(e,t,o,i,r,a,n,s,c,h){const p=new P;if(!o||!i||!r)return p;await l.ZP.WaitForCondition((async()=>{if(void 0===r)return!1;const e=g.Z.GetFirstVisibleElement(r),t=g.Z.GetFirstVisibleElement(o);return void 0!==e&&(!o||void 0!==t)}),5e3);try{const t=new URL(window.location.href),l=g.Z.GetFirstVisibleElement(r)?.innerText,C=g.Z.GetFirstMatchingElement(i),S=C?.src??"",m=g.Z.GetFirstVisibleElement(o)?.innerText;let A="$",P=0,f="",E="USD";const T=(0,d.S8)(),O=R.CreateVariant(T);let I="";const _=O.ExtractVariants();if(null!==_&&(I=_),m&&m.length){A=(0,u.cU)(m),P=(0,u.K)(m);const e=(0,u.Vv)(A);void 0!==e&&(E=e),f=P.toString()}let v,D,N,y,b;a&&n&&(v=g.Z.GetFirstVisibleElement(a)?.innerText,D=g.Z.GetFirstVisibleElement(n)?.innerText),s&&(N=g.Z.GetFirstVisibleElement(s)?.innerText),c&&(y=g.Z.GetFirstVisibleElement(c)?.innerText),h&&(b=g.Z.GetFirstVisibleElement(h)?.innerText),p.Domain=e,p.Price=f,p.ProductVariant=I,p.ImageUrl=S,p.Url=t.toString().split("?")[0],p.PageUrl=t.toString(),p.ProductName=l??"",p.ProductSellerName=v,p.ProductBrandName=D,p.ProductAsin=y,p.ProductUpc=N,p.Currency=E,p.OutOfStock=b;const k=[navigator.language],U=this.GetMarket(k,this.GetSupportedMarkets());let w="en-us";if(void 0!==U&&(w=U,"USD"===E)){const e=(0,u.N6)(w);if(void 0!==e){const t=(0,u.Vv)(e);p.Currency=t}}return p.Market=w,p}catch(e){return p}}async ExtractSearchProduct(e,t,o,i,r){if(!i||!o||!this.cashBackResponseStr)return;const a=JSON.parse(this.cashBackResponseStr);let n,s;a?.itemizedCashBackResponse?.offers?.length>0&&(n=a?.itemizedCashBackResponse?.offers[0]?.adsOffer?.name,s=a?.itemizedCashBackResponse?.offers[0]?.adsOffer?.price),await l.ZP.WaitForCondition((async()=>void 0!==o&&void 0!==g.Z.GetFirstVisibleElement(o)),5e3);try{const a=g.Z.GetAllVisibleElements(o),l=g.Z.GetAllVisibleElements(i),d=[];if(a&&l){for(let e=0;e<10;e++)if(e<a.length&&e<l.length){const t={ProductTitle:a[e]?.innerText,ProductPrice:(0,u.K)(l[e]?.innerText)??-1};d.push(t)}if(d.length>0&&n&&s){const o={Domain:e,products:d,QueryKeyword:r,currentPageUrl:this.currentPageUrl,spbTitle:n,spbPrice:s};this.LogCatalogExtractionEvent(o,c.R.CatalogExtractionSearchOffers,"",c.in.Information,t)}}}catch(e){}}LogCatalogExtractionEvent(e,t,o,i,r){I.Z.SendLogEventMessage(e,t,r,o,i)}GetReviewRating(e,t){return t.match("ebay.")||t.match("lowes.")||t.match("macys.")||t.match("thriftbooks.")||t.match("manomano.")||t.match("hsn.")||t.match("casasbahia.")||t.match("webstaurantstore.")?e.getAttribute("aria-label")??"":"overstock.com"===t?e.getAttribute("data-rating")??"":"quill.com"===t?e.getAttribute("rating")??"":"etsy.com"===t?e.getAttribute("value")??"":"otto.de"===t?e.getAttribute("content")??"":"onbuy.com"===t||"lightinthebox.com"===t?e.getAttribute("title")??"":e.innerText}GetAggregateRating(e,t){return void 0===e?"":t.match("onbuy.")?e.getAttribute("title")??"":e.innerText}GetSupportedMarkets(){return h.YE}GetMarket(e,t){if(!e||0===e.length)return"en-us";let o;for(const t of e){if(t.indexOf("-")>=0)return t.toLowerCase();o||(o=t.toLowerCase())}for(const e of t)if(e.startsWith(`${o}-`))return e}}},82270:function(e,t,o){var i=o(72370),r=o(5144),a=o(29247),n=o(1094),s=o(93209),c=o(12953),l=o(87605),u=o(2388),d=o(84901),h=o(90066),p=o(28219),g=o(27689),C=o(11849),S=o(52056),m=o(83879),A=o(44445),P=o(64865);t.Z=class{constructor(){(0,i.Z)(this,"divIDOverlay","#divOverlayWrapper"),(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"validatorModule",void 0),(0,i.Z)(this,"isCashbackDomain",void 0),(0,i.Z)(this,"checkoutPageUrlData",void 0),(0,i.Z)(this,"exclusiveMarket",void 0),(0,i.Z)(this,"impressionId",void 0),(0,i.Z)(this,"coupons",void 0),(0,i.Z)(this,"fromPlatformDetection",void 0),(0,i.Z)(this,"applyButtonAvailable",!1),(0,i.Z)(this,"textInput",void 0),(0,i.Z)(this,"cartValue",void 0),(0,i.Z)(this,"startTime",void 0),(0,i.Z)(this,"InputHandler",(()=>{const e=h.Z.GetFirstVisibleElement(this.checkoutPageUrlData.inputBoxSelector);if(e&&e.value&&(this.textInput=e.value,this.startTime=(new Date).getTime(),!this.cartValue)){if(this.cartValue=this.GetCartValue(),this.applyButtonAvailable)return;this.WaitForCondition((async()=>this.GetCartValue().OrderTotal!==this.cartValue?.OrderTotal),1e4).then((async e=>{e?await this.GetCouponAndDiscount(!1):this.Reset()}))}})),(0,i.Z)(this,"ApplyHandler",(async()=>{await this.GetCouponAndDiscount(!0)}))}async Init(){this.localDataService=m.Z.GetLocalDataService(),this.validatorModule=m.Z.GetValidatorModule();const e=this.localDataService.GetCheckoutPageData(),t=e?.cashback;this.isCashbackDomain=t&&(t.isRebatesSupportedDomain??!0);const o=e?.retailerData?.getCurrentCheckoutPage(n.Z.GetCurrentPathName());o?.manualCouponApplyTrackingEnabled&&this.TryListenForCoupon(o,e.coupons,this.localDataService.GetMarket(),this.validatorModule.impressionId)}async PostValidation(){}async TryListenForCoupon(e,t,o,i,r){try{a.ZP.IsValidDataField(e.inputBoxSelector)&&a.ZP.IsValidDataField(e.orderTotalDataElementSelector)&&(this.checkoutPageUrlData=e,this.coupons=t??[],this.exclusiveMarket=o,this.impressionId=i,this.fromPlatformDetection=r??!1,this.TrySetUpCouponListener(!1,!1,!0))}catch(e){this.LogError(e?.message)}}async TrySetUpCouponListener(e,t,o){let i=!1;if(i=e?await a.ZP.WaitUntilCondition((async()=>await this.SetUpCouponListener(e)),5e3):await this.SetUpCouponListener(e,t),!i){let e="Unable to add coupon savings listener";o||(e+=" No longer listening"),this.LogError(e)}}async SetUpCouponListener(e,t){return await this.isInputBoxAvailable(e?1:5)?this.ListenForCoupon():await this.CheckRemoveAndClickBeforeStartButtons(t)}async ListenForCoupon(){const e=h.Z.GetFirstVisibleElement(this.checkoutPageUrlData.inputBoxSelector);if(!e)return this.LogError("Called ListenForCoupon without input box available"),!1;const t=h.Z.GetFirstVisibleElement(this.checkoutPageUrlData.applyButtonSelector);return t&&(this.applyButtonAvailable=!0,t.addEventListener("click",this.ApplyHandler)),e.addEventListener("keyup",this.InputHandler),!0}async WaitForCondition(e,t){if(!this.startTime)return!1;for(;!await e()&&this.startTime+t>(new Date).getTime();)await a.ZP.Sleep(100);return this.startTime=null,await e()}async GetCouponAndDiscount(e){e&&await a.ZP.Sleep(this.checkoutPageUrlData.waitAfterApplyingCurrentCoupon??2e3);const t=this.textInput;if(t){let o=this.GetCartValue();o.OrderTotal===this.cartValue?.OrderTotal&&e&&(await a.ZP.Sleep(2e3),o=this.GetCartValue());let i=-1,r="";this.cartValue?.OrderTotal&&o.OrderTotal&&(i=this.cartValue.OrderTotal-o.OrderTotal,r=i>0?"Positive":"Negative"),this.isAutoApplyOn()||(0,P.TF)(r)||this.LogCouponSavings(t,r,i,this.cartValue?.OrderTotal??-1,o.OrderTotal,o.Currency,o.PageCurrency)}this.Reset(),await this.TrySetUpCouponListener(!0)}Reset(){this.textInput="",this.cartValue=null,this.startTime=null}async isInputBoxAvailable(e){return!!await a.ZP.WaitForCondition((async()=>h.Z.HasVisibleElement(this.checkoutPageUrlData.inputBoxSelector)),1e3*e)}CheckRemoveAndClickBeforeStartButtons(e){const t=h.Z.HasVisibleElement(this.checkoutPageUrlData.clickBeforeStartSelector);return!(e||!t||!this.AddClickBeforeStartListener())||!!h.Z.HasVisibleElement(this.checkoutPageUrlData.removeCouponButtonSelector)&&this.AddRemoveButtonListener()}AddClickBeforeStartListener(){const e=h.Z.GetFirstVisibleElement(this.checkoutPageUrlData.clickBeforeStartSelector);return!!e&&(e.addEventListener("click",(async()=>{await this.TrySetUpCouponListener(!1,!0)})),!0)}AddRemoveButtonListener(){const e=h.Z.GetFirstVisibleElement(this.checkoutPageUrlData.removeCouponButtonSelector);return!!e&&(e.addEventListener("click",(async()=>{await this.TrySetUpCouponListener(!1,!1)})),!0)}GetCartValue(){let e={OrderTotal:-1,Currency:"$",PageCurrency:""};try{e=C.Z.GetCartValue(this.checkoutPageUrlData.orderTotalDataElementSelector,this.exclusiveMarket)}catch(e){this.LogError(e?.message)}return e}IsCouponInOurCorpus(e){return this.coupons.find((t=>t.couponCode.toLowerCase().trim()===e.toLowerCase().trim()))}isAutoApplyOn(){return h.Z.HasVisibleElement(this.divIDOverlay)}LogCouponSavings(e,t,o,i,a,n,s){const u=this.IsCouponInOurCorpus(e),h=(0,g.S8)();let p=e;try{p=u?e:btoa(e)}catch(e){p="USERCOUPON"}const C=this.TryGetCouponStatusMessages(),A={CouponCode:p,Currency:n,Discount:o,Domain:(0,g.S8)(),FinalPrice:a,PageCurrency:s,PageUrl:(0,g.Ek)(),Result:t,StartingPrice:i,StatusMessage:C.statusMessage,SuccessMessages:C.successMessages,FailureMessages:C.failureMessages,ProviderId:u?.providerId??"",IsPrivateCoupon:u?.isPrivateCoupon??!1,CartExtractionId:m.Z.GetCartExtractionService().GetLastCartExtractionId()},f=this.fromPlatformDetection?"User applied a coupon from platform detection":"User applied a coupon";if(u)(0,P.TF)(u.offerUrl)||this.isCashbackDomain||S.Z.SendNavigateToUrlMessage(u.offerUrl),S.Z.SendLogEventMessage(A,r.R.ManualCouponApplication,this.impressionId,f,r.in.Information);else{const e=new c.Z(p,h,r.M_.ManuallyAppliedCouponNotInOurCorpus,location.pathname,JSON.stringify(A));S.Z.SendLogEventMessage(e,r.R.CollectedCoupons,this.impressionId,f,r.in.Information)}(o>0||u)&&this.SendEngagementTelemetry(r.$S.ManuallyAppliedCoupon,l.bS.COUPONS_COPIED,d.FV.COUPONS_COPIED)}TryGetCouponStatusMessages(){try{return p.Z.GetCouponStatusMessages(this.checkoutPageUrlData?.errorMessageSelector,this.checkoutPageUrlData?.couponSuccessMessageSelectors,this.checkoutPageUrlData?.couponFailureMessageSelectors)}catch(e){this.LogError("Error extracting coupon status messages")}return{statusMessage:"",successMessages:[],failureMessages:[]}}async SendEngagementTelemetry(e,t,o){const i=new s.Z(e,u.r.COUPONS_AVAILABLE,(0,g.S8)());S.Z.SendLogEventMessage(i,r.R.ButtonClick,this.impressionId,"User applied a coupon manually",r.in.Information),A.a.postMessageToHost("recordAsUserAction",[t]),A.a.postMessageToHost("recordAsUserEngagement",[o])}LogError(e){const t={Domain:(0,g.S8)(),PageUrl:(0,g.Ek)(),Status:"Error"};S.Z.SendLogEventMessage(t,r.R.ManualCouponApplication,this.impressionId,e??"Error getting coupon savings",r.in.Information)}}},86743:function(e,t,o){o.d(t,{Kv:function(){return p},XB:function(){return d},sy:function(){return h}});var i=o(4872),r=o(31656),a=o(31714),n=o(73557);const s=190624,c=84541440,l=-809239298,u=-9;function d(){try{return!(!r.R.isExperimentActive(i.H.autoOpenControllerMask)||!r.R.isExperimentActive(i.H.autoOpenControllerScript)||h())}catch(e){return!1}}function h(){const[e,t]=g();return e!==l||u!==t}function p(e){let t=!1,o="";if(e>=63)return t=!0,o="64above",{status:t,reason:o};if(e===n.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK)return t=!0,o="activatedGrocery",{status:t,reason:o};if(e===n.sR.AUTO_SHOW_SPB_CASHBACK_LANDING)return t=!0,o="spbPriority",{status:t,reason:o};const[i,r]=g();let a;return a=e<32?i:r,(1<<e&a)==1<<e?(t=!0,o="variantmaskcheck"):o="variantmaskcheckblocked",{status:t,reason:o}}function g(){const e=r.R.getMultipleVariants(i.H.autoOpenControllerMask);if(e&&e.length>0){const t=e.find((e=>e.key===a.vr.FirstMask)),o=e.find((e=>e.key===a.vr.SecondMask));if(t?.value&&o?.value)return[parseInt(t.value,10),parseInt(o.value,10)]}return[s,c]}},3274:function(e,t,o){function i(e,t,o,i){if("CheckoutPageValidation"===t){window.InitializeExposedMethods();try{const t=performance.now();"interactive"===document.readyState||"complete"===document.readyState?window.TryIsAutoApplyValid(e,o,i,t):window.addEventListener&&window.addEventListener("DOMContentLoaded",(r=>{window.CheckAndIsAutoApplyValid(e,o,i,t)})),o++}catch(e){}}else if("ExtractCheckoutPageGMV"===t)try{window.GetAndSnedExpressCheckoutGMV(e[0]??null)}catch(e){}else if("GetCashBackResponse"===t)try{window.ProcessCashBackResponse(e[0])}catch(e){}else if("WebAssistQueryResults"===t)window.ProcessWebAssistResponse(e[1]);else if("PdpValidation"===t)try{window.ProcessPdpCashBackResponse(e[0])}catch(e){}else"SharePriceComparisonData"===t||"ShareCompleteExtractionData"===t?r(e,!0,i):"OnGenericDealsServiceResponse"===t?window.ProcessClientRequestResponse(e):("BackgroundAutoApplyComplete"===t||"PostPurchaseRewardsNotify"===t)&&r(e,!1,i,t);return o}function r(e,t,o,i){try{if(window.AOCInitializeExposedMethods(),"interactive"===document.readyState||"complete"===document.readyState){const r=performance.now();"BackgroundAutoApplyComplete"===i?window.CanAutoOpenAfterBGAAComplete(o,r,i):"PostPurchaseRewardsNotify"===i?window.CanAutoOpenAfterPostPurchaseRewards(e):t?window.CanAutoOpenAfterPDPData(e):window.CanAutoOpen(e,o,r)}else window.addEventListener&&window.addEventListener("DOMContentLoaded",(i=>{t?window.CheckAndCanAutoOpenAfterPDPData(e):window.CheckAndCanAutoOpen(e,o)}))}catch(e){return!1}}o.d(t,{U:function(){return i},g:function(){return r}})},7355:function(e,t,o){var i=o(72370),r=o(82315),a=o(44922),n=o(83879);t.Z=class{constructor(){(0,i.Z)(this,"retailerData",void 0)}async Init(){this.retailerData=r.Z.getApiResponse()?.retailerData??null,this.isPinterestScenario()&&await this.triggerPinterestScenario()}PostValidation(){return Promise.resolve()}isPinterestScenario(){return"pinterest.com"===this.retailerData?.domainName}async triggerPinterestScenario(){try{if(!this.retailerData)return;const e=n.Z.GetValidatorModule();let t;return t=await e.RetrieveGuestDomain(this.retailerData.getCurrentCheckoutPage())?a.S.PinterestDeals:a.S.NoPinterestDeals,void e.SendValidationMessage(!1,t,this.retailerData.domainName)}catch(e){}}}},84178:function(e,t,o){var i=o(52056);t.Z=class{SendMessage(e,t){i.Z.SendMessage(e,t)}SendStringStorageMessage(e,t){i.Z.SendStringStorageMessage(e,t)}SendBoolStorageMessage(e,t){i.Z.SendStorageMessage(e,JSON.stringify({value:t}))}}},69442:function(e,t,o){var i=o(4872),r=o(31656),a=o(77776),n=o(82315);t.Z=class{Init(){const e=n.Z.getApiResponse();return r.R.isExperimentActive(i.H.showPaymentOptions)&&a.Z.GetAndSendExpressCheckoutPageGMV(e),Promise.resolve()}PostValidation(){return Promise.resolve()}}},15267:function(e,t,o){o.d(t,{AS:function(){return l},Ae:function(){return C},E:function(){return m},IL:function(){return S},Im:function(){return f},RT:function(){return d},Tb:function(){return h},aB:function(){return E},ql:function(){return g},sB:function(){return P},vU:function(){return c}});var i=o(5144),r=o(3634),a=o(29247),n=o(45822),s=o(56577);const c=(e,t)=>{const o=e.split(":")[1];return o&&t.includes(o)?h(o,t):""},l=(e,t)=>{try{const o=e.split(":")[1];if(!o)return"";const i=p(t),a=i?.pathname;if(!a)return"";const[n,s]=o.split(r.P5),c=a.split(n)[1];return s?c.split(s)[0]:c}catch(e){return""}},u=(e,t)=>{try{const o=new RegExp(e.toLowerCase());if(o){const e=t.toLowerCase().match(o),i=e?.groups&&e.groups.orderid||"";if(i)return i}}catch(e){}return""},d=(e,t)=>{try{if(!e||!t)return"";const o=u(e,t);if(o)return o;const i=e.replace("\\","\\\\");return u(i,t)}catch(e){return""}},h=(e,t)=>{const o=t.split("?")[1],i=new URLSearchParams(o);for(const t of i.entries())if(t[0].includes(e))return t[1];return null},p=e=>{try{return new URL(e)}catch(e){return}},g=(e,t)=>{const o=e?.split(",")??[];for(let e of o)if(e.startsWith(r.$S)||e.startsWith(r.js)){const o=c(e,t);if(o)return o}else if(e.startsWith(r.m7)){const o=l(e,t);if(o)return o}return""},C=e=>e.startsWith(r.$S)||e.startsWith(r.m7)||e.startsWith(r.js),S=(e,t,o)=>{try{if(t.length>0&&o){const r=(e=>{switch(e){case i.GV.CheckoutPage:return i.u3.Checkout;case i.GV.ConfirmationPage:return i.u3.PurchaseConfirmed}})(e);for(const e of t)if(e.urlRegex&&(!r||e.type===r)&&(0,n.io)(o,e.urlRegex))return e}return}catch(e){return}},m=(e,t,o,r,a)=>{const s=(0,n.dQ)(e,t,a);if(s!==i.GV.UnknownPage)return s;const c=((e,t,o)=>{if(e?.orderConfirmationPageUrl&&(0,n.io)(t,e.orderConfirmationPageUrl)&&o){if(!o.confirmationPageValidationSelector)return i.GV.ConfirmationPage;if(A(o,t))return i.GV.ConfirmationPage}return e?.checkoutPageUrl&&(0,n.io)(t,e.checkoutPageUrl)?i.GV.CheckoutPage:e?.productPageUrlRegex&&(0,n.io)(t,e.productPageUrlRegex)||e?.productPageUrl&&(0,n.io)(t,e.productPageUrl)?i.GV.ProductPage:e?.searchQueryUrlRegex&&(0,n.io)(t,e.searchQueryUrlRegex)?i.GV.SearchPage:i.GV.UnknownPage})(o,e,r);return c!==i.GV.UnknownPage&&c!==i.GV.HomePage?c:((e,t)=>{try{if(e.length>0&&t)for(const o of e)if(o.urlRegex&&(0,n.io)(t,o.urlRegex)){if(o.type!==i.u3.PurchaseConfirmed)return o.type===i.u3.Checkout?i.GV.CheckoutPage:i.GV.UnknownPage;{if(!o.validationSelector)return i.GV.ConfirmationPage;if(document.querySelector(o.validationSelector))return i.GV.ConfirmationPage;const e=P(o);if(d(e,t))return i.GV.ConfirmationPage}}return i.GV.UnknownPage}catch(e){return i.GV.UnknownPage}})(o?.allAutomatedSelectors||[],e)},A=(e,t)=>{if(e.confirmationPageValidationSelector&&document.querySelector(e.confirmationPageValidationSelector))return!0;const o=e.transactionIdSelector||"";if(o){if(document.querySelector(o))return!0;if(g(o,t))return!0}return!1},P=e=>f(e?.urlFields),f=e=>e?e[s.Fw.OrderId]??"":"",E=(e,t)=>{if(e&&e.length>0)for(let o=0;o<e.length;o++)if((0,a.VJ)(e[o].checkoutPageUrl,e[o].pageUrlRegex,t))return e[o]}},68813:function(e,t,o){o.d(t,{Oh:function(){return h},ZQ:function(){return p},tW:function(){return u}});var i=o(4872),r=o(31656),a=o(73557),n=o(65302);let s=function(e){return e.Vulnerable="Vulnerable",e.Campaign="Campaign",e}({});const c=new Map([[s.Vulnerable,i.H.shoppingCohortsVulnerable],[s.Campaign,i.H.shoppingCohortsReclaimed]]);function l(e){if(!r.R.isExperimentActive(e))return[];try{const t=r.R.getMultipleVariants(e);let o=r.R.getVariantStringValue(t,"allowedCohortIds","");return""===o&&(o=r.R.getVariantName(e)||""),""===o?[]:o.split(",").map((e=>parseInt(e)))}catch{return[]}}function u(){const e=new Set([]);for(const t of c.values())l(t)?.forEach((t=>e.add(t)));return e}function d(e,t){if(t?.cohortsConfig)for(const o of t.cohortsConfig)if(void 0!==o.enabledPopupOriginations&&void 0!==o.cohortId&&e.has(o.cohortId))return o.enabledPopupOriginations}function h(e,t,o){const i=d(t,o);return void 0===i||i.findIndex((t=>t===e))>-1}function p(e,t,o,i){const r=d(t,i);if(void 0===r)return!0;const s=(void 0===o?[]:o).map((e=>(0,n.Pw)(e)||a.sR.AUTO_SHOW_COUPONS_CHECKOUT));0===s.length&&s.push(a.sR.AUTO_SHOW_COUPONS_CHECKOUT);const c=s.every((e=>r.includes(e)));if(!c){const t={pageValidations:o,popupOriginations:s,userSettings:i};e(JSON.stringify(t))}return c}},11849:function(e,t,o){var i=o(29247),r=o(36493),a=o(52056);class n{static async WaitAndGetCartValue(e,t,o){const a=e;let s={OrderTotal:-1,Currency:(0,r.N6)(t)??"$",PageCurrency:""};return i.ZP.IsValidDataField(a)&&(s=await i.ZP.WaitForCondition((async()=>n.GetCartValue(a,t)?.OrderTotal>0),o??1e4).then((()=>n.GetCartValue(a,t))).catch((()=>s))),s}static async WaitAndGetCartValue2(e,t,o){let a={OrderTotal:-1,Currency:(0,r.N6)(t)??"$",PageCurrency:""};return i.ZP.IsValidDataField(e)&&(a=await i.ZP.WaitForCondition((async()=>n.TrySimpleGetCartValue(e,t)?.OrderTotal>0),o??1e4).then((()=>n.TrySimpleGetCartValue(e,t))).catch((()=>a))),a}static TrySimpleGetCartValue(e,t){const o=document.querySelector(e);let i=-1,a=(0,r.N6)(t)??"$";const n=o?.textContent??"";i=(0,r.K)(n);const s=(0,r.cU)(n,!0);return a=(0,r.Cl)(s,t),{OrderTotal:i,Currency:a,PageCurrency:s}}static GetCartValue(e,t){let o=-1,i=(0,r.N6)(t)??"$";const n=a.Z.GetOrderTotalString(e);o=(0,r.K)(n)??-1;const s=(0,r.cU)(n,!0);return i=(0,r.Cl)(s,t),{OrderTotal:o,Currency:i,PageCurrency:s}}}t.Z=n},52056:function(e,t,o){var i=o(72370),r=o(64865),a=o(84830),n=o(5144),s=o(39088),c=o(29247),l=o(71544),u=o(27689),d=o(9448),h=o(79249),p=o(90066),g=o(31024),C=o(49206),S=o(77594);class m{static SetFullAOCActive(e){this.isFullAOCActive=e}static GetBoxValue(e){if(c.ZP.IsValidDataField(e))try{const t=m.GetTextValue(e);return t?t.trim():t}catch(e){throw Error(e.message)}return""}static ParseBackgroundAutoApplyStateData(e){const t=m.GetBackgroundAutoApplyStateString(e);return(0,r.TF)(t)?null:h.Z.CreateFromObject(JSON.parse(t))}static GetBackgroundAutoApplyStateString(e){const t=g.Z.GetBackgroundAAKeyName();return"string"==typeof e[t]?e[t]:e[t]?.value}static parseDate(e){const t=e?.split(",");let o,i="";if(1===t?.length){const r=(new Date).getDate(),a=new Date;if(a.setHours(0,0,0,0),a.setDate(r+1),o=a,i=t[0].trim().split("-")[1],!i)throw new Error(`Unable to parse date: ${e}`)}else if(2===t?.length){const e=t[1].trim(),i=t[0].trim().split(" "),r=i[1].trim(),a=i[0].trim();o=new Date(`${r} ${a} ${e}`)}else if(3===t?.length){if(t[0].toLowerCase().includes("today"))o=new Date,o.setHours(0,0,0,0);else{const e=(new Date).getFullYear(),i=t[1].trim().split(" "),r=i[1].trim(),a=i[0].trim();o=new Date(`${a} ${r}, ${e}`)}if(i=t[2].trim().split("-")[1],!i)throw new Error(`Unable to parse date: ${e}`)}else o=new Date("");if(!i)return o;try{const e=this.parseHour(i);if(Number.isNaN(e))return o;o.setHours(e)}catch(e){}return o}static parseHour(e){let t=+e?.match(/\d{1,2}/i)[0];const o=e?.match(/(A|P)M/i)[0];return"pm"===o.toLowerCase()&&(t+=12),+t}static SendLogEvent(e,t,o,i,r,a,s,c){const l={Currency:r,Domain:c??(0,u.S8)(),EdgeFlyoutStatus:s?.EdgeFlyoutStatus,Metadata:s?.Metadata,PageUrl:(0,u.Ek)(),StartingPrice:i??-1,Status:o};m.SendLogEventMessage(l,a??n.R.CheckoutPageValidation,e,t,n.in.Information)}static SendLogEventMessage(e,t,o,i,r){const n={};n.JsonData=JSON.stringify(e),n.EventType=t,n.LogLevel=r,n.Message=i,n.ClientContext=new a.Z(l.Z.GetClientName(),s.W1,l.Z.GetBuildVersion(),l.Z.enabledServiceFlights),o&&(n.ImpressionId=o);const c=[JSON.stringify(n)];m.SendMessage(d.H.LogScriptTelemetry,c)}static SendMessage(e,t){this.isFullAOCActive?C.f.postMessageToHost(e,t):S.p.postMessageToHost(e,t)}static StartEdgeDriver(e,t){this.Invoke(d.H.StartEdgeDriver,e,t)}static SendStorageMessage(e,t){m.SendMessage(d.H.SetStorageValue,[e,t])}static DeleteKeyFromPersistentStorage(e){m.SendStorageMessage(e,JSON.stringify({value:null}))}static SendNavigateToUrlMessage(e){m.SendMessage(d.H.NavigateToUrlBackground,[e,e])}static SendStringStorageMessage(e,t){m.SendMessage(d.H.SetStorageValue,[e,JSON.stringify({value:t})])}static SendNumberStorageMessage(e,t){m.SendMessage(d.H.SetStorageValue,[e,JSON.stringify({value:t})])}static SendBooleanStorageMessage(e,t){m.SendMessage(d.H.SetStorageValue,[e,JSON.stringify({value:t})])}static SendPurchaseConfirmationLog(e,t,o,i,r,a){const s={CartId:r,Currency:a?.Currency,Domain:e,PageCurrency:a?.PageCurrency,PageUrl:(0,u.Ek)(),StartingPrice:a?.OrderTotal??-1,Status:i};m.SendLogEventMessage(s,n.R.PurchaseConfirmation,t,o,n.in.Information)}static GetValidationLogMessage(e,t,o){return e?"Checkout Page is Valid":t?"Checkout Page is disabled or does not exist":o?"Checkout Page is Invalid - Invalid Selectors":"Checkout Page is Invalid"}static GetOrderTotalString(e,t){if(!c.ZP.IsValidDataField(e))return"";const o=e.split(",");for(let e=0;e<o.length;e++){const i=o[e];try{const e=m.GetBoxValuePageQueryUtils(i,t);if(e&&e.match(/[0-9]/))return e}catch(t){if(e===o.length-1)return""}}return""}static IsValidPDPUrlHeuristic(e,t=""){return!(0,r.TF)(e)&&e.includes(t)&&e.includes("/")&&!e.endsWith("#")&&!["help","credit","conditions","privacy","terms","about","faq","returns","careers","account"].some((t=>e.includes(t)))}static Invoke(e,...t){this.isFullAOCActive?C.f.postMessageToHost("Invoke",[e,...t]):S.p.postMessageToHost("Invoke",[e,...t])}static GetBoxValuePageQueryUtils(e,t){if(c.ZP.IsValidDataField(e))try{return p.Z.GetTextValue(e,t)}catch(e){throw Error(e.message)}return""}static GetTextValue(e){const t=e.split(";"),o=p.Z.GetFirstVisibleElement(t[0]);let i=o;if(void 0===i)return"";let r=i.innerText;if(1===t.length)i=p.Z.NormalizeIfSuperscripted(o),r=i.innerText;else{const e=p.Z.GetFirstVisibleElement(t[1]);if(e&&e.innerText){const t="."+e.innerText;if(i.contains(e)){const e=i.cloneNode(!0);e.childNodes.forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&e.removeChild(t)})),r=e?.innerText?e.innerText:r}r+=t}}return p.Z.StripInvalidJSONCharacters(r)}}(0,i.Z)(m,"isFullAOCActive",!1),t.Z=m},83879:function(e,t,o){o.d(t,{Z:function(){return Ue}});var i=o(72370),r=o(23825),a=o(55648),n=o(59518),s=o(98574),c=o(74113),l=o(98011),u=o(43263),d=o(20546),h=o(82960),p=o(5144),g=o(29247),C=o(36493),S=o(33491),m=o(27900),A=o(43686),P=o(14440),f=o(52056);function E(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function T(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?E(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):E(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var O=o(73688),I=o(39088),_=o(71544),v=o(27689),R=o(69315),D=o(90066),N=class{isCancellationPageValid(e){return!(!e.cancellationPageTelemetry?.cancellationPageUrlRegex||""===e.cancellationPageTelemetry.cancellationPageUrlRegex)&&new RegExp(e.cancellationPageTelemetry.cancellationPageUrlRegex,"i").test((0,v.Ek)())}GetAndSendCancellationPageData(e,t){let o="";e?.cancellationPageTelemetry?.transactionIdSelector&&""!==e?.cancellationPageTelemetry?.transactionIdSelector&&(o=f.Z.GetBoxValue(e.cancellationPageTelemetry.transactionIdSelector));let i="";e?.cancellationPageTelemetry?.totalPriceSelector&&""!==e?.cancellationPageTelemetry?.totalPriceSelector&&(i=f.Z.GetBoxValue(e.cancellationPageTelemetry.totalPriceSelector));let r="";e?.cancellationPageTelemetry?.cancellationTextSelector&&""!==e?.cancellationPageTelemetry?.cancellationTextSelector&&(r=f.Z.GetBoxValue(e.cancellationPageTelemetry.cancellationTextSelector));let a="",n="";if(e?.cancellationPageTelemetry?.productTitleSelector&&""!==e?.cancellationPageTelemetry?.productTitleSelector){const t=D.Z.RunQuerySelectorAll(e?.cancellationPageTelemetry?.productTitleSelector);if(t.length>0)for(const e of t)e&&e.textContent&&(a+=e.textContent?.trim()+"<SEP>")}let s="";if(e?.cancellationPageTelemetry?.pricePerItemSelector&&""!==e?.cancellationPageTelemetry?.pricePerItemSelector){const t=D.Z.RunQuerySelectorAll(e?.cancellationPageTelemetry?.pricePerItemSelector);if(t.length>0)for(const e of t)e&&e.textContent&&(s+=e.textContent?.trim()+"<SEP>")}if(e?.cancellationPageTelemetry?.productQuantitySelector&&""!==e?.cancellationPageTelemetry?.productQuantitySelector){const t=D.Z.RunQuerySelectorAll(e?.cancellationPageTelemetry?.productQuantitySelector);if(t.length>0)for(const e of t)e&&e.textContent&&(n+=e.textContent?.trim()+"<SEP>")}const c={CancellationPageUrl:(0,v.Ek)(),Domain:(0,v.S8)(),TransactionId:o,CancellationPageText:r,ProductNames:a,QuantityPerItem:n,PricePerItem:s,TotalPrice:i},l={};l.JsonData=JSON.stringify(c),l.EventType="CancellationPageDetails",l.LogLevel="Information",l.Message="Cancellation Page Details",l.ClientContext={AppInfoClientName:_.Z.GetClientName(),JSVersion:I.yJ},t&&(l.ImpressionId=t);const u=[JSON.stringify(l)];R.R.postMessageToHost("LogScriptTelemetry",u)}},y=o(7664),b=o(61241),k=o(49206),U=o(77594),w=o(82270),L=o(91495),M=o(9839),Z=o(45822),B=o(92572),F=o(11501),G=class{constructor(){(0,i.Z)(this,"IsBatBeaconFound",!1),(0,i.Z)(this,"DISALLOWED_NAMES",new Set(["addr","city","cell","dob","email","data-gtm","mob","phone","secret","social","ssn","tel","zip","pass","payment","cvv","ccv"]))}GetPageType(e,t,o){if((0,Z.$1)())return p.GV.UnknownPage;const i=(0,Z.dQ)(t,o,e?.aFDMarket??"");if(i!==p.GV.UnknownPage)return i;const r=(0,Z.p_)(e?.retailerData,t);return r!==p.GV.UnknownPage&&r!==p.GV.HomePage?r:(0,Z.I2)(e?.retailerData?.allAutomatedSelectors||[],t)}IsCollectionAllowed(e){return"en-us"!==e||this.isPrivacyBadgeShown()}isPrivacyBadgeShown(){return!!L.Q?.PrivacyBadgeViewCount&&parseInt(L.Q.PrivacyBadgeViewCount,10)>=2}collectCheckoutPurchaseEventAndFragment(){const e=B.Z.getFactory().getPurchaseExtractionService(),t=B.Z.getFactory().getFragmentCollectionService();e.runExtraction().then((({shouldLogFragment:e,dataToLog:o})=>{if(e){const e=t.getBrokenAttributionCollectionRate(),i=o?JSON.stringify(o):"";t.RunFragmentCollection(!0,`Broken required fields: ${i}`,e)}})),t.RunFragmentCollection()}CollectData(e){try{const t=Ue.GetLocalDataService()?.GetSessionIds(),o=this.getAnid(),i="";B.Z.initFactory(e,t,o,i);const r=B.Z.getFactory().getFragmentCollectionService();return"complete"===document.readyState?this.collectCheckoutPurchaseEventAndFragment():document.onreadystatechange=()=>{"complete"===document.readyState&&this.collectCheckoutPurchaseEventAndFragment()},r.isNewCollectionFlagEnabled()}catch(e){const t={errorMsg:e.Message};return M.Q.sendLogEventMessageV2(t,p.R.HtmlFragment,"","CollectData:::failed to extract data from page",p.in.Error),!1}}CollectFragment(e){if((0,Z.hy)(e)&&this.CollectData(e))return;const t=(0,Z.P4)();if((e.retailerData?.isAOCFragmentCollectionEnabled||t)&&(0,v.Ek)()?.startsWith("https:")&&this.IsCollectionAllowed(e?.aFDMarket)){const o=(0,v.Ek)(),i=t?"1":e.retailerData?.aOCFragmentCollectionRate??"0",r=Math.random();if(i&&r<parseFloat(i)){const t=e.retailerData?.domainName??(0,v.S8)(),r=this.GetPageType(e,o,t),a=(0,Z.nY)(),n=!a||a&&(0,Z.Ak)(r),s=Ue.GetLocalDataService(),c=s.GetSessionIds()?.retailerSessionId??"",l=s.GetSessionIds()?.pageVisitId??"";if(n){const o=new F.Z(e?.retailerData?.settings).GetFragmentCollectionTimeout(r)??0;"complete"===document.readyState?setTimeout((async()=>{this.sendHtmlFragment(t,"",i,r,e?.impressionId??"",c,l)}),o):document.onreadystatechange=()=>{"complete"===document.readyState&&setTimeout((async()=>{this.sendHtmlFragment(t,"",i,r,e?.impressionId??"",c,l)}),o)}}}}}async CollectFragmentOnConfirmationPage(e,t,o,i=!0){try{const r=(0,Z.P4)();if(!this.IsCollectionAllowed(t)&&!r)return;const a=p.GV.ConfirmationPage,n=(0,v.Ek)(),s=new F.Z(e?.retailerData?.settings),c=r?1:s.GetCollectionRate(n,a,i)??0;if(c>0&&Math.random()>=c)return;const l=Ue.GetLocalDataService(),u=l.GetSessionIds()?.retailerSessionId??"",d=l.GetSessionIds()?.pageVisitId??"",h=e?.retailerData?.domainName??"";this.sendHtmlFragment(h,"",`${c}`,a,e.impressionId,u,d,o,!0)}catch(e){}}getAnid(){try{const e=L.Q.rawStorageObj,t=e?.productTrackingData?JSON.parse(e.productTrackingData):void 0;return t?._anid||""}catch(e){}return""}async sendHtmlFragment(e,t,o,i,r,a,n,s="",c=!1){let l=-1,u=null;if(c){u=this.cloneNodeWithPlaceholders(document.body,!1,performance.now());const t=performance.now();this.MaskPiiData(u,e),l=performance.now()-t}else{const e=performance.now();u=this.cloneNodeWithPlaceholders(document.body,!1,performance.now()),this.IsBatBeaconFound=!1,l=performance.now()-e}const d={Domain:e,TimeToMask:l.toString(),PageType:i,PageUrl:(0,v.Ek)(),EncryptionKey:"",HtmlFragment:"",aOCFragmentCollectionRate:o,RetailerSessionId:a,PageVisitId:n,isConfirmationPage:`${c}`};if(!u)return;if(t){const e=await this.getSymmetricEncryptionKey(),o=await this.encryptData(e,u.outerHTML),i=await this.encryptSymmetricKey(t,e);d.EncryptionKey=i,d.HtmlFragment=o}else{let e=u;const t=document?.head?.querySelector("title")?.textContent;if(t){const o=document.createElement("html"),i=document.createElement("head"),r=document.createElement("title");r.textContent=t,i.appendChild(r),o.appendChild(i),u&&o.appendChild(u),e=o}d.HtmlFragment=btoa(encodeURIComponent(e?.outerHTML))}if(!d.HtmlFragment)return;let h=c?"[Confirmation] Html Fragment collection":"[AOC] Html Fragment collection";s&&(h=`${h}; ${s}`),c?this.sendConfirmtionPageLog(d,h):M.Q.sendLogEventMessageV2(d,p.R.HtmlFragment,r,h,p.in.Information)}sendConfirmtionPageLog(e,t,o=!1){const i={};i.JsonData=JSON.stringify(e),i.EventType="HtmlFragment",i.LogLevel=o?"Error":"Information",i.Message=t,i.ClientContext={AppInfoClientName:_.Z.GetClientName(),JSVersion:I.yJ};const r=[JSON.stringify(i)];R.R.postMessageToHost("LogScriptTelemetryV2",r)}MaskPiiData(e,t){const o=e?.getElementsByTagName("*"),i=new Set(["script"]),r=performance.now();try{for(let e=0;e<=o?.length;e++){let a=!1;const n=performance.now();if(n-r>3e5)return void this.sendConfirmationPageHtmlFragmentLogError(window.location.pathname,t,"Masking timeout",(n-r).toString());if(void 0!==o[e]&&null!==o[e]&&null!==o[e].textContent){if("yes"===o[e].getAttribute("data-processed"))continue;(i.has(o[e].tagName?.toLowerCase())||this.DISALLOWED_NAMES.has(o[e].getAttribute("name")))&&(this.maskTextNodes(o[e]),a=!0);const t=o[e].getAttributeNames();for(const i of t)for(const t of this.DISALLOWED_NAMES)if(o[e].getAttribute(i)?.toLowerCase()?.includes(t)){a||(this.maskTextNodes(o[e]),a=!0),o[e].setAttribute("value","****");break}o[e].setAttribute("data-processed","yes")}}}catch(e){this.sendConfirmationPageHtmlFragmentLogError(window.location.pathname,t,"Masking error: "+e,(performance.now()-r).toString())}return!0}maskTextNodes(e){if(e&&"yes"!==e.getAttribute("data-processed")){"SCRIPT"===e.tagName?.toLocaleUpperCase()&&(e.textContent="Mask script content");for(const t of e.children)3===t.nodeType||4===t.nodeType?t.textContent="Masked":this.maskTextNodes(t),t.setAttribute("data-processed","yes");e.setAttribute("data-processed","yes")}}cloneNodeWithPlaceholders(e,t,o){if(performance.now()-o>12e4)return null;if("SCRIPT"===e.tagName?.toLocaleUpperCase())return null;if(e.nodeType===Node.TEXT_NODE){const o=e.cloneNode(!1);return t&&(o.textContent="*****"),o}if(e.nodeType===Node.ELEMENT_NODE){if("hidden"===window.getComputedStyle(e).visibility)return null;if(!this.IsBatBeaconFound){const t=e.getAttribute("id");if(t&&t.startsWith("batBeacon"))return null;this.IsBatBeaconFound=!0}const t=e.cloneNode(!1);let i=!1;const r=e.getAttributeNames();for(const t of r){if(this.DISALLOWED_NAMES.has(t.toLowerCase())){i=!0;break}for(const o of this.DISALLOWED_NAMES)if(e.getAttribute(t)?.toLowerCase()?.includes(o)){i=!0;break}if(i)break}for(const r of e.childNodes){const e=this.cloneNodeWithPlaceholders(r,i,o);e&&t.appendChild(e)}return t}return null}async getSymmetricEncryptionKey(){const e=await window.crypto.subtle.generateKey({name:"AES-GCM",length:128},!0,["encrypt","decrypt"]),t=await window.crypto.subtle.exportKey("raw",e);return this.bufferToBase64(t)}bufferToBase64(e){return window.btoa(String.fromCharCode(...new Uint8Array(e)))}base64ToBuffer(e){const t=window.atob(e),o=t.length,i=new Uint8Array(o);for(let e=0;e<o;e++)i[e]=t.charCodeAt(e);return i.buffer}concatArrayBuffers(e,t){const o=new Uint8Array(e.byteLength+t.byteLength);return o.set(new Uint8Array(e),0),o.set(new Uint8Array(t),e.byteLength),o.buffer}async encryptData(e,t){const o=(new TextEncoder).encode(t),i=await window.crypto.subtle.importKey("raw",this.base64ToBuffer(e),"AES-GCM",!0,["encrypt","decrypt"]),r=window.crypto.getRandomValues(new Uint8Array(12)),a={iv:r,name:"AES-GCM"},n=await window.crypto.subtle.encrypt(a,i,o),s=this.concatArrayBuffers(r.buffer,n);return this.bufferToBase64(s)}async encryptSymmetricKey(e,t){const o=await crypto.subtle.importKey("spki",this.base64ToBuffer(e),{name:"RSA-OAEP",hash:{name:"SHA-256"}},!1,["encrypt"]),i=await crypto.subtle.encrypt({name:"RSA-OAEP"},o,(new TextEncoder).encode(t));return this.bufferToBase64(i)}sendConfirmationPageHtmlFragmentLogError(e,t,o,i){const r={Domain:t,EncryptionKey:"",HtmlFragment:"",OrderConfirmationPageUrl:e,TimeToMask:i};this.sendConfirmtionPageLog(r,o,!0)}},x=o(11050),H=o(73557),V=o(55590),K=o(8018),W=o(50607),z=o(3634),Q=o(4872),J=o(31656),Y=o(18491),X=o(47746),$=class{constructor(e){(0,i.Z)(this,"ShownOffers",void 0),(0,i.Z)(this,"ImpressionId",void 0),e?(this.ShownOffers=e.ShownOffers??[],this.ImpressionId=e.ImpressionId):(this.ShownOffers=[],this.ImpressionId="")}},j=o(9448),q=o(41310),ee=o(57550),te=o(82315),oe=o(1094),ie=o(41865),re=o(95457),ae=o(47594),ne=o(21488),se=class{constructor(){(0,i.Z)(this,"AutoShowEventsMap",void 0),(0,i.Z)(this,"ActiveAutoShowType",void 0),(0,i.Z)(this,"TotalCashbackAmount",0),this.AutoShowEventsMap={},this.ActiveAutoShowType=null}};class ce{constructor(){(0,i.Z)(this,"pageVisitId",void 0),(0,i.Z)(this,"retailerSessionId",void 0),(0,i.Z)(this,"sessionId",void 0)}static Create(e){const t=new ce;return t.pageVisitId=e?.pageVisitId,t.retailerSessionId=e?.retailerSessionId,t.sessionId=e?.sessionId,t}}var le=ce,ue=o(33408);function de(e){const t=e?.confirmationDetails;return!!(t&&t.transactionId&&t.purchaseTotal&&t.productNames)}var he=o(64865),pe=o(34802),ge=o(50978);function Ce(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function Se(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ce(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var me=class{constructor(){(0,i.Z)(this,"isPersonalizationDataConsentEnabled",void 0),(0,i.Z)(this,"cartExtractionSuccessful",void 0),(0,i.Z)(this,"mutationObserver",void 0)}async Init(){const e=Ue.GetLocalDataService(),t=e.GetCheckoutPageData(),o=e.GetImpressionId(),i=e.GetDomainName();if(!t.retailerData)return;this.isPersonalizationDataConsentEnabled=t.userInfo?.isPersonalizationDataConsentEnabled??e.IsP13nEnabled()??!1;const r=t.retailerData.getAutomatedSelectorsPageByRegex(location.href);r&&(r?.type!==p.u3.Checkout&&r?.type!==p.u3.Cart||(this.AddPersonalizedPromotionsButtonListeners(i,o,r),this.TryCheckAndCollectPersonalizedPromotionsRawInformation(i,o,r)))}async PostValidation(){}GetLastPersonalizedPromotionsCartData(){const e=(0,S.Mw)(ge.Vj);return e&&!(0,he.TF)(e)?JSON.parse(e):null}async TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,o,i){o&&this.CollectPersonalizedPromotionsCartData(e,t,o,i).catch((o=>{const i={domain:e,cartUrl:location.pathname};this.LogCartExtractionEvent(i,p.R.PersonalizedPromotionsExtractionError,o?.message,p.in.Error,t)}))}async ShouldCollectPersonalizedPromotionsCartData(e,t){const o=Date.now();return!(e&&!(0,he.TF)(t)&&t===e.OrderTotal&&!(0,he.TF)(e.RandomId)&&e.PageUrl===(0,v.Ek)()&&o-e.CartDataCreationTime<=m.l$)}async CollectPersonalizedPromotionsCartData(e,t,o,i){if(!o?.details)return;const r=new pe.Z;r.domain=e,r.pageType=o.type,r.pageUrl=(0,v.Ek)(),r.orderId=f.Z.GetBoxValue(o.details.orderId),r.randomId=h.Z.uuidv4();const a=o.details.orderTotalPrice;let n="";g.ZP.IsValidDataField(a)&&(n=await g.ZP.WaitForCondition((async()=>D.Z.RunQuerySelectorAll(a).length>0),5e3).then((async()=>f.Z.GetBoxValue(a))).catch((o=>{const i={cartId:r.randomId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(i,p.R.PersonalizedPromotionsExtractionError,o?.message,p.in.Error,t),""})));const s=this.GetLastPersonalizedPromotionsCartData();if(!s||this.ShouldCollectPersonalizedPromotionsCartData(s,n)){try{const r=new URL(window.location.href);this.AddPageMonitor(e,t,r,o,i)}catch(e){}try{if(r.orderTotal=n,r.orderSubtotal=f.Z.GetBoxValue(o.details.orderSubTotalPrice),r.productName=await this.GetItemizedProductData(o.details.productName),r.productItemPrice=await this.GetItemizedProductData(o.details.productItemPrice),r.productTotalPrice=await this.GetItemizedProductData(o.details.productTotalPrice),r.productPrice=await this.GetItemizedProductData(o.details.productPrice),r.productQuantity=await this.GetItemizedProductData(o.details.productQuantity),r.productId=await this.GetItemizedProductData(o.details.productId),g.ZP.IsValidDataField(o.details.productImgSelector)){const e=D.Z.RunQuerySelectorAll(o.details.productImgSelector);let t="";for(const o of e){const e=o?.getAttribute("alt");e&&(t+=e+"<SEP>")}r.productNameFromImg=t}this.LogPersonalizedPromotionsCartInfo(r,e,t)}catch(e){}}}LogPersonalizedPromotionsCartInfo(e,t,o){const i=h.Z.uuidv4();this.LogCartExtractionEvent(e,p.R.ShoppingPersonalizedPromotionsRawTable,"Successfully extracted Personalized Promotions Cart Information",p.in.Information,o,i,!0);const r=new ge.JR;r.Domain=e.domain,r.OrderTotal=e.orderTotal,r.PageType=e.pageType,r.PageUrl=e.pageUrl,r.OrderId=e.orderId,r.OrderSubtotal=e.orderSubtotal,r.ProductName=e.productName,r.ProductTotalPrice=e.productTotalPrice,r.ProductItemPrice=e.productItemPrice,r.ProductQuantity=e.productQuantity,r.ProductId=e.productId,r.ExtractionId=h.Z.uuidv4(),r.CartDataCreationTime=Date.now(),r.ProductPrice=e.productPrice,r.ProductNameFromImg=e.productNameFromImg,r.RandomId=e.randomId,(0,S.NN)()||this.LogCartExtractionEvent(e,p.R.PersonalizedPromotionsExtractionError,"No access to local storage",p.in.Error,o),(0,S.Xo)(ge.Vj,JSON.stringify(r)),this.SendPersistentPersonalizedPromotionsCartMessage(t,r,o)}async GetItemizedProductData(e,t=5e3){if(!e||(0,he.TF)(e))return"";let o;return await g.ZP.WaitForCondition((async()=>(o=D.Z.GetFirstVisibleElement(e??""),void 0!==o)),t),D.Z.GetItemizedData(e??"","<SEP>")}async AddPageMonitor(e,t,o,i,r){const a="true"===i.details?.addCartMonitor,n=i.details?.cartMonitorSelector;if(a){const o={attributes:!0,characterData:!0,childList:!0,subtree:!0};this.mutationObserver||(this.mutationObserver=new MutationObserver((async o=>{this.TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,i,r)})));const a=n??i?.details?.orderTotalPrice;if(a){await g.ZP.WaitForCondition((async()=>void 0!==D.Z.GetFirstVisibleElement(a)),5e3);const e=D.Z.GetFirstVisibleElement(a);e&&(this.mutationObserver?.disconnect(),this.mutationObserver?.observe(e,o))}}else this.mutationObserver?.disconnect()}SendPersistentPersonalizedPromotionsCartMessage(e,t,o){try{const o=L.Q?.PersonalizedPromotionsCartData??"",i=(0,v.BQ)(o)??{};i[e]={cartDataStorageInfo:t,timestamp:new Date};const r=JSON.stringify({value:JSON.stringify(i)});f.Z.SendStorageMessage("PersonalizedPromotionsCartData",r)}catch(e){this.LogCartExtractionEvent(t,p.R.PersonalizedPromotionsExtractionError,"Could not send cart data to storage:  "+e?.message,p.in.Error,o)}}async AddPersonalizedPromotionsButtonListeners(e,t,o){if(o?.details?.addToCartButton){const i=o.details.addToCartButton,r=await g.ZP.WaitForCondition((async()=>D.Z.HasVisibleElement(i)),5e3).then((async()=>D.Z.GetFirstVisibleElement(i)));r?.addEventListener("click",(async()=>{this.TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,o,!0)}))}else if(o?.details?.placeOrderButton){const i=o.details.placeOrderButton,r=await g.ZP.WaitForCondition((async()=>D.Z.HasVisibleElement(i)),5e3).then((async()=>D.Z.GetFirstVisibleElement(i)));r?.addEventListener("click",(async()=>{this.TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,o,!1)}))}}ShouldSendTelemetryData(e){return this.isPersonalizationDataConsentEnabled||e!==p.R.CartExtraction&&e!==p.R.TravelCheckoutExtraction&&e!==p.R.ShoppingPersonalizedPromotionsRawTable}LogCartExtractionEvent(e,t,o,i,r,a,n){let s={};this.ShouldSendTelemetryData(t)&&(s=e),n||(void 0===this.cartExtractionSuccessful&&(t===p.R.CartExtraction?this.cartExtractionSuccessful=!0:this.cartExtractionSuccessful=!1),s=Se(Se({},s),{},{isPersonalizationDataConsentEnabled:this.isPersonalizationDataConsentEnabled,extractionId:a??null})),f.Z.SendLogEventMessage(s,t,r,o,i)}},Ae=o(7355),Pe=o(57176),fe=o(29853),Ee=class{constructor(){(0,i.Z)(this,"noMatchYet",void 0),(0,i.Z)(this,"passedStorageValues",void 0),(0,i.Z)(this,"supportedPlatforms",[{checkoutPages:[{selectors:["[name='reductions'],#Form0 > div:nth-child(1) > div > button,#checkout_clear_discount + button","div > aside > div > div > div > div > section:nth-child(5)>div>div>div>div>div>strong"],url:"/checkouts/c"},{selectors:["#checkout_reduction_code,.field__input-btn,#checkout_clear_discount + button,.order-summary__toggle-discount","SPAN.payment-due__price"],url:"/checkouts"},{selectors:["#checkout_reduction_code,.field__input-btn,#checkout_clear_discount + button,.order-summary__toggle-discount","SPAN.payment-due__price"],url:"/securecheckout"}],name:"Shopify"},{checkoutPages:[{selectors:["INPUT[name='couponcode'],INPUT[name='couponcode'] + .button,INPUT[name='couponcode'] + .btn,.CouponCode .button,[class*='coupon'] .button,A[href*='removecoupon'],[class*='coupon-code-add']","[class*='cart-total-grand'],tr.SubTotal:nth-last-child(1) SPAN.ProductPrice"],url:"/cart.php"},{selectors:["INPUT[name='redeemableCode'],#applyRedeemableButton,A[data-test='cart-price-callback'],A.redeemable-label","DIV.cart-priceItem--total SPAN[data-test='cart-price-value']"],url:"/checkout"},{selectors:["#couponcode,#apply_code","TR.SubTotal:nth-last-child(1) .ProductPrice"],url:"/checkout.php"}],name:"BigCommerce"},{checkoutPages:[{selectors:["#coupon_code,#discount-coupon-form BUTTON.apply,#discount-coupon-form BUTTON.cancel",".grand.totals .amount SPAN.price"],url:"/checkout/cart"},{selectors:["#discount-code,#discount-form BUTTON.action-apply,#discount-form BUTTON.action-cancel",".grand.totals .amount SPAN.price"],url:"/checkout/"}],name:"Magento"},{checkoutPages:[{selectors:["#coupon_code,#discount-coupon-form BUTTON.apply,#discount-coupon-form BUTTON.cancel,[class*='showcoupon']","#shopping-cart-totals-table tfoot .price"],url:"/checkout/cart"}],name:"Magent2"},{checkoutPages:[{selectors:["#coupon_code,#discount-coupon-form BUTTON.apply,#discount-coupon-form BUTTON.cancel,#block-discount",".grand.totals .amount SPAN.price"],url:"/checkout/cart"},{selectors:["#discount-code,#discount-form > div > button,#discount-coupon-form BUTTON.cancel,#discount-accordion",".grand.totals .amount SPAN.price"],url:"/checkout/"}],name:"Magneto1"}])}TryCheckIfPlatformDomain(e){try{this.passedStorageValues=e,this.noMatchYet=!0,this.CheckIfPlatformDomain()}catch(e){this.LogError(e)}}CheckIfPlatformDomain(){for(const e of this.supportedPlatforms)for(const t of e.checkoutPages)g.ZP.IsOnPage(t.url,location.pathname)&&g.ZP.WaitForSyncCondition((()=>this.CheckIfRequiredSelectorsExist(t.selectors)),1e4).then((t=>this.LogPlatformMatch(e.name,t)))}CheckIfRequiredSelectorsExist(e){for(const t of e)if(!D.Z.GetFirstMatchingElement(t))return!1;return this.noMatchYet&&(this.noMatchYet=!1,this.TriggerSuggestedCouponService(),this.TriggerCouponSavingsService(e)),!0}LogPlatformMatch(e,t){t?this.SendPlatformFoundMessage(e):this.SendPlatformFoundMessage("Not"+e)}LogError(e){const t={Domain:(0,v.S8)(),PageUrl:"",Status:"Error"};f.Z.SendLogEventMessage(t,p.R.PlatformDetection,"",e?.message??"Error detecting platform",p.in.Information)}SendPlatformFoundMessage(e){f.Z.SendMessage(j.H.PlatformExpansionDomain,[e])}TriggerSuggestedCouponService(){this.passedStorageValues&&(Ue.GetSuggestedCouponService(!0).Init(),Ue.GetSuggestedCouponService(!0).Update(Pe.s3.CheckoutPage,[]))}TriggerCouponSavingsService(e){const t=[...e[0].split(","),e[1]],o=this.CreateCheckoutPageUrlData(t);Ue.GetCouponSavingsService().TryListenForCoupon(o,[],"","",!0)}CreateCheckoutPageUrlData(e){const t=new fe.Z;return t.inputBoxSelector=e[0],t.orderTotalDataElementSelector=e[e.length-1],t.applyButtonSelector=e.length>=3?e[1]:"",t}},Te=o(71951),Oe=o(46261),Ie=o(90650),_e=o(87869),ve=o(93970),Re=class{constructor(e,t){(0,i.Z)(this,"validator",void 0),(0,i.Z)(this,"CEService",void 0),(0,i.Z)(this,"domainName",void 0),this.validator=e,this.CEService=t}async SetUpPurchaseConfirmation(e,t,o,i,r){try{this.domainName=o;const a=await this.IsFinalCheckoutPage(e),n=e.retailerData.getCurrentFinalCheckoutPage(),s=(0,v.uf)(e?.market,e.retailerData?.exclusiveMarket);let c=await oe.Z.GetOrderTotal(n,s,t,o);ve.ZP.sendFinalCheckoutValidationLog(this.domainName,a,t,"",c);const l=this.CEService.GetLastCartData();a?this.ListenForPurchaseConfirmation(e,c,t,l?.CartId??"",i,r):n?.domMutationEnabled&&g.ZP.ObserveUntil((()=>D.Z.HasVisibleElement(n.finalCheckoutButtonSelector)),(async()=>{c=await oe.Z.GetOrderTotal(n,s,t,o),ve.ZP.sendFinalCheckoutValidationLog(this.domainName,!0,t,"",c),this.ListenForPurchaseConfirmation(e,c,t,l?.CartId??"",i,r)}))}catch(e){const o=e?.message??"checkoutpage purchase confirmation error.";f.Z.SendPurchaseConfirmationLog(this.domainName,t,o,"error","",void 0)}}async IsFinalCheckoutPage(e){const t=e.retailerData.getCurrentFinalCheckoutPage();return!(!t||(0,he.TF)(t.finalCheckoutButtonSelector))&&(await g.ZP.WaitForCondition((async()=>D.Z.HasVisibleElement(t.finalCheckoutButtonSelector)),5e3),D.Z.HasVisibleElement(t.finalCheckoutButtonSelector))}ListenForPurchaseConfirmation(e,t,o,i,r,a){const n=e.retailerData.getCurrentFinalCheckoutPage();if(n&&!(0,he.TF)(n.finalCheckoutButtonSelector)){const s=D.Z.GetAllVisibleElements(n.finalCheckoutButtonSelector);for(const c of s)c.addEventListener("click",(async()=>{this.validator.SendPurchaseConfirmationMessage(),f.Z.SendPurchaseConfirmationLog(this.domainName,o,"User completed purchase","completed",i,t),this.ConfirmPurchase(n,i,o,t);try{const t=(0,v.uf)(e?.market,e.retailerData?.exclusiveMarket),i=e.retailerData?.getCurrentAutomatedSelectorsPage(location.href);this.CEService.TryCheckAndCollectCartInformation(e.retailerData.domainName,o,n,t,a,i,r)}catch{}try{J.R.isExperimentActive(Q.H.injectConfirmationScriptUponPurchaseCompletion)&&f.Z.SendStorageMessage("CompletedPurchase",JSON.stringify({value:!0})),f.Z.SendStorageMessage("CompletedPurchaseConf",JSON.stringify({value:!0}))}catch(e){}}))}}async ConfirmPurchase(e,t,o,i){const r=new Oe.GA;r.CheckoutButtonClicked=!0,r.CheckoutTime=Date.now(),r.CartId=t,r.CartValue=i,(0,S.Xo)(Oe.Wi,JSON.stringify(r)),await g.ZP.Sleep(5e3);let a=new _e.L;g.ZP.WaitForCondition((async()=>(a=this.DidPurchaseSucceed(e),a.indicators.length>0)),5e3).then((()=>{this.LogPurchaseStatusAndCleanUp(a.purchaseFailed,o,t,i,a.indicators),a.purchaseFailed||(0,S.UZ)(m.OY)})).catch((e=>{f.Z.SendPurchaseConfirmationLog(this.domainName,o,e?.message??"Error evaluating purchase status on checkout script","error",t,i)}))}DidPurchaseSucceed(e){const t=new _e.L;if(t.indicators=[],t.purchaseFailed=!1,D.Z.GetAllVisibleElements(e.finalCheckoutButtonSelector).length>0)return t.purchaseFailed=!0,t.indicators.push(_e.c.finalCheckoutButtonVisible),t;const o=D.Z.GetFirstVisibleElement("body");return Ie.ZP.PageIncludesPaymentKeyWords(o?.innerText.toLocaleLowerCase(),Ie.lD)?(t.indicators.push(_e.c.successfulPaymentKeywordsFound),t.purchaseFailed=!1,t):(Ie.ZP.PageIncludesPaymentKeyWords(o?.innerText.toLocaleLowerCase(),Ie.si)&&(t.purchaseFailed=!0,t.indicators.push(_e.c.failurePaymentKeywordsFound)),D.Z.GetAllVisibleElements("input").length>0&&(t.purchaseFailed=!0,t.indicators.push(_e.c.inputFieldsFound)),t)}LogPurchaseStatusAndCleanUp(e,t,o,i,r){(0,S.UZ)(Oe.Wi),e||(0,S.Mw)(Te.y$.autoApplyStorageKey)===Te.M4.ActionDetected&&(f.Z.SendStringStorageMessage(Te.y$.completedPurchaseStorageKey,Te.M4.ActionDetected),(0,S.Xo)(Te.y$.completedPurchaseStorageKey,Te.M4.ActionDetected));const a=e?"Failed":"Succeeded";f.Z.SendPurchaseConfirmationLog(this.domainName,t,JSON.stringify(r),a,o,i)}},De=o(84178);class Ne{async QueryWebAssistUrls(e,t,o){return Ne.waiting=!0,Ne.mojomResponse=void 0,U.p.postMessageToHost("QueryWebAssistUrls",[e,...t]),await g.ZP.WaitForCondition((async()=>!Ne.waiting),7e3),Ne.mojomResponse}ProcessWebAssistResponse(e){try{Ne.mojomResponse=JSON.parse(e)}catch(e){Ne.mojomResponse=void 0}finally{Ne.waiting=!1}}}(0,i.Z)(Ne,"waiting",void 0),(0,i.Z)(Ne,"mojomResponse",void 0);var ye=Ne,be=o(69442);class ke{static GetValidatorModule(){return this.validator}static GetGroceryCBService(){return this.groceryCBService||(this.groceryCBService=new l.Z),this.groceryCBService}static GetZipCardService(){return this.zipCardService||(this.zipCardService=new be.Z),this.zipCardService}static GetCartExtractionService(){return(0,y.X)()}static GetPersonalizedPromotionsCartExtractionService(){return this.personalizedPromotionsCartExtractionService||(this.personalizedPromotionsCartExtractionService=new me),this.personalizedPromotionsCartExtractionService}static GetPinterestService(){return this.pinterestService||(this.pinterestService=new Ae.Z),this.pinterestService}static GetCatalogExtractionService(){return this.catalogExtractionServie||(this.catalogExtractionServie=new b.Z),this.catalogExtractionServie}static GetPlatformDetectionService(){return this.platformDetectionService||(this.platformDetectionService=new Ee),this.platformDetectionService}static GetAutoApplyService(){return this.autoApplyService||(this.autoApplyService=new n.Z),this.autoApplyService}static GetHtmlFragmentCollectionService(){return this.htmlFragmentCollectionService||(this.htmlFragmentCollectionService=new G),this.htmlFragmentCollectionService}static GetCancellationPageDataExtractionService(){return this.cancellationPageDataExtractionService||(this.cancellationPageDataExtractionService=new N),this.cancellationPageDataExtractionService}static GetCouponSavingsService(){return this.couponSavingsService||(this.couponSavingsService=new w.Z),this.couponSavingsService}static GetAutomaticCartExtractionService(){return this.automaticCartExtractionService||(this.automaticCartExtractionService=new class{constructor(e){(0,i.Z)(this,"webAssistQueryService",void 0),this.webAssistQueryService=e}async TryCollectCartInformation(e,t,o,i,r,a,n){try{await this.CollectCartInformation(e,t,o,i,r,a,n)}catch(t){const o={cartId:n??"",cartUrl:location.pathname,domain:e};this.LogCartExtractionEvent(o,p.R.CartExtraction,t?.message,p.in.Error,i)}}async CollectCartInformation(e,t,o,i,r,a,n){const s=new A.Z;s.domain=e,s.cartValue=t.OrderTotal,s.currency=t.Currency,s.cartUrl=location.pathname,s.cartId=n??h.Z.uuidv4(),s.products=[];let c,l=0,u=null,d=null;if(await(0,g.dz)((async()=>(c=document.querySelectorAll("img"),void 0!==c&&c.length>0)),5e3),await(0,g._R)(1e4),c=document.querySelectorAll("img"),void 0===c||c.length<=0){const e="Unable to automatically find products in cart";this.LogCartExtractionEvent(s,p.R.CartExtractionError,e,p.in.Error,i)}else{for(const t of c){if(!this.isVisible(t))continue;if(this.isAtTopOfPage(t))continue;if(0===l&&!this.isInViewPort(t))continue;const o=this.findProductContainer(t);if(0===l&&t.offsetHeight>0){const i=this.isPotentialCartItem(t,o,e);if(!i||!o)continue;l=t.offsetHeight,u=o,s.products.push(i)}else if(l===t.offsetHeight){const i=this.isPotentialCartItem(t,o,e);if(!i||!o)continue;if(null==d){if(!u)continue;if(d=this.getCommonParent(u,o),null==d)continue}const r=Node.DOCUMENT_POSITION_CONTAINED_BY;if(!(d.compareDocumentPosition(o)&r))continue;s.products.push(i)}}if(await this.augmentWithWebAssist(s.products,e,r,a),s.products=[],s.products?.length>0){const e="Successfully automatically extracted Cart Information";this.LogCartExtractionEvent(s,p.R.CartExtraction,e,p.in.Information,i),this.StoreCartInfoInLocalStorage(s,t)}else{const o=this.scrapeCandidateUrls(e),n=await this.generateWebassistProducts(o,r,a);if(n?.length>0){s.products=n;const e="Successfully automatically extracted Cart Information via webassist scraping";this.LogCartExtractionEvent(s,p.R.CartExtraction,e,p.in.Information,i),this.StoreCartInfoInLocalStorage(s,t)}else{const e="Unable to automatically get enough info about products in cart";this.LogCartExtractionEvent(s,p.R.CartExtractionError,e,p.in.Error,i)}}}}async augmentWithWebAssist(e,t,o,i){if(!e||0===e.length)return;const r=e.map((e=>this.normalizeUrl(e.productUrl,t))),a=await this.webAssistQueryService.QueryWebAssistUrls(o,r,i);a&&e.forEach((e=>{if(e?.productUrl){const o=this.normalizeUrl(e.productUrl,t);if(this.HasValidWebAssistEntry(a,o)){const t=a[o];t.entity&&this.AugmentProductWithWebAssistProduct(e,t)}}}))}normalizeUrl(e,t){return e?e.startsWith("http")?e:`https://www.${t}${e}`:""}isVisible(e){return e.offsetHeight>0&&e.offsetWidth>0&&"hidden"!==e.style.visibility&&"none"!==e.style.display}isAtTopOfPage(e){return window.pageYOffset+(e.getBoundingClientRect()?.top??0)<200}isInViewPort(e){const t=e.getBoundingClientRect(),o=t.left,i=t.top;return!0===document.elementFromPoint(o,i)?.isSameNode(e)}isPotentialCartItem(e,t,o){if(null==t)return null;const i=t.tagName.toLocaleLowerCase();if("html"===i||"body"===i)return null;const r=[...t.querySelectorAll("a")].filter((e=>f.Z.IsValidPDPUrlHeuristic(e.href,o)));if(r.length<=0)return null;const a=r[0],n=a.href,s=new P.Z;s.productUrl=n;let c=a.innerText??a.getAttribute("title");if(""===c&&r.length>1)for(let e=1;e<r.length&&""===c;e++)c=r[e].innerText??r[e].getAttribute("title");""===c&&(c=e.getAttribute("title")??e.getAttribute("alt")??""),s.productTitle=c,s.productImg=e.getAttribute("src")??"";const l=this.GetPrices(t);return l?.length&&(s.productPrice=this.GetMinimumPrice(l)),s}GetMinimumPrice(e){const t=(0,C.cU)(e[0]);return Math.min(...e.map((e=>parseFloat(e.replace(t,"").replace(/,/g,"")))))}findProductContainer(e){let t=e.parentElement;for(;null!=t&&"BODY"!==t.nodeName;){const e=this.GetPrices(t);if(e?.length&&t.querySelector("a"))return t;t=t.parentElement}return null}GetPrices(e){const t=(0,C.cU)(e.innerText);if(t&&(0,C.$g)(t)){const o=new RegExp("("+(0,C.So)(t)+"[0-9,]+(?:.[0-9]{1,2}){0,1})","g");return e.innerText.match(o)}return[]}getCommonParent(e,t){let o=e.parentElement;if(e===t)return o;if(null==o)return null;const i=Node.DOCUMENT_POSITION_CONTAINED_BY;let r=o.compareDocumentPosition(t);for(;!(r&i);){if(o=o.parentElement,null==o)return null;r=o.compareDocumentPosition(t)}const a=o.tagName.toLocaleLowerCase();return"html"===a||"body"===a?null:o}HasValidWebAssistEntry(e,t){return e.hasOwnProperty(t)}AugmentProductWithWebAssistProduct(e,t){const o=t.entity;e.foundInWebAssist=!0,e.webAssistTitle=t.title??o.name,e.webAssistImg=o.image;const i=this.CleanWebAssistPrice(o.price_value);i&&(e.webAssistPrice=i)}scrapeCandidateUrls(e){const t=Array.from(document.querySelectorAll("a")).filter((e=>e.href&&""!==e.href&&"#"!==e.href)).filter((e=>!this.isAtTopOfPage(e))).map((e=>e.href)).filter((t=>f.Z.IsValidPDPUrlHeuristic(t,e)));return[...new Set(t)]}async generateWebassistProducts(e,t,o){const i=await this.webAssistQueryService.QueryWebAssistUrls(t,e,o),r=[];if(i)for(const e in i)if(i[e].entity){const t=new P.Z;t.productUrl=e,this.AugmentProductWithWebAssistProduct(t,i[e]),r.push(t)}return r}LogCartExtractionEvent(e,t,o,i,r){const a=Ue.GetLocalDataService(),n=a.GetSessionIds()?.retailerSessionId??"",s=a.GetSessionIds()?.pageVisitId??"";e=T(T({},e),{},{PageVisitId:s,RetailerSessionId:n}),f.Z.SendLogEventMessage(e,t,r,o,i)}StoreCartInfoInLocalStorage(e,t){const o=new m.Vr;o.OrderTotal=t.OrderTotal,o.CartDataCreationTime=Date.now(),o.CartId=e.cartId,(0,S.Xo)(m.OY,JSON.stringify(o))}CleanWebAssistPrice(e){if(e)try{const t=(e=e.replace(/\s/g,"")).split("-");return(0,C.K)(t[0])}catch(e){}}}(ke.GetWebAssistQueryService())),this.automaticCartExtractionService}static GetPurchaseDetectionService(){return this.purchaseDetectionService||(this.purchaseDetectionService=new Re(ke.GetValidatorModule(),ke.GetCartExtractionService())),this.purchaseDetectionService}static GetICValidatorService(){return this.icValidatorService}static GetIcSearchProcessorService(){return this.icSearchProcessorService}static GetIcPDPProcessorService(){return this.icPDPProcessorService}static GetLocalDataService(){return this.localDataService}static GetValidationMessageService(){return this.validationMessageService}static GetAutosMarketplaceService(){return this.autosMarketplaceService}static GetWebAssistQueryService(){return this.webAssistQueryService||(this.webAssistQueryService=new ye),this.webAssistQueryService}static GetSuggestedCouponService(e=!1){return this.suggestedCouponsService||(this.suggestedCouponsService=new r.Z(f.Z.SendStorageMessage.bind(f.Z),e)),this.suggestedCouponsService}static GetOtherSellersService(){return this.otherSellersService}static GetAAConsentService(){return this.aaConsentService}static GetProductBestCouponConsentService(){return this.productBestCouponConsentService}static GetClippingService(){return this.clippingService}static GetClientRequestsService(){return this.clientRequestsService}static GetPageDetectionService(){return this.pageDetectionService}static GetBackgroundAAService(){return this.backgroundAAService}}(0,i.Z)(ke,"localDataService",new class{constructor(){(0,i.Z)(this,"impressionId",void 0),(0,i.Z)(this,"icNotificationType",void 0),(0,i.Z)(this,"mapData",void 0),(0,i.Z)(this,"userInfo",void 0),(0,i.Z)(this,"clientInfo",void 0),(0,i.Z)(this,"isRebatesEnabled",void 0),(0,i.Z)(this,"isP13nEnabled",void 0),(0,i.Z)(this,"isEdgeProfileRebatesUser",void 0),(0,i.Z)(this,"consentCanPrompt",void 0),(0,i.Z)(this,"itemLevelCashBackDta",void 0),(0,i.Z)(this,"domainName",void 0),(0,i.Z)(this,"traceId",void 0),(0,i.Z)(this,"isClippingSent",void 0),(0,i.Z)(this,"submittedIds",void 0),(0,i.Z)(this,"personalizedCashbackData",void 0),(0,i.Z)(this,"isPendingTransactionPresent",!1),(0,i.Z)(this,"searchApiRequestSentTimestamp",0),(0,i.Z)(this,"merchantData",void 0),(0,i.Z)(this,"coupons",void 0),(0,i.Z)(this,"isFinalCheckoutPage",void 0),(0,i.Z)(this,"isAOCActive",void 0),(0,i.Z)(this,"market",void 0),(0,i.Z)(this,"isExpressCheckoutPage",void 0),(0,i.Z)(this,"muid",void 0),(0,i.Z)(this,"params",void 0),(0,i.Z)(this,"isAADSignedIn",void 0),(0,i.Z)(this,"hasValidLinkedAccount",void 0),(0,i.Z)(this,"sessionIds",void 0),(0,i.Z)(this,"ConfirmationPageData",void 0),(0,i.Z)(this,"autoApplyStatus",!1),(0,i.Z)(this,"isCheckoutPage",void 0),(0,i.Z)(this,"userSettingsData",void 0),this.mapData=new Map,this.userInfo=new ne.Z,this.clientInfo=new ie.Z,this.isExpressCheckoutPage=!1}SetParams(e){this.params=e}SetImpressionId(e){this.impressionId=e}SetDomainName(e){this.domainName=e}EarlyFetchConfirmationPageData(e){this.ConfirmationPageData=async function(e,t){if(!e||!t||!function(e,t){return!(!e||!t)&&new RegExp(e,"i").test(t)}(e.orderConfirmationPageUrl,t))return Promise.resolve(void 0);const o=await(0,ue._p)(e.confirmationPageTelemetry,e.domainName);return o?.confirmationDetails?{confirmationDetails:o.confirmationDetails,canNotifyOnConfirmationPage:de(o)}:void 0}(e,(0,v.Ek)())}EarlyFetchIsCheckoutPage(e){this.isCheckoutPage=oe.Z.isCheckoutPageBySelectors(e,Ue.GetValidatorModule())}async GetConfirmationPageData(e){return this.ConfirmationPageData||this.EarlyFetchConfirmationPageData(e),await this.ConfirmationPageData}async GetIsCheckoutPage(e){return this.isCheckoutPage||this.EarlyFetchIsCheckoutPage(e),await this.isCheckoutPage}SetMarket(e){this.market=e}SetICNotificationType(e){this.icNotificationType=e}SetTraceId(e){this.traceId=e}SetIsClippingSent(e){this.isClippingSent=e}SetCheckoutPageData(e){this.merchantData=e}SetCoupons(e){this.coupons=e}SetIsFinalCheckoutPage(e){this.isFinalCheckoutPage=e}SetIsAOCActive(e){this.isAOCActive=e}GetParams(){return this.params}GetIsAOCActive(){return this.isAOCActive}GetIsFinalCheckoutPage(){return this.isFinalCheckoutPage}GetCheckoutPageData(){return this.merchantData}GetCoupons(){return this.coupons}GetIsClippingSent(){return this.isClippingSent}GetTraceId(){return this.traceId}GetMarket(){return this.market}GetICNotificationType(){return this.icNotificationType}GetImpressionId(){return this.impressionId??""}GetDomainName(){return this.domainName??""}SetIsExpressCheckoutPage(e){this.isExpressCheckoutPage=e}IsExpressCheckoutPage(){return this.isExpressCheckoutPage}SetItemLevelCashbackData(e){this.itemLevelCashBackDta=e}SetClientInfo(e){this.clientInfo=e}GetClientInfo(){return this.clientInfo}SetSubmittedIds(e){this.submittedIds=e}GetSubmittedIds(){return this.submittedIds}SetIsRebatesEnabled(e){this.isRebatesEnabled=e}IsrebatesEnabled(){return this.isRebatesEnabled}SetIsP13nEnabled(e){this.isP13nEnabled=e}IsP13nEnabled(){return this.isP13nEnabled}SetIsEdgeProfileRebatesUser(e){this.isEdgeProfileRebatesUser=e}IsEdgeProfileRebatesUser(){return this.isEdgeProfileRebatesUser}SetConsentCanPrompt(e){this.consentCanPrompt=e}ConsentCanPrompt(){return this.consentCanPrompt}SetIsAADSignedIn(e){this.isAADSignedIn=e}IsAADSignedIn(){return this.isAADSignedIn}SetHasValidLinkedAccount(e){this.hasValidLinkedAccount=e}HasValidLinkedAccount(){return this.hasValidLinkedAccount}GetItemLevelCashbackData(){return this.itemLevelCashBackDta}SetUserInfo(e){this.userInfo=e}GetUserInfo(){return this.userInfo}GetData(e){return this.mapData.get(e)}SetData(e,t){return this.mapData.set(e,t)}SetAutoApplyStatus(e){this.autoApplyStatus=e||this.autoApplyStatus}GetAutoApplyStatus(){return this.autoApplyStatus}SetPersonalizedAdsResponse(e){this.personalizedCashbackData=e}GetPersonalizedAdsResponse(){return this.personalizedCashbackData}SetIsPendingTransactionPresent(e){this.isPendingTransactionPresent=e}GetIsPendingTransactionPresent(){return this.isPendingTransactionPresent}SetSearchApiRequestSentTimestamp(e){this.searchApiRequestSentTimestamp=e}GetSearchApiRequestSentTimestamp(){return this.searchApiRequestSentTimestamp}SetSessionIds(e){this.sessionIds=le.Create(e)}SetUserSettingsData(e,t,o){if(o&&!(e.length<=t))try{this.userSettingsData=JSON.parse(e[t])}catch(e){}}GetUserSettingsData(){return this.userSettingsData}GetSessionIds(){return this.sessionIds}SetMuidFromUHId(e){if(e)try{const t=window.atob(e);t&&(this.muid=t)}catch(e){}}GetMuid(){return this.muid}}),(0,i.Z)(ke,"validationMessageService",new De.Z),(0,i.Z)(ke,"validator",new ve.ZP(ke.GetLocalDataService())),(0,i.Z)(ke,"personalizedPromotionsCartExtractionService",new me),(0,i.Z)(ke,"zipCardService",new be.Z),(0,i.Z)(ke,"groceryCBService",void 0),(0,i.Z)(ke,"catalogExtractionServie",new b.Z),(0,i.Z)(ke,"automaticCartExtractionService",void 0),(0,i.Z)(ke,"purchaseDetectionService",new Re(ke.GetValidatorModule(),ke.GetCartExtractionService())),(0,i.Z)(ke,"platformDetectionService",new Ee),(0,i.Z)(ke,"htmlFragmentCollectionService",new G),(0,i.Z)(ke,"cancellationPageDataExtractionService",new N),(0,i.Z)(ke,"couponSavingsService",new w.Z),(0,i.Z)(ke,"autosMarketplaceService",new O.Z),(0,i.Z)(ke,"icValidatorService",new class{constructor(){(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"validationMessageService",void 0),(0,i.Z)(this,"domainData",void 0),(0,i.Z)(this,"apiResponse",void 0)}async Init(){this.apiResponse=te.Z.getApiResponse(),this.localDataService=Ue.GetLocalDataService(),this.validationMessageService=Ue.GetValidationMessageService();const e=ie.Z.Create(this.apiResponse),t=ne.Z.Create(this.apiResponse);this.domainData=re.Z.Create(this.apiResponse?.itemLevelCashBack?.domainData||""),this.localDataService.SetUserInfo(t),this.localDataService.SetClientInfo(e),this.localDataService.SetSubmittedIds(this.apiResponse?.itemLevelCashBack?.submittedOfferIds||[]),this.localDataService.SetPersonalizedAdsResponse(this.apiResponse?.personalizedAdsResponse?.personalizedCashback),this.localDataService.SetData("variations",JSON.stringify(this.apiResponse?.itemLevelCashBack?.variations));const o=L.Q?.ICIsPendingTransactionPresent??!1;this.localDataService.SetIsPendingTransactionPresent(o),this.apiResponse?.itemLevelCashBack?.isCashBackEnabled&&this.localDataService.SetItemLevelCashbackData(this.apiResponse.itemLevelCashBack)}CanAutoOpen(e){const t=this.localDataService.GetItemLevelCashbackData();if(!t?.isCashBackEnabled)return Promise.resolve(!1);let o=this.ValidateGroceryCashback(e);if(o)if(this.localDataService.GetICNotificationType()===K.c.Search||this.localDataService.GetICNotificationType()===K.c.Category||this.localDataService.GetICNotificationType()===K.c.ActivatedOffers){let e=!1;const t=this.apiResponse.retailerData.getCurrentCheckoutPage();if(t){const i=oe.Z.GetInitialFields(this.apiResponse);(t?.orderTotalDataElementSelector||i.length>0)&&(e=!0,o=!1)}if(!e)return Promise.resolve(!1)}else this.localDataService.GetICNotificationType()!==K.c.GroceryAutoShow&&this.localDataService.GetICNotificationType()!==K.c.AddedToCartPDP||q.Z.IsVariationString(this.localDataService,`gcbAutoshow-${this.localDataService.GetICNotificationType()}`,"disabled")&&(f.Z.SendStringStorageMessage(V.Q.ICNotificationType,""),o=!1);return Promise.resolve(o)}PostValidation(){return Promise.resolve()}GetPopupOriginationList(){return[H.sR.AUTO_SHOW_SPB_CASHBACK_LANDING,H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING,H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK]}async CanAutoOpenForFeature(e){const t=this.localDataService.GetItemLevelCashbackData();if(!t?.isCashBackEnabled)return Promise.resolve(!1);const o=this.ValidateGroceryCashback(),i=this.localDataService.GetICNotificationType();switch(e){case H.sR.AUTO_SHOW_SPB_CASHBACK_LANDING:return!1;case H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING:return o&&(i===K.c.GroceryAutoShow||i===K.c.AddedToCartPDP);case H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK:return Boolean(o&&i===K.c.Activated&&L.Q?.GroceryCashbackItem)}return!1}IsSeachPage(e,t){const o={isSerp:!1,searchKey:""};if(t&&t.SearchData){const i=q.Z.IsUrlMatchAll(e,t.SearchData);o.isSerp=i.isMatch,o.searchKey=i.matchKey}return o}IsCategoryPage(e,t){const o={isCategory:!1,categoryId:""};if(t&&t.CategoryData){const i=q.Z.IsUrlMatchAll(e,t.CategoryData);o.isCategory=i.isMatch,o.categoryId=i.matchKey}return o}SendGetCashbackMessage(e,t,o,i){const r=[];o===Y.x.Search?r.push({keyword:t}):o===Y.x.Category?r.push({category:t}):o===Y.x.Offers&&t.split(",").forEach((e=>{r.push({offerId:e})}));const a=this.localDataService.GetUserInfo(),n=this.localDataService.GetClientInfo(),s=this.localDataService.IsrebatesEnabled(),c=this.localDataService.IsP13nEnabled(),l=this.localDataService.IsEdgeProfileRebatesUser(),u=this.localDataService.ConsentCanPrompt(),d=this.localDataService.GetIsPendingTransactionPresent(),h={ageGroup:a.ageGroup,clientContext:i,consentCanPrompt:u,domainName:e,isAADSignedIn:a.isAADSignedIn,isAnonymousFlowEnabled:a.isAnonymousFlowEnabled,isPendingTransaction:d,isEdgeProfileRebatesUser:l,isOffTheRecord:n.isOffTheRecord,isPersonalizationDataConsentChanged:a.isPersonalizationDataConsentChanged,isPersonalizationDataConsentEnabled:a.isPersonalizationDataConsentEnabled,isPersonalizationDataConsentEnabledV2:c,isRebatesEnabled:s,isRebatesUser:a.isRebatesUser,jsVersion:I.W1,pageUrl:(0,v.Ek)(),queries:r,queryType:o};this.localDataService.SetSearchApiRequestSentTimestamp((new Date).getTime()),this.validationMessageService.SendMessage(j.H.GetCashBack,[JSON.stringify(h)])}ValidateGroceryCashback(e){try{const t=new URL((0,v.Ek)()),o=this.localDataService.GetItemLevelCashbackData(),i=this.localDataService.GetCheckoutPageData(),r=this.localDataService.GetClientInfo(),a=this.localDataService.GetUserInfo(),n=this.domainData;if(this.validationMessageService.SendStringStorageMessage(V.Q.ICCurrentPageInfo,""),!this.IsAddedToCartPage(t,n)&&L.Q.ICRelatedPDPOffer){const e=JSON.parse(L.Q.ICRelatedPDPOffer),o=new URL(e.RelatedOfferShownURL);t&&o&&t.hostname===o.hostname&&t.pathname===o.pathname||this.validationMessageService.SendStringStorageMessage(V.Q.ICRelatedPDPOffer,"")}if(this.HandleActivatedAutoNotification()){const e=L.Q?.GroceryInstantAddToCart;return!e}const s=i?.retailerData?.domainName??"",c={appName:_.Z.GetClientName(),buildVersion:r.buildVersion,enabledfeatures:J.R.GetExpRawData()},l=t.searchParams.get("activatedOffers");if(null!==l)return this.HandleActivatedOffers(l,s,c),!0;if(null!==t.searchParams.get("showCashbackOffers")){this.localDataService.SetICNotificationType(K.c.GroceryAutoShow);const e=L.Q?.GroceryAutoShowData?(0,v.BQ)(L.Q.GroceryAutoShowData):new se;return e.ActiveAutoShowType="ShowCashbackOffers",this.validationMessageService.SendStringStorageMessage(V.Q.GroceryAutoShowData,JSON.stringify(e)),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.GroceryAutoShow),!0}if(o.isSearchEnabled){const i=this.IsApplicableForSearchAndCategoryScenario(e),r=this.IsSeachPage(t,n);if(r.isSerp&&i&&this.HandleSearchPage(r.searchKey,s,c))return!0;const l=this.IsCategoryPage(t,n);if(l.isCategory&&i&&this.HandleCategoryPage(l.categoryId,s,c,n.categoryAutoShowCooldownInSeconds))return!0;if(a.isRebatesUser){const e=this.IsCustomAutoShowPage(t,n);if(e.isMatch&&this.HandleCustomAutoShowPage(s,e.autoShowType,e.cooldownInSeconds,o))return!0}}if(this.IsAddedToCartPage(t,n)&&L.Q.ICRelatedPDPOffer)return this.localDataService.SetICNotificationType(K.c.AddedToCartPDP),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.AddedToCartPDP),!0;if(i?.retailerData?.getCurrentCheckoutPage()?.pageType===p.GV.HomePage){const e=o.spbHomePageOffers,t=e?.find((e=>e.shouldAutoshow&&e.offersType===x.h.SPB&&e.offers?.length>0));if(e&&t){const e=L.Q.ICSpbHomePageShownTimestamp||"0",t=Number(e),o=isNaN(t)?0:t,i=(new Date).getTime(),r=i-o,a=216e5;if(J.R.isTestFlagActive(ae.t.msShoppingTestExp11)||0===o||r>a)return this.localDataService.SetICNotificationType(K.c.SpbHomePage),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.SpbHomePage),this.validationMessageService.SendStringStorageMessage(V.Q.ICSpbHomePageShownTimestamp,`${i}`),!0}}}catch(e){return!1}return!1}IsAddedToCartPage(e,t){return!!(t&&t.AddedToCartData&&q.Z.IsUrlMatchAll(e,t.AddedToCartData).isMatch)}IsApplicableForSearchAndCategoryScenario(e){return!e||e==H.sR.AUTO_SHOW_SPB_CASHBACK_LANDING}IsCustomAutoShowPage(e,t){const o={isMatch:!1,autoShowType:"",cooldownInSeconds:0};if(t&&t.CustomAutoShowData)for(const i of t.CustomAutoShowData){const t=q.Z.IsUrlMatchAll(e,i.matchData);if(t?.isMatch)return o.isMatch=t.isMatch,o.autoShowType=i.autoShowType,o.cooldownInSeconds=i.coolDownInSeconds,o}return o}HandleActivatedAutoNotification(){return!(!L.Q?.GroceryCashbackItem||!L.Q?.ICActivatedPending||(this.localDataService.SetICNotificationType(K.c.Activated),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.Activated),this.validationMessageService.SendBoolStorageMessage(V.Q.ICActivatedPending,!1),0))}HandleSearchPage(e,t,o){return!!e&&(this.SendGetCashbackMessage(t,e,Y.x.Search,o),this.localDataService.SetICNotificationType(K.c.Search),this.localDataService.SetData("query",e),!0)}HandleCategoryPage(e,t,o,i){return!!e&&(this.SendGetCashbackMessage(t,e,Y.x.Category,o),this.localDataService.SetICNotificationType(K.c.Category),i&&this.localDataService.SetData("categoryCooldown",i.toString()),!0)}HandleCustomAutoShowPage(e,t,o,r){try{const a=L.Q?.GroceryAutoShowData?(0,v.BQ)(L.Q.GroceryAutoShowData):new se,n=a?.AutoShowEventsMap[e]?a.AutoShowEventsMap[e]:[],s=n?.filter((e=>e.AutoShowType===t));s?.sort(((e,t)=>e.AutoShowTimestamp-t.AutoShowTimestamp));const c=q.Z.GetTotalCashbackFromOffers(r?.itemizedCashback);if(c&&c>0&&(0===s?.length||this.GetSecondsSince(s[0].AutoShowTimestamp)>o)){const r=n?.filter((e=>e.AutoShowType!==t));return r?.push(new class{constructor(e,t,o){(0,i.Z)(this,"AutoShowType",void 0),(0,i.Z)(this,"AutoShowTimestamp",void 0),(0,i.Z)(this,"CooldownInSeconds",void 0),this.AutoShowTimestamp=t,this.AutoShowType=e,this.CooldownInSeconds=o}}(t,Date.now(),o)),a.AutoShowEventsMap[e]=r,a.ActiveAutoShowType=t,a.TotalCashbackAmount=c,this.validationMessageService.SendStringStorageMessage(V.Q.GroceryAutoShowData,JSON.stringify(a)),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.GroceryAutoShow),this.localDataService.SetICNotificationType(K.c.GroceryAutoShow),!0}return!1}catch(e){return!1}}GetSecondsSince(e){return(Date.now()-e)/1e3}HandleActivatedOffers(e,t,o){this.localDataService.SetICNotificationType(K.c.ActivatedOffers),this.localDataService.SetData("domain",t),this.SendGetCashbackMessage(t,e,Y.x.Category,o)}}),(0,i.Z)(ke,"autoApplyService",new n.Z),(0,i.Z)(ke,"icSearchProcessorService",new class{constructor(){(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"validationMessageService",void 0),(0,i.Z)(this,"autosMarketplaceService",void 0),(0,i.Z)(this,"cashBackResponseStr","")}async Init(){this.localDataService=Ue.GetLocalDataService(),this.validationMessageService=Ue.GetValidationMessageService(),this.autosMarketplaceService=Ue.GetAutosMarketplaceService()}async PostValidation(){}GetPopupOriginationList(){return[H.sR.AUTO_SHOW_SPB_CASHBACK_LANDING,H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING]}async CanAutoOpenForFeature(e){const{isSpbNotification:t,shouldSendMessage:o}=this.ProcessCashBackResponse(this.cashBackResponseStr);return e===H.sR.AUTO_SHOW_SPB_CASHBACK_LANDING?o&&t:e===H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING&&o&&!t}async CanAutoOpen(){const{shouldSendMessage:e}=this.ProcessCashBackResponse(this.cashBackResponseStr);return e}SetCashbackResponseStr(e){this.cashBackResponseStr=e}ProcessCashBackResponse(e){let t=!1,o=!1,i=!1;const r={sentTimeMs:this.localDataService.GetSearchApiRequestSentTimestamp(),receivedTimeMs:(new Date).getTime()};this.localDataService.SetSearchApiRequestSentTimestamp(0);try{if(e){const a=JSON.parse(e);let n=this.localDataService.GetICNotificationType();if(this.HasCashbackOffers(a)){const e=this.GetOffersType(a)===x.h.Quotient,s=this.localDataService.GetDomainName(),c={};c.query=this.localDataService.GetData("query");let l="";if(e){const e=this.GetQtShouldShow(a,s);e.categoryName&&(c.categoryName=e.categoryName),e.addressBarTemplate&&(l=e.addressBarTemplate),e.notificationType&&e.shouldSendMessage&&(n=e.notificationType,o=e.shouldSendMessage)}else{const e=this.GetSpbShouldShow(a,s);e.notificationType&&e.shouldSendMessage&&(n=e.notificationType,o=e.shouldSendMessage,i=!0)}if(c.cashbackData=a,c.currentUrl=(0,v.Ek)(),c.type=n,c.latencyData=r,J.R.isExperimentActive(Q.H.spbCheckoutAutoActivation)&&"amazon.com"===s&&this.IsCheckoutPage()){const e=new CustomEvent(z.fU,{detail:{jsonResponse:c}});window.dispatchEvent(e),o=!1,i=!1}this.validationMessageService.SendStringStorageMessage(V.Q.ICCurrentPageInfo,JSON.stringify(c)),this.validationMessageService.SendMessage(j.H.UpdateAddressBar,[JSON.stringify({type:l})]),t=!0,this.validationMessageService.SendMessage(j.H.UpdateLoadTimeData,[this.localDataService.GetTraceId()])}else a?.autosResponse&&this.autosMarketplaceService.processCashBackResponseForAutosMarketplace(a?.autosResponse)}}catch(e){}return t||this.validationMessageService.SendStringStorageMessage(V.Q.ICCurrentPageInfo,""),{shouldSendMessage:o,isSpbNotification:i}}LogSPBTelemetry(e,t,o,i={}){const r=this.localDataService.GetImpressionId(),a=this.localDataService.GetUserInfo();q.Z.LogSPBTelemetry(e,t,o,a,r,i)}GetSecondsSince(e){return(Date.now()-e)/1e3}IsCheckoutPage(){const e=te.Z.getApiResponse(),t=oe.Z.CreateCheckoutPageData(e).retailerData.getCurrentCheckoutPage(location.pathname);return t&&t.pageType===p.GV.CheckoutPage}GetQtShouldShow(e,t){let o,r=!1,a="",n="";const s=this.GetActivatedOfferIds(t),c=this.GetShownOffers(t),l=this.GetSubmittedOffersSet(),u=e.itemizedCashBackResponse.queryType;if(u===Y.x.Search){const t=X.Z.CreateFromUAPIList(e.itemizedCashBackResponse.offers);a="SearchGeneric",this.ShouldAutoshow(e)&&this.ContainsOffersNotShownNonActivatedNotSubmitted(t,c,s,l)&&(this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.Search),r=!0,o=K.c.Search)}else if(u===Y.x.Category){const s=X.Z.CreateFromUAPIList(e.itemizedCashBackResponse.offers);a="CategoryGeneric",s[0].cashbackProducts&&s[0].cashbackProducts.length>0&&(n=s[0].cashbackProducts[0].displayCategory);const c=q.Z.GetTotalCashback(s),l=this.localDataService.GetData("categoryCooldown");if(l&&c&&c>0){const e=L.Q.GroceryCategoryAutoShowData?(0,v.BQ)(L.Q.GroceryCategoryAutoShowData):new class{constructor(){(0,i.Z)(this,"AutoShowTimestampsMap",void 0),this.AutoShowTimestampsMap={}}},a=e.AutoShowTimestampsMap;(!a[t]||this.GetSecondsSince(a[t])>Number(l))&&(e.AutoShowTimestampsMap[t]=Date.now(),this.validationMessageService.SendStringStorageMessage(V.Q.GroceryCategoryAutoShowData,JSON.stringify(e)),this.localDataService.SetICNotificationType(K.c.CategoryAutoshow),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.CategoryAutoshow),r=!0,o=K.c.CategoryAutoshow)}}else if(u===Y.x.Offers){const i=L.Q.GroceryCashbackActivated;let a={};i&&(a=(0,v.BQ)(L.Q.GroceryCashbackActivated)),(!a[t]||a[t]&&!a[t].fullItems)&&(a[t]={fullItems:{}});const n=X.Z.CreateFromUAPIList(e.itemizedCashBackResponse.offers),s={};n.filter((e=>e.cashbackProducts.length>0)).reverse().forEach((e=>{const t=e.id;s[t]=e})),Object.keys(a[t].fullItems).forEach((e=>{const o=a[t].fullItems[e],i=o.id;s[i]=o})),a[t].fullItems=s;let c=0;const l=[];Object.keys(s).forEach((e=>{const t=s[e],o=parseFloat(t.offerValue);l.length<3&&t.cashbackProducts?.length>0&&t.cashbackProducts[0].title&&l.push({imageUrl:t.imageUrl,title:t.cashbackProducts[0].title}),c+=o})),this.validationMessageService.SendStringStorageMessage(V.Q.ICActivatedCashbackTotal,c.toFixed(2)),this.validationMessageService.SendStringStorageMessage(V.Q.ICActivatedCashbackImages,JSON.stringify({images:l})),this.validationMessageService.SendStringStorageMessage(V.Q.GroceryCashbackActivated,JSON.stringify(a)),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.ActivatedOffers),this.validationMessageService.SendBoolStorageMessage(V.Q.ICActivationMigrationPending,!0),r=!0,o=K.c.ActivatedOffers}return{shouldSendMessage:r,notificationType:o,addressBarTemplate:a,categoryName:n}}GetSpbShouldShow(e,t){let o,i=!1;if(J.R.isExperimentActive(Q.H.disableSPBNotification))return this.LogSPBTelemetry(p.xu.ICSPBOffersNoShow,"SPB notification disabled by experiment disableSPBNotification",e),{notificationType:o,shouldSendMessage:i};const r=(0,ee.Sq)(e);let a=r.find((e=>e.source===x.h.SPB));if(e?.itemizedCashBackResponse?.offersType!==x.h.SPB||a||(a=r.length>0?r[0]:void 0),a){const t=e?.itemizedCashBackResponse?.shouldAutoshow??!1,n=this.localDataService.GetPersonalizedAdsResponse(),s=(0,ee.rP)(r,n),c=(0,ee.wu)(e),l=this.containsOfferToAutoShow(r);a.visibilityFeedbackUrlBase=c,t&&l&&s?.length>0?(this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,K.c.SearchSPB),this.localDataService.SetICNotificationType(K.c.SearchSPB),i=!0,o=K.c.SearchSPB,this.LogSPBTelemetry(p.xu.ICSPBOffersCanShow,"","")):this.LogSPBTelemetry(p.xu.ICSPBOffersNoShow,t?"Non-activated items are not there":`Should autoshow is falsecontainOfferToAutoShow ${l}`,e)}else this.LogSPBTelemetry(p.xu.ICSPBOffersNoShow,"No SPB offers, check again",e);return{notificationType:o,shouldSendMessage:i}}containsOfferToAutoShow(e){for(const t of e){if(void 0===t.shouldAutoshow||null===t.shouldAutoshow)return!0;if((0,g.Nx)(t.shouldAutoshow))return!0}return!1}GetSubmittedOffersSet(){try{const e=this.localDataService.GetSubmittedIds();if(e&&e.length>0)return new Set(e)}catch(e){}return new Set}HasCashbackOffers(e){return!!(e&&e.itemizedCashBackResponse&&e.itemizedCashBackResponse.offers&&e.itemizedCashBackResponse.offers.length>0)}GetOffersType(e){return e?.itemizedCashBackResponse?.offersType??""}ShouldAutoshow(e){return e&&e.itemizedCashBackResponse&&e.itemizedCashBackResponse.shouldAutoshow}ContainsOffersNotShownNonActivatedNotSubmitted(e,t,o,i){let r=!1;const a=this.localDataService.GetDomainName(),n=this.localDataService.GetData("variations"),s=n?JSON.parse(n):{},c=!!s.searchIgnoreAlreadyShown&&"enabled"===s.searchIgnoreAlreadyShown;try{let n="";for(const a of e)if((c||!t.has(a.id))&&!o.has(a.id)&&!i.has(a.id)){r=!0,n=a.id;break}if(r){t.add(n);const e={},o=new $(void 0);o.ShownOffers=Array.from(t),o.ImpressionId=this.localDataService.GetImpressionId(),e[a]=o,this.validationMessageService.SendStringStorageMessage(V.Q.ICAutoShownOffers,JSON.stringify(e))}}catch(e){r=!1}return r}GetActivatedOfferIds(e){const t=L.Q?.GroceryCashbackActivated,o=((0,v.BQ)(t)??{})[e]??void 0;return o?.fullItems?new Set(Object.keys(o.fullItems)):new Set}GetShownOffers(e){const t=(0,v.BQ)(L.Q?.ICAutoShownOffers)??{},o=this.localDataService.GetImpressionId();t&&t[e]&&t[e].ImpressionId!==o&&delete t[e];const i=new $(t[e]).ShownOffers;return new Set(i)}}),(0,i.Z)(ke,"icPDPProcessorService",new class{constructor(){(0,i.Z)(this,"localDataService",void 0),(0,i.Z)(this,"validationMessageService",void 0),(0,i.Z)(this,"cashBackResponse",void 0)}async Init(){this.localDataService=Ue.GetLocalDataService(),this.validationMessageService=Ue.GetValidationMessageService()}GetPopupOriginationList(){return[H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING,H.sR.AUTO_SHOW_SPB_CASHBACK_LANDING]}CanAutoOpen(){const e=this.localDataService.GetCheckoutPageData(),t=e?.retailerData?.domainName||"";if(!this.cashBackResponse)return!1;const{shouldShow:o}=this.ProcessPDPResponse(this.cashBackResponse,t);return o}async CanAutoOpenForFeature(e){const t=this.localDataService.GetCheckoutPageData(),o=t?.retailerData?.domainName||"";if(!this.cashBackResponse)return!1;const{isSpb:i,shouldShow:r}=this.ProcessPDPResponse(this.cashBackResponse,o);switch(e){case H.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING:return r&&!i;case H.sR.AUTO_SHOW_SPB_CASHBACK_LANDING:return r&&i}return!1}async PostValidation(){}SetCashbackResponse(e){this.cashBackResponse=e}ProcessPDPResponse(e,t){let o=!1;try{const r=Ue.GetLocalDataService().GetSubmittedIds()||[],a=this.localDataService.GetIsClippingSent(),n=this.localDataService.GetUserInfo(),s=this.localDataService.GetImpressionId(),c=L.Q?.ICIsPendingTransactionPresent??!1;if(e.offersType===x.h.Quotient&&c)return(0,W.LT)(e,n,s,"Pending transaction is present"),{shouldShow:!1,isSpb:o};let l=!1,u=K.c.PDP;if(e.offersType===x.h.Quotient){l=(0,W.mg)(e,t,r,[],a);const c=this.localDataService.GetData("variations"),d=c?JSON.parse(c):{},h=!!d.relatedOfferOnAddToCart&&"enabled"===d.relatedOfferOnAddToCart,p=(0,W.$d)(e,t,[]);if(p&&h){const e=new class{constructor(e,t){(0,i.Z)(this,"RelatedOffer",void 0),(0,i.Z)(this,"RelatedOfferShownURL",void 0),this.RelatedOffer=e,this.RelatedOfferShownURL=t}}(p,(0,v.Ek)());this.validationMessageService.SendStringStorageMessage(V.Q.ICRelatedPDPOffer,JSON.stringify(e))}if(!l)return{shouldShow:!1,isSpb:o};u=K.c.PDP,(0,W.iQ)(e,n,s)}else if(e.offersType===x.h.SPB){if(o=!0,l=(0,W.WL)(e),!l)return{shouldShow:!1,isSpb:o};u=K.c.PdpSPB,(0,W.jV)(e,n,s)}const d={};return d.cashbackData=e,d.currentUrl=(0,v.Ek)(),d.type=u,d.pageTitle=(0,v.AL)(),this.validationMessageService.SendStringStorageMessage(V.Q.ICCurrentPageInfo,JSON.stringify(d)),this.localDataService.SetICNotificationType(u),this.validationMessageService.SendStringStorageMessage(V.Q.ICNotificationType,u),{shouldShow:!0,isSpb:o}}catch(t){(0,W.LT)(e,void 0,this.localDataService.GetImpressionId(),"Unknown error",!0)}return{shouldShow:!1,isSpb:o}}}),(0,i.Z)(ke,"suggestedCouponsService",void 0),(0,i.Z)(ke,"webAssistQueryService",void 0),(0,i.Z)(ke,"otherSellersService",new u.Z),(0,i.Z)(ke,"clippingService",new c.Z),(0,i.Z)(ke,"aaConsentService",new a.Z),(0,i.Z)(ke,"productBestCouponConsentService",new d.Z),(0,i.Z)(ke,"pinterestService",void 0),(0,i.Z)(ke,"clientRequestsService",new class{constructor(){(0,i.Z)(this,"MaxWaitTime",7e3),(0,i.Z)(this,"responseMap",{})}async Init(){}async PostValidation(){}async SendRequest(e,t,o){const i=h.Z.uuidv4(),r=JSON.stringify({serviceName:e,methodName:t,requestBody:JSON.stringify(o)});this.responseMap[i]=void 0,k.f.postMessageToHost("FireGenericDealsRequest",[i,r]),U.p.postMessageToHost("FireGenericDealsRequest",[i,r]),await g.ZP.WaitForCondition((async()=>void 0!==this.responseMap[i]),this.MaxWaitTime);const a=this.responseMap[i];if(delete this.responseMap[i],void 0!==a&&a.length>=3&&"200"===a[2]){const e=JSON.parse(a[1]);if("OK"===e?.errorCode&&e?.responseBody)return e.responseBody}return null}ProcessClientRequestResponse(e){if(e.length>=3){const t=e[0];Object.keys(this.responseMap).includes(t)&&void 0===this.responseMap[t]&&(this.responseMap[t]=e)}}}),(0,i.Z)(ke,"pageDetectionService",new class{constructor(){(0,i.Z)(this,"regexList",void 0),this.regexList=[/^(?!.*setting).*(\bcheckout|\bpayment\b)/i,/^(?!.*add).*(\bcart\b|\bbasket\b)/i]}async Init(){}async PostValidation(){}CheckAndLogUrl(e){const t=window.location.href;if(this.UrlNotInRetailerData(e,t))for(const o of this.regexList)if(o.test(t))return void this.LogUrlAndMatchedRegex(t,o,e)}UrlNotInRetailerData(e,t){const o=e.retailerData?.getCurrentCheckoutPage(t);return!o||"/"===o.checkoutPageUrl}LogUrlAndMatchedRegex(e,t,o){const i={Domain:o.retailerData?.domainName,PageUrl:e,Regex:t.source};f.Z.SendLogEventMessage(i,p.R.PageDetectionRegexMatched,o.impressionId,"Url not in retailer data matched regex",p.in.Information)}}),(0,i.Z)(ke,"backgroundAAService",new s.Z);var Ue=ke},93970:function(e,t,o){o.d(t,{EI:function(){return T},J6:function(){return E},OE:function(){return f}});var i=o(72370),r=o(59645),a=o(40843),n=o(5144),s=o(73557),c=o(29247),l=o(36493),u=o(91495),d=o(8553),h=o(9448),p=o(90066),g=o(43916),C=o(1094),S=o(44922),m=o(86743),A=o(68813),P=o(52056);let f=function(e){return e.CouponClipping="18",e.BellIconNotifClick="25",e}({}),E=function(e){return e.CouponClipping="31",e.BellIconNotifClick="40",e}({}),T=function(e){return e.AutoShowAvailable="AutoShowAvailable",e.AutoOpenError="AutoOpenError",e.LogScriptTelemetry="LogScriptTelemetry",e.SetStorageValue="SetStorageValue",e.FallbackValidation="FallbackValidation",e.RecordAutoShowPrevented="RecordAutoShowPrevented",e.UpdateAddressBar="UpdateAddressBar",e.EndOfScript="EndOfScript",e.StoreJourneyStage="StoreJourneyStage",e.SetPackageTrackingConsent="SetPackageTrackingConsent",e.StartPackageTracking="StartPackageTracking",e.LogScriptTelemetryV2="LogScriptTelemetryV2",e.BGAAComplete="BGAAComplete",e.DataExtracted="DataExtracted",e.TriggerExperiment="TriggerExperiment",e}({});class O{static sendFinalCheckoutValidationLog(e,t,o,i,r){const a=r?.OrderTotal;t?P.Z.SendPurchaseConfirmationLog(e,o,"Valid Final Checkout Page","true",i,r):a&&-1!==a&&P.Z.SendPurchaseConfirmationLog(e,o,"Invalid Final Checkout Page","false",i,r),a&&-1!==a&&C.Z.SendGMVMessage(a,r?.Currency??"$",O.traceId)}static async ValidateProductOutOfStock(e,t,o,i){if(!t?.productOutOfStockSelector)return!1;const s=window.location.href;if((i=new a.Z(i)).isUnsupportedDomain)return!1;const u=d.ZP.IsTrackedProductForAOC(s);let h=!1;try{if(!await c.ZP.WaitUntilCondition((async()=>p.Z.HasVisibleElement(t?.productOutOfStockSelector)),2e3))return!1;let i,a,d,g="$";if(t?.productImageSelector){const e=p.Z.GetFirstMatchingElement(t?.productImageSelector);a=e?.src}if(t?.productTitleSelector){const e=p.Z.GetFirstMatchingElement(t?.productTitleSelector);i=e?.innerText}if(t?.productPriceSelector){const o=p.Z.GetFirstMatchingElement(t?.productPriceSelector),i=o?.innerText;i&&i.length&&(g=(0,l.cU)(i)||(0,l.N6)(e.exclusiveMarket||"en-us")||"$",d=(0,l.K)(i))}const C=JSON.stringify({currency:g,productImage:a,productPrice:d,productTitle:i,productUrl:s,status:"OUT_OF_STOCK"});if(i&&s&&(h=!0),!i||!a){const t=new r.Z(n.xu.ProductTrackingDebug);t.Metadata=JSON.stringify({productTitle:i,productImage:a,productUrl:s}),t.Domain=e.domainName,P.Z.SendLogEvent(o,"Product Tracking: Invalid OOS product, missing title or image","error",void 0,g,n.R.EdgeFlyoutStatus,t,e.domainName)}return P.Z.SendStorageMessage("ProductTrackingData",JSON.stringify({value:C})),!await u&&h}catch(e){return P.Z.SendLogEvent(o,`Product Tracking: Validating OOS product check" ${e?.message}\n\n${e}`,"error"),!1}return!1}constructor(e){(0,i.Z)(this,"impressionId",""),(0,i.Z)(this,"merchantData",void 0),(0,i.Z)(this,"isAutoOpenControllerActive",void 0),(0,i.Z)(this,"isRuleBasedTriggerControllerActive",void 0),(0,i.Z)(this,"aocValidatorUtilities",void 0),(0,i.Z)(this,"ruleBasedTriggerController",void 0),(0,i.Z)(this,"scriptRunNum",0),(0,i.Z)(this,"validationMsgNum",0),(0,i.Z)(this,"validationStartTime",performance.now()),(0,i.Z)(this,"initializeStartTime",void 0),(0,i.Z)(this,"scriptStartTime",void 0),(0,i.Z)(this,"localDataService",void 0),this.localDataService=e}SetTraceId(e){O.traceId=e}SetMerchantData(e){this.merchantData=e}SetAutoOpenControllerExp(e){this.isAutoOpenControllerActive=e}SetRuleBasedTriggerControllerExp(e){this.isRuleBasedTriggerControllerActive=e}SetImpressionId(e){this.impressionId=e}ResetValidationMsgNum(){this.validationMsgNum=0}SetRuleBasedTriggerController(){return this.ruleBasedTriggerController=g.Z.getRuleBasedTriggerController(s.sR.AUTO_SHOW_COUPONS_CHECKOUT,this.sendErrorMessage.bind(this),this.SendStorageMessage.bind(this),this.impressionId,u.Q?.RuleBasedTriggerData),this.ruleBasedTriggerController}GetRuleBasedTriggerController(){return this.ruleBasedTriggerController}SetInitializeStartTime(e){e&&(this.initializeStartTime=e)}SetScriptStartTime(e){e&&(this.scriptStartTime=e)}SetValidationStartTime(e){this.validationStartTime=e}SetScriptRunNum(e){this.scriptRunNum=e}SendAutoOpenWithPageValidation(e,t,o){this.SendValidationMessage(!1,e,t,[o],!1,!0)}SendValidationMessage(e,t,o,i,r=!0,a=!1,n){n||(n={auto_apply_status:e,express_checkout_status:this.localDataService.IsExpressCheckoutPage(),open_micro_notifcation:!1,page_validations:i??[],page_validations_auto_open:[],auto_open_reasons:[]});const s=(e&&r||a)&&(0,A.ZQ)((e=>{P.Z.SendLogEvent(this.impressionId,e,"Blocked notification based on User Cohort")}),(0,A.tW)(),i,this.localDataService.GetUserSettingsData());this.sendValidationMessage(n,o,"AAController: "+t,s),!s&&this.aocValidatorUtilities&&this.aocValidatorUtilities.cleanLocalStorage()}SendStorageMessage(e,t){P.Z.SendStorageMessage(e,t)}SendPurchaseConfirmationMessage(){P.Z.SendMessage(h.H.PurchaseCompleted,[O.traceId])}IsPageValid(e){for(const t of e)if(p.Z.HasVisibleElement(t))return!0;return!1}sendErrorMessage(e,t){try{const o="error";P.Z.SendLogEvent(e,t,o,void 0,void 0,void 0),P.Z.SendMessage(h.H.CheckoutPageValidationError,[o,O.traceId])}catch(e){}}async RetrieveGuestDomain(e){if(P.Z.SendMessage(h.H.GuestDomain,[""]),e?.pinterestSelectors&&c.ZP.IsValidDataField(e?.pinterestSelectors.domainSelector)&&e?.pinterestSelectors&&c.ZP.IsValidDataField(e?.pinterestSelectors.productLinkSelector)){let t;if(await c.ZP.WaitForCondition((async()=>(t=p.Z.GetFirstVisibleElement(e.pinterestSelectors.domainSelector),void 0!==t)),5e3),t){let o;await c.ZP.WaitForCondition((async()=>(o=p.Z.GetFirstVisibleElement(e.pinterestSelectors.productLinkSelector),void 0!==o)),5e3);let i=t.innerText;const r=o?.getAttribute("href");if(i&&r)return i.includes("www.")||(i=`www.${i}`),i.includes("http")||(i=`http://${i}`),P.Z.SendStorageMessage("pinterestProductLink",JSON.stringify({value:r})),P.Z.SendMessage(h.H.GuestDomain,[i]),Promise.resolve(!0)}}return Promise.resolve(!1)}DeleteKeyFromPersistentStorage(e){this.SendStorageMessage(e,JSON.stringify({value:null}))}sendValidationMessage(e,t,o,i){const r=e.auto_apply_status?"true":"false",a=JSON.stringify(e);if((0,m.sy)())try{this.SendPerfLog(t,o,a)}catch(e){}P.Z.SendMessage(h.H.PageStatus,[O.traceId,a]),(0,m.sy)()?P.Z.SendMessage(h.H.CheckoutPageValidationStatus,[r,O.traceId,`${i}`]):this.localDataService.SetAutoApplyStatus(e.auto_apply_status),this.validationMsgNum++}SendPerfLog(e,t,o){const i=performance.now(),r=new S.Z;r.domain=e,r.initializeTime=this.scriptStartTime-this.initializeStartTime,r.preValidationTime=this.validationStartTime-this.scriptStartTime,r.time=i-this.validationStartTime,r.scriptRunNum=this.scriptRunNum,r.validationMsgNum=this.validationMsgNum,r.validationReason=t,r.path=C.Z.GetCurrentPathName(),r.pageStatus=o,P.Z.SendLogEventMessage(r,n.R.CheckoutValidationPerf,this.impressionId,"",n.in.Information)}}(0,i.Z)(O,"traceId",void 0),t.ZP=O},27775:function(e,t,o){o(23582)},21650:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"boolValue",void 0)}static Create(e){const t=new r;return t.boolValue=e.boolValue,t}static CreateFromBool(e){const t=new r;return t.boolValue=e,t}}t.Z=r},96834:function(e,t,o){var i=o(72370);class r{constructor(){(0,i.Z)(this,"stringValue",void 0)}static Create(e){const t=new r;return t.stringValue=e.stringValue,t}static CreateFromString(e){const t=new r;return t.stringValue=e,t}}t.Z=r},28060:function(e,t,o){o.d(t,{E:function(){return i}});let i=function(e){return e.ICNotification="icnotification",e}({})},4724:function(e,t,o){var i=o(72370),r=o(47746);class a{constructor(){(0,i.Z)(this,"displayCategory",void 0),(0,i.Z)(this,"image",void 0),(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"productId",void 0),(0,i.Z)(this,"retailerIdentifier",void 0),(0,i.Z)(this,"title",void 0),(0,i.Z)(this,"upc",void 0),(0,i.Z)(this,"url",void 0),(0,i.Z)(this,"discountedPrice",void 0),(0,i.Z)(this,"productReviewsCount",void 0),(0,i.Z)(this,"productRatings",void 0),(0,i.Z)(this,"productShortTitle",void 0),(0,i.Z)(this,"variation",void 0)}static Create(e){const t=new a;return t.displayCategory=e.displayCategory,t.image=e.image,t.price=e.price,t.productId=e.productId,t.retailerIdentifier=e.retailerIdentifier,t.title=e.title,t.productShortTitle=e.productShortTitle,t.upc=e.upc,t.url=e.url,t.productRatings=e.productRatings,t.productReviewsCount=e.productReviewsCount,t.variation=e.variation,t}static CreateFromGroceryApi(e){const t=new a;return t.displayCategory=e.productDisplayCategory,t.image=e.productImage,t.price=e.productPrice,t.productId=e.productGTIN,t.productShortTitle=e.productShortTitle,t.retailerIdentifier=e.retailerIdentifier,t.title=e.productTitle,t.upc=e.productUPC,t.url=e.productURL,t.productRatings=e.prodcutRatings,t.productReviewsCount=e.productReviewsCount,t.variation=e.variation,t}static CreateFromUAPI(e){const t=new a;return t.displayCategory=e.displayCategory,t.image=e.image,t.price=e.price,t.productId=e.productId,t.retailerIdentifier="",t.title=e.title,t.productShortTitle=e.productShortTitle,t.upc=e.upc,t.url=e.url,t.productRatings=e.productRatings,t.productReviewsCount=e.productReviewsCount,t.productReviewsCount=e.variation,t}static CreateOneItemOffer(e){const t=a.CreateFromUAPI(e),o=new r.Z;return o.cashbackProducts.push(t),o}static CreateFromAdsOffer(e,t){const o=new a;return o.displayCategory="",o.image=t,o.price=`$${e.price}`,o.productId="",o.retailerIdentifier="",o.title=e.name??"",o.upc="",o.url=e.url??"",o.discountedPrice=e.discountedPrice?`$${e.discountedPrice.toFixed(2)}`:"",o}}t.Z=a},47746:function(e,t,o){var i=o(72370),r=o(4724);class a{static Create(e){const t=new a;if(t.cashbackProducts=[],e.cashbackProducts)for(const o of e.cashbackProducts)t.cashbackProducts.push(r.Z.Create(o));return t.imageUrl=e.imageUrl,t.offerValue=e.value,t.id=e.id,t.description=e.description,t.brand=e.brand,t.disclaimer=e.disclaimer,t.expiryDate=e.expiryDate,t.minQty=e.minQty,t.source=e.source,t}static CreateFromGroceryApi(e){const t=new a;return t.imageUrl=e.offerImage.offerImage1,t.offerValue=e.offerValue,t.id=e.offerId,t.description=e.offerDescription,t.brand=e.brandName,t.disclaimer=e.offerDisclaimer,t.expiryDate=e.offerExpiryDate,t.minQty=e.requirements.minQty,t.cashbackProducts=e.edgeRebateOfferProducts.map((e=>r.Z.CreateFromGroceryApi(e))),t}static CreateFromUAPI(e){const t=new a;return t.imageUrl=e.imageUrl,t.offerValue=e.value,t.id=e.id,t.description=e.description,t.brand=e.brand,t.disclaimer="",t.expiryDate=e.expiryDate,t.minQty=e.minQty,t.source=e.source,t.cashbackProducts=e.cashbackProducts.map((e=>r.Z.CreateFromUAPI(e))),t}static CreateFromUAPIList(e){const t=[];return e.forEach((e=>{const o=new a;o.imageUrl=e.imageUrl,o.offerValue=e.value,o.id=e.id,o.description=e.description,o.brand=e.brand,o.disclaimer="",o.expiryDate=e.expiryDate,o.minQty=e.minQty,o.source=e.source,o.cashbackProducts=e.cashbackProducts.map((e=>r.Z.CreateFromUAPI(e))),t.push(o)})),t}constructor(){(0,i.Z)(this,"imageUrl",void 0),(0,i.Z)(this,"offerValue",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"description",void 0),(0,i.Z)(this,"brand",void 0),(0,i.Z)(this,"disclaimer",void 0),(0,i.Z)(this,"expiryDate",void 0),(0,i.Z)(this,"minQty",void 0),(0,i.Z)(this,"source",void 0),(0,i.Z)(this,"cashbackProducts",void 0),(0,i.Z)(this,"addedTimestamp",void 0),(0,i.Z)(this,"expAfterActivatingDate",void 0),(0,i.Z)(this,"quotientTimestamp",void 0),this.cashbackProducts=[]}}t.Z=a},69698:function(e,t,o){o.d(t,{Op:function(){return u}});var i=o(72370),r=o(11127);let a=r.DesignToken.create("cb-background-colour").withDefault("#FFFFFF"),n=r.DesignToken.create("cb-font").withDefault("#000000"),s=r.DesignToken.create("cb-background").withDefault("#FEFEFE"),c=r.DesignToken.create("cb-price-tag").withDefault("#0078D4"),l=r.DesignToken.create("linkColor").withDefault("#235CCF");class u{setCashbackUIService(e){this.cashbackUIService=e}constructor(e){(0,i.Z)(this,"cashbackUIService",void 0),this.cashbackUIService=e}initializeTokens(){this.cashbackUIService.isDarkMode()&&(l.setValueFor(document.documentElement,"#63ADE5"),c.setValueFor(document.documentElement,"#0078D4"),a.setValueFor(document.documentElement,"#FFFFFF"),n.setValueFor(document.documentElement,"#FFFFFF"),s.setValueFor(document.documentElement,"#3B3B3B"))}async init(){}}},49259:function(e,t,o){o.d(t,{Z:function(){return L}});var i=o(72370),r=o(71544),a=o(81687),n=o(12265),s=o(87605),c=o(84901),l=o(29247),u=o(75434),d=o(55590),h=o(31656),p=o(4872),g=o(5144),C=o(56764),S=class{constructor(){(0,i.Z)(this,"cashbackState",void 0),(0,i.Z)(this,"cashbackType",void 0),(0,i.Z)(this,"domain",void 0),(0,i.Z)(this,"cashbackProductTitle",void 0),(0,i.Z)(this,"cashbackAmount",void 0),(0,i.Z)(this,"productPrice",void 0),(0,i.Z)(this,"imageUrl",void 0),(0,i.Z)(this,"productBingUrl",void 0),(0,i.Z)(this,"productRetailerUrl",void 0),(0,i.Z)(this,"description",void 0),(0,i.Z)(this,"isBlossom",!1),(0,i.Z)(this,"is3xIncentive",!1),(0,i.Z)(this,"shouldAutoshow",void 0),(0,i.Z)(this,"expireTimeEpoch",void 0),(0,i.Z)(this,"globalOfferId",void 0),(0,i.Z)(this,"minPurchaseValue",void 0),(0,i.Z)(this,"visibilityFeedbackUrl",void 0),(0,i.Z)(this,"cashbackCategories",[])}},m=class{constructor(e,t){(0,i.Z)(this,"price",void 0),(0,i.Z)(this,"currency",void 0),this.price=e,this.currency=t}},A=o(3634);let P=function(e){return e.EligibleUser="EligibleUser",e.OfferClaimed="OfferClaimed",e.PayoutCompleted="PayoutCompleted",e.FailedToFetch="FailedToFetch",e.NotEligibleUser="NotEligibleUser",e}({});var f=o(88767),E=o(59645),T=o(28060),O=o(42544),I=o(15255),_=o(4238),v=o(11501),R=class{constructor(e,t,o,r){(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"sessionIds",void 0),(0,i.Z)(this,"anid",""),(0,i.Z)(this,"esf",""),(0,i.Z)(this,"settings",void 0),this.apiResponse=e,this.sessionIds=t,this.esf=r||"",this.anid=o||"",this.settings=new v.Z(e?.retailerData?.settings)}isPane(){throw new Error("Method not implemented.")}getCheckoutPageInfo(){}getPageType(){return g.GV.UnknownPage}getRetailerSettings(){return this.settings}getPersonalizedCashback(){return this.apiResponse?.personalizedAdsResponse?.personalizedCashback}isEdgeRebateUser(){return this.apiResponse?.cashback?.isRebatesUser??!1}isAadSignedIn(){return this.apiResponse?.userInfo?.isAADSignedIn??null}getSanConsentFlag(){return(0,l.Nx)(this.apiResponse?.userInfo?.isPersonalizationDataConsentEnabled)}getHtmlCollectionRate(){return this.apiResponse?.retailerData?.aOCFragmentCollectionRate?`${this.apiResponse?.retailerData?.aOCFragmentCollectionRate}`:"0"}getCurrentMarket(){const e=this.apiResponse?.market,t=this.apiResponse?.aFDMarket;return(0,l.UE)(e)?e:(0,l.UE)(t)?t:void 0}getExtractionRate(){try{if(this.apiResponse?.retailerData?.aOCFragmentCollectionRate)return parseFloat(this.apiResponse?.retailerData?.aOCFragmentCollectionRate)}catch(e){return-1}return-1}isFragmentCollectionEnabled(){return(0,l.Nx)(this.apiResponse?.retailerData?.isAOCFragmentCollectionEnabled)}getCheckoutPages(){}isCartCachingEnabled(){return this.getConfirmationPageTelemetryData()?.isCartCachingEnabled??!0}getPlatform(){return this.apiResponse?.retailerData?.platform??""}getConfirmationPageRegex(){return this.apiResponse?.retailerData?.orderConfirmationPageUrl}getMarket(){return this.apiResponse?.market??""}getAfdMarket(){return this.apiResponse?.aFDMarket??""}getConfirmationPageTelemetryData(){return this.apiResponse?.retailerData?.confirmationPageTelemetry}getCurrentDomain(){return this.apiResponse?.retailerData?.domainName??""}getImpressionId(){return this.apiResponse?.impressionId??""}getRetailerData(){return this.apiResponse?.retailerData}getAutomatedSelectorsData(){return this.apiResponse?.retailerData?.allAutomatedSelectors??[]}getAutomatedSelectorsDataForPage(e){}getFeatureFlagEnabledByDefault(e){return"feature_disabled"!==this.apiResponse?.retailerData?.edgeFeatureFlag?.[e]}getFeatureFlag(e){return"feature_enabled"===this.apiResponse?.retailerData?.edgeFeatureFlag?.[e]}getDataMaskRules(){const e=this.apiResponse?.retailerData?.dataMaskRules,t=[];if(e&&e.length>0)for(const o of e)if(o?.ruleName&&o?.ruleValue&&o?.maskType){const e=new _.Z(o?.ruleName,o?.maskType,o?.ruleValue);t.push(e)}return t}};class D{constructor(e,t){(0,i.Z)(this,"cashbackItems",void 0),(0,i.Z)(this,"requestedForSearchUrl",void 0),this.cashbackItems=e,this.requestedForSearchUrl=t}}class N extends R{constructor(e,t,o,r){const a=N.parseApiWithErrorCatch(e);super(a),(0,i.Z)(this,"dataLoader",void 0),(0,i.Z)(this,"storageHandler",void 0),(0,i.Z)(this,"loggerService",void 0),(0,i.Z)(this,"apiResponse",void 0),(0,i.Z)(this,"highestCashbackCategoryData",void 0),(0,i.Z)(this,"pageHandler",void 0),(0,i.Z)(this,"cachedIsBingAdRefered",!1),this.pageHandler=t,this.dataLoader=e,this.storageHandler=o,this.loggerService=r,this.apiResponse=a}isPane(){return this.dataLoader.GetLoadTimeDataValue("is_hub",!1)}async GetBlossomUserStatus(e){if(!(0,l.UE)(e))return Promise.resolve(P.FailedToFetch);const t=await this.storageHandler.getStorageString(d.Q.BlossomCampaignUserStatus),o=Number(await this.storageHandler.getStorageString(d.Q.BlossomCampaignUserStatusTimestamp));if(t&&!isNaN(o)&&(new Date).getTime()-o<3e5)return Promise.resolve(P[t]);{const t={headers:{"Content-Type":"application/json",Origin:"chrome-untrusted://shopping"},method:"GET"},o=`https://www.bing.com/api/shopping/v1/grocery/campaigns/projectBlossom022024/status?anid=${e}`;try{const e=await fetch(o,t),i=await e.json();if(200===e.status){const e=i?.userStatus??"";return this.storageHandler.setStorageString(d.Q.BlossomCampaignUserStatus,e),this.storageHandler.setStorageString(d.Q.BlossomCampaignUserStatusTimestamp,(new Date).getTime().toString()),e}return Promise.resolve(P.FailedToFetch)}catch(e){return Promise.resolve(P.FailedToFetch)}}}getSessionIds(){}getESF(){return""}isSignedIn(){return Boolean(this.isAadSignedIn())}async getAnid(){try{return await(0,u.H)(this.pageHandler)}catch(e){return}}SaveBlossomStatus(e){this.storageHandler.setStorageString(d.Q.BlossomCampaignUserStatus,e),this.storageHandler.setStorageString(d.Q.BlossomCampaignUserStatusTimestamp,(new Date).getTime().toString())}async GetShouldShowBlossomFlag(){const e=await this.storageHandler.getStorageString(d.Q.BlossomShouldShowNotification);return(0,l.Nx)(e)}ResetBlossomNotificationFlag(){this.storageHandler.clearStorage(d.Q.BlossomShouldShowNotification)}saveToLocalCache(e,t){throw new Error("Method not implemented.")}readFromLocalCache(e){throw new Error("Method not implemented.")}saveToLocalCachePersistent(e,t){throw new Error("Method not implemented.")}readFromLocalCachePersistent(e){throw new Error("Method not implemented.")}getLastCommittedURL(){return this.dataLoader.GetLoadTimeDataValue("lastCommittedURL","")}static parseApiWithErrorCatch(e){try{const t=e.GetLoadTimeDataValue(I.a.CouponsApiResponse,void 0);return JSON.parse(t)}catch(e){return}}getCurrency(){return"$"}getDataMaskRules(){return super.getDataMaskRules()}getSpbPdpOffer(){const e=this.dataLoader.GetLoadTimeDataValue("comparableOffers",void 0)||void 0,t=new S,o=(e?.value||[]).find((e=>e.position===f.zE.SPB_OFFERS)),i=o?.offer.itemOffered;if(i?.image?.contentUrl&&o?.promotionInformation?.rebateValue&&o?.offer?.price&&o?.offer?.priceCurrency&&e?.visibilityFeedbackUrl)return t.imageUrl=i.image?.contentUrl,t.cashbackProductTitle=i.name,t.productPrice=new m(o.offer.price,o?.offer?.priceCurrency),t.cashbackAmount=new m(o.offer.price,o?.offer?.priceCurrency),t.productBingUrl=o?.offer?.url,t.visibilityFeedbackUrl=e?.visibilityFeedbackUrl,t.cashbackAmount=new m(o.promotionInformation.rebateValue,o.offer.priceCurrencySymbol),t}async getSearchSpbOffers(){const e=await this.storageHandler.getStorageString(d.Q.ICCurrentPageInfo),t=[];if(!e||void 0===e)return new D([],void 0);try{const o=JSON.parse(e),i=o.cashbackData;if(i&&i.itemizedCashBackResponse&&i.itemizedCashBackResponse.offers&&i.itemizedCashBackResponse.offers.length>0){const e=i.itemizedCashBackResponse.offers,o=i.itemizedCashBackResponse.adsMetadata?.visibilityFeedbackUrl;if(!o)return this.loggerService.LogError("No visibility feedback url"),new D([],void 0);e.forEach((e=>{if(e.adsOffer.name&&e.adsOffer.price&&e.adsOffer.promotionInformation?.rebateValue){const i=new S,r=e.adsOffer.impressionToken;i.productBingUrl=e.adsOffer.url,i.shouldAutoshow=e.shouldAutoshow,i.imageUrl=e.imageUrl,i.cashbackProductTitle=e.adsOffer.name,i.description=e.description,i.productPrice=new m(e.adsOffer.price,"$"),i.cashbackAmount=new m(e.adsOffer.promotionInformation.rebateValue,"$"),i.visibilityFeedbackUrl=`${o}&tids=${r}`,t.push(i)}else this.loggerService.LogError("Failed to parse spb data",{spbCashback:e})}))}return new D(t,o.currentUrl)}catch(e){return new D([],void 0)}}async getCurrentSpbSearchQuery(){const e=await this.storageHandler.getStorageString(d.Q.ICCurrentPageInfo);try{const t=JSON.parse(e);if("search"===t.type||"searchSPB"===t.type)return(0,l.UE)(t?.query)?Promise.resolve(t?.query):Promise.resolve(void 0)}catch(e){return this.loggerService.LogError("failed to parse page info"),Promise.resolve(void 0)}}getCashbackTransactions(){const e=this.apiResponse?.cashback?.userTransactionsResponse;return e}highestCashbackCategory(){const e=this.apiResponse?.cashback?.highestCashbackCategory;if(!e){const e=this.storewideCategories();return e?e[0]:void 0}if(this.highestCashbackCategoryData)return this.highestCashbackCategoryData;try{const t=e;return t.commissionType&&t.commissionValue&&t.category?(this.highestCashbackCategoryData=t,this.highestCashbackCategoryData):void this.loggerService.LogError("Category data is corrupted",this.apiResponse)}catch(e){return void this.loggerService.LogError("Unable to parse highest category data",this.apiResponse)}}storewideCategories(){if(!this.apiResponse?.cashback?.categories)return;if(0===this.apiResponse.cashback.categories.length)return;const e=[];for(const t of this.apiResponse.cashback.categories)e.push(new O.Z(t));return e.length>0?(e.sort(((e,t)=>e.commissionValue>t.commissionValue?-1:1)),e):void 0}getRecentActivatedOffer(){if(this.apiResponse?.personalizedAdsResponse?.personalizedCashback?.ldData&&""!==this.apiResponse?.personalizedAdsResponse?.personalizedCashback?.ldData){const e=this.getActivatedOffers();if(e.length>0)return e[0]}}getActivatedOffers(){if(!this.apiResponse?.personalizedAdsResponse?.personalizedCashback?.adsCashback)return[];const e=this.apiResponse.personalizedAdsResponse,t={commissionType:e.personalizedCashback?.commissionType,commissionValue:e.personalizedCashback?.commissionValue,imageUrl:e.personalizedCashback?.imageUrl,isAdClick:e.personalizedCashback?.isAdClick,offerId:e.personalizedCashback?.offerId,productUrl:e.personalizedCashback?.productUrl,rGuid:e.personalizedCashback?.rGuid,scope:e.personalizedCashback?.scope,destinationUrl:e.personalizedCashback?.destinationUrl,adsCashback:e.personalizedCashback?.adsCashback};if(t&&t.adsCashback.length>0){const e=[];return t.adsCashback.forEach((t=>{const o=this.convertToItemCashbacData(t);e.push(o)})),e}return[]}isStorewideCashBackActivated(){return this.dataLoader.GetLoadTimeDataValue("rebatesActive",!1)}isEdgeRebateUser(){const e=this.dataLoader.GetLoadTimeDataValue("is_edge_profile_rebates_user",!1),t=this.apiResponse?.cashback?.userRebateResponse?.isRebatesUser;return e||(0,l.Nx)(t)}isAadSignedIn(){return(0,l.Nx)(this.apiResponse?.userInfo?.isAADSignedIn)}isConfirmationPage(){return this.dataLoader.GetLoadTimeDataValue("isConfirmationPage",!1)}isCashBackTurnedOff(){return this.dataLoader.GetLoadTimeDataValue("rebatesDeactivating",!1)}aadEmail(){return this.dataLoader.GetLoadTimeDataValue("aadEmail",void 0)}isAADLinkedAccountValid(){return this.dataLoader.GetLoadTimeDataValue("isAADLinkedAccountValid",!1)}isLinkingPolicyEnabled(){return this.dataLoader.GetLoadTimeDataValue("isLinkingPolicyEnabled",!1)}shouldSuppressRebatesScenarios(){return this.dataLoader.GetLoadTimeDataValue("suppress_rebates_scenarios",!1)}getActivateRebateStatus(){const e=this.dataLoader.GetLoadTimeDataValue("activateRebatesStatus",null);let t=f.FA.NOT_ACTIVATING;return null!=e&&(t=f.FA[f.FA[e]]),t}isSPBActivated(){return(0,l.Nx)(this.apiResponse?.itemLevelCashBack?.isSpbActivated)}setShouldExpandDetails(e){this.storageHandler.setStorageBool(d.Q.ShouldOpenOfferDetails,Boolean(e))}async getShouldExpandDetails(){return Boolean(this.storageHandler.getStorageBool(d.Q.ShouldOpenOfferDetails))}convertToItemCashbacData(e){const t=new S;return t.productBingUrl=e.productUrl,t.productRetailerUrl=e.destinationUrl,t.imageUrl=e.imageUrl,t.domain=e.domain,"Storewide"===e.scope?t.cashbackType=n.hB.PCBStorewide:(t.cashbackProductTitle=e.scope,t.cashbackType=n.hB.SPBorPPCashback),t.minPurchaseValue=e.minPurchaseValue,t.cashbackAmount=new m(Number.parseFloat(e.commissionValue),e.adsCurrencySymbol),t.expireTimeEpoch=e.expireTimeEpoch,t.productPrice=void 0,t.description=void 0,t.visibilityFeedbackUrl=void 0,t}}var y=N;class b{constructor(e,t){(0,i.Z)(this,"currentUrlMasked",void 0),(0,i.Z)(this,"cashbackDAO",void 0),(0,i.Z)(this,"personalDataRemover",void 0),(0,i.Z)(this,"currentPageType",g.GV.UnknownPage),this.cashbackDAO=e,this.personalDataRemover=t,this.currentUrlMasked=this.getCurrentUrlValue(!0),this.currentPageType=this.cashbackDAO.getPageType()}getDomainMarket(){return this.cashbackDAO.getCurrentMarket()}async getAnid(){return await this.cashbackDAO.getAnid()}sanConsentEnabled(){return this.cashbackDAO.getSanConsentFlag()}getCurrentDomain(){return this.cashbackDAO.getCurrentDomain()}getCurrentPageType(){return this.currentPageType}getMuid(){return"muid"}getCurrentUserType(){const e=this.cashbackDAO.isLinkingPolicyEnabled(),t=this.cashbackDAO.isAadSignedIn(),o=this.cashbackDAO.isAADLinkedAccountValid(),i=this.cashbackDAO.isEdgeRebateUser();return t&&e?o?n.qx.LinkedAAD:n.qx.LinkableAAD:i?n.qx.Rebate:n.qx.NonRebateUser}async getSearchQuery(){return await this.cashbackDAO.getCurrentSpbSearchQuery()}getCurrentUrl(){return this.currentUrlMasked}getCurrentUrlValue(e){const t=this.cashbackDAO.getLastCommittedURL();if(!e)return t;return this.personalDataRemover.deleteSecretsInURL(t)||""}}var k=o(12727),U=o(69698);class w{constructor(e,t,o){(0,i.Z)(this,"logModule",void 0),(0,i.Z)(this,"flyoutData",void 0),(0,i.Z)(this,"pageHandlerModule",void 0),(0,i.Z)(this,"stateManagement",void 0),(0,i.Z)(this,"storageHandler",void 0),(0,i.Z)(this,"utilities",void 0),(0,i.Z)(this,"cashbackContext",void 0),(0,i.Z)(this,"cashbackAvailableScenarioService",void 0),(0,i.Z)(this,"cashbackDAO",void 0),(0,i.Z)(this,"personalDataRemover",void 0),(0,i.Z)(this,"cashbackUIService",void 0),(0,i.Z)(this,"cashbackFastInitializer",void 0),this.logModule=o.logModule,this.pageHandlerModule=o.pageHandlerModule,this.stateManagement=e,this.flyoutData=t,this.utilities=o,this.storageHandler=o.storageHandler,this.stateManagement.addEventListener(a.e1.StyleProcessingState,(e=>{}))}getActivationService(){return new class{constructor(e,t,o,r,a){(0,i.Z)(this,"pageHandlerModule",void 0),(0,i.Z)(this,"storageHandler",void 0),(0,i.Z)(this,"localizedStringsData",void 0),(0,i.Z)(this,"loggerService",void 0),(0,i.Z)(this,"cashbackContext",void 0),(0,i.Z)(this,"stateManagement",void 0),this.pageHandlerModule=e,this.storageHandler=t,this.localizedStringsData=o,this.loggerService=r,this.cashbackContext=a,this.stateManagement=L.getFactory().getStateManagementModule()}listenForCashbackStateChange(e,t){new Map([[a.e1.rebatesNotActivating,n.VS.NonActivated],[a.e1.rebatesSignInPendingSuccess,n.VS.Activating],[a.e1.onRebatesTelemetrySuccess,n.VS.Activated],[a.e1.rebatesSignInFail,n.VS.Failed],[a.e1.rebatesFetchUserInfoFail,n.VS.FetchUserInfoFailed]]).forEach(((o,i)=>{this.stateManagement.addEventListener(i,(()=>{e.cashbackState=o,t()}))}))}getActivateCashbackLocalizedText(e){let t;const o=this.cashbackContext.getCurrentUserType();if(e.cashbackState===n.VS.Activated?t=o===n.qx.LinkableAAD?this.localizedStringsData.pcbLinkMsaActivateButton:e.cashbackType===n.hB.Storewide?this.localizedStringsData.cbActivatedButton:e.cashbackType===n.hB.PCBStorewide?o===n.qx.NonRebateUser?this.localizedStringsData.gcbSigninToClaim:this.localizedStringsData.cbActivatedButton:this.localizedStringsData.cbCashbackButtonActivated:e.cashbackState===n.VS.Activating&&r.Z.IsMobile()?t=this.localizedStringsData.cbProcessing:e.cashbackState===n.VS.Failed&&r.Z.IsMobile()||e.cashbackState===n.VS.FetchUserInfoFailed&&r.Z.IsMobile()?t=this.localizedStringsData.cbFailedRetry:e.cashbackState===n.VS.NonActivated&&(o===n.qx.LinkableAAD?t=this.localizedStringsData.pcbLinkMsaActivateButton:o===n.qx.NonRebateUser?t=e.cashbackType===n.hB.PCBStorewide?this.localizedStringsData.gcbSigninToClaim:this.localizedStringsData.cbBingActivateButton:o!==n.qx.Rebate&&o!==n.qx.LinkedAAD||(e.cashbackType===n.hB.SPBSearchCashback||e.cashbackType===n.hB.SPBPDPCashback?t=h.R.isExperimentActive(p.H.spbShortNotification)||h.R.isExperimentActive(p.H.spbPDPShortDesign)?this.localizedStringsData.cbActivateButton:this.localizedStringsData.gcOkButtonText:e.cashbackType===n.hB.Storewide&&(t=this.localizedStringsData.gcOkButtonText))),!t)throw this.loggerService.LogError("Message for activate button not found",e),new Error("Failed to localize a text for activate button");return t}activateCashback(e,t,o){const i=this.cashbackContext.getCurrentUserType(),a=this.getActivateCashbackLocalizedText(t).replace(" ","").toLowerCase();if(i===n.qx.NonRebateUser)this.pageHandlerModule.RecordAsUserAction(s.bS.ACTIVATE_CASHBACK_NEW),this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CASHBACK_NEW,o),this.pageHandlerModule.ActivateRebates(!0);else if(i===n.qx.LinkableAAD)this.linkUser();else if(t.cashbackState===n.VS.FetchUserInfoFailed&&r.Z.IsMobile())this.pageHandlerModule.RetryFetchUserInfo(!0);else if(t.cashbackType===n.hB.Storewide)this.activateStorewideCashback(t,o);else if(t.cashbackType===n.hB.PCBStorewide);else if(t.cashbackType===n.hB.SPBPDPCashback||t.cashbackType===n.hB.SPBSearchCashback){this.activateOffer(t,o,!0);const e=new Date;t.expireTimeEpoch=e.getTime()+864e5,t.cashbackState=n.VS.Activated}let l="";t?.isBlossom&&(l+="bloossom;"),t?.is3xIncentive&&(l+="3xIncentive;");const u=this.cashbackContext.getCurrentPageType(),d=this.cashbackContext.getCurrentUrl(),h=o?g.xu.UnifiedCashBackNotificationBtnClick:g.xu.UnifiedCashBackShorelineBtnClick,p={viewName:e,buttonName:a,cashBack:t,userType:i,additionalInfo:l,pageType:u,pageUrl:d,popupOrigination:o};this.loggerService.Log("Cashback button clicked",h,C.g.CouponImpressionId,p)}navigateToOffer(e){e.cashbackType!==n.hB.Storewide&&e.productBingUrl&&this.pageHandlerModule.NavigateToUrl(e.productBingUrl)}linkUser(){return this.pageHandlerModule.NavigateToUrl("https://www.msn.com/en-us/feed/personalize/settings?pc=edge"),Promise.resolve()}activateAndAddToCart(e,t){const o=!!t;this.storageHandler.setStorageBool(d.Q.GroceryInstantAddToCartSpb,o),this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CLICK_SPB_CASHBACK,t),this.activateOffer(e,t,!1)}activateOffer(e,t,o){e.productBingUrl&&(o?(this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CLICK_SPB_CASHBACK,t),this.pageHandlerModule.NavigateToUrl(e.productBingUrl)):this.makeBackgroundActivation(e,t))}async activateStorewideCashback(e,t){const o=this.cashbackContext.getCurrentUserType();o===n.qx.Rebate||o===n.qx.LinkedAAD?(this.pageHandlerModule.RecordAsUserAction(s.bS.ACTIVATE_CASHBACK),this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CASHBACK,t),r.Z.IsMobile()||(e.cashbackState=n.VS.Activated),await this.pageHandlerModule.ActivateRebates(!0)):e.cashbackType===n.hB.StorewideCashbackPinterest&&(this.pageHandlerModule.RecordAsUserAction(s.bS.PINTEREST_CASHBACK_ACTIVATED),this.pageHandlerModule.RecordAsUserEngagement(c.FV.PINTEREST_CASHBACK_ACTIVATED,t),r.Z.IsMobile()||(e.cashbackState=n.VS.Activated),await this.pageHandlerModule.ActivateRebates(!0))}sendVisibilityFeedbackUrl(e){e&&e.visibilityFeedbackUrl&&(0,l.UE)(e.visibilityFeedbackUrl)?this.pageHandlerModule.SendVisibilityFeedbBackUrl(e.visibilityFeedbackUrl):this.loggerService.LogError("Absent visibility feedback url",e)}makeBackgroundActivation(e,t){if(!e.productBingUrl)return;const o=this.pageHandlerModule.NavigateToUrlBackgroundWithResult(e.productBingUrl,e.productBingUrl,!0),i=this;o.then((async o=>{const r=o.result,a=(0,u.rm)(r);if(a){if(!e.productBingUrl)return;const o=this.getValueFromUrl(a.destinationUrl,"msclkid"),r=this.getValueFromUrl(e.productBingUrl,"ld");i.pageHandlerModule.RefreshDealsResponse(r,o,!1),i.pageHandlerModule.UpdateLoadTimeData(),i.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CLICK_SPB_CASHBACK,t)}})).catch((e=>{}))}getValueFromUrl(e,t){const o=e.split("?");if(o.length<=1)return"";const i=[];o.forEach((e=>{const t=e.split("&");i.push(...t)}));for(const e of i){const o=e.split("=");if(2===o.length&&o[0]===t)return o[1]}return""}}(this.pageHandlerModule,this.storageHandler,this.flyoutData.strings,this.getCashbackLogger(),this.getCasbackContext())}getCashbackFastInitializer(){return this.cashbackFastInitializer||(this.cashbackFastInitializer=new U.Op(this.getCashbackUIService())),this.cashbackFastInitializer}getPersonalDataRemover(){return this.personalDataRemover||(this.personalDataRemover=new k.Z(this.getCashbackDAO())),this.personalDataRemover}getCashbackUIService(){return this.cashbackUIService||(this.cashbackUIService=new class{constructor(e,t,o){(0,i.Z)(this,"utilities",void 0),(0,i.Z)(this,"flyoutData",void 0),(0,i.Z)(this,"loggerService",void 0),this.utilities=e,this.flyoutData=t,this.loggerService=o}applyStylesToShoppingSection(e){this.utilities.applyStyles(this.flyoutData.common.shopping,e,T.E.ICNotification)}isDarkMode(){return this.utilities.isDarkMode()}async createNotificationFromModule(e){return e&&e.element?(e.element.style.marginTop="0px",e.element.slot="header-content",e.element.accordion=!1,e.element.hideTitle=!0,this.flyoutData.common.shopping.classList.add("noSections"),this.utilities.applyStyles(this.flyoutData.common.shopping,"::part(header) {\n                    margin-top: 0px;\n                    margin-bottom: 0px;\n                }"),e):null}getRetailerImageUrl(){const e=this.utilities.getFavIconSrc(this.flyoutData.common.domain);if(!e||""===e){const e={domain:this.flyoutData.common.domain};this.loggerService.LogError("Icon not found",e)}return e}getCashbackImageUrl(e){return e?.imageUrl&&""!==e.imageUrl&&null!==e.imageUrl?e.imageUrl.startsWith("edge://image?")?e.imageUrl.replace("edge://image?","").replace("edge://image?",""):e.imageUrl.indexOf("localhost")>-1||e.imageUrl.indexOf("bing")>-1?e.imageUrl:"https://www.bing.com/"+e.imageUrl:(this.loggerService.LogError("No image found",e),"")}getExpireSoon(e){const t=e-(new Date).getTime();let o="0h 00m";if(t>0){const e=t/1e3/60,i=e/60,r=Math.floor(i/24),a=r>0?` ${r} days `:"",n=Math.floor(i-24*r),s=Math.floor(e-24*r*60-60*n);return o=`${a} ${n>0?n:0}h ${s>0?s:"00"}m`,o}return this.loggerService.LogError("Unable to calc expire time "),"Expires soon"}getMerchantFullName(){return this.flyoutData.dataStoreModule.CashBackData?.merchantFullName?this.flyoutData.dataStoreModule.CashBackData?.merchantFullName:this.flyoutData.common.domain}getPopupOrigination(){return this.flyoutData.common.popupOrigination}getFlyoutData(){return this.flyoutData}}(this.utilities.viewModulesUtilities,this.flyoutData,this.getCashbackLogger())),this.cashbackUIService}getLocalizedStringsData(){return this.flyoutData.strings}getStateManagementModule(){return this.stateManagement}getCashbackDAO(){return this.cashbackDAO||(this.cashbackDAO=new y(this.flyoutData.dataLoader,this.pageHandlerModule,this.storageHandler,this.getCashbackLogger())),this.cashbackDAO}getCasbackContext(){return this.cashbackContext||(this.cashbackContext=new b(this.getCashbackDAO(),this.getPersonalDataRemover())),this.cashbackContext}getCashbackAvailableScenarious(){return this.cashbackAvailableScenarioService||(this.cashbackAvailableScenarioService=new class{constructor(e,t,o,r){(0,i.Z)(this,"validBlossomStatus",new Set([P.OfferClaimed,P.EligibleUser,P.PayoutCompleted])),(0,i.Z)(this,"cashback",void 0),(0,i.Z)(this,"cashbackActivated",!1),(0,i.Z)(this,"loggerService",void 0),(0,i.Z)(this,"cashbackDAO",void 0),(0,i.Z)(this,"cashbackContext",void 0),(0,i.Z)(this,"pageHandler",void 0),(0,i.Z)(this,"popupOrigination",void 0),(0,i.Z)(this,"viewName",void 0),this.loggerService=e,this.cashbackDAO=t,this.cashbackContext=o,this.pageHandler=r,this.popupOrigination=this.pageHandler.PopupOrigination}closeIfNotification(e){if(!this.cashbackDAO.isPane()&&e>0){const t=this.pageHandler;setTimeout((()=>{t.DismissPopup()}),e)}}triggerExperiment(e){this.pageHandler.TriggerExperiment(e)}openPane(e,t,o){this.LogButtonClick(e,t,void 0,"button was clicked"),this.cashbackDAO.setShouldExpandDetails(o),this.pageHandler.OpenPane(this.popupOrigination)}async getShouldExpandDetails(){const e=await this.cashbackDAO.getShouldExpandDetails();return this.cashbackDAO.setShouldExpandDetails(!1),Boolean(e)}is3xIncentiveCashback(){if(!this.cashbackDAO.getFeatureFlag("3xIncentiveCashback"))return!1;if("en-us"===this.cashbackDAO.getCurrentMarket()){const e=this.cashbackDAO.storewideCategories();if(e)for(let t=0;t<e.length;t++){const o=e[t];if(o.category?.toLowerCase().includes(A.eS))return!0}}return!1}async isBlossomScenario(e){if(!h.R.isExperimentActive(p.H.blossomCampaign))return!1;if(!this.cashbackDAO.getFeatureFlag("blossomFeature"))return!1;if(this.cashbackContext.getCurrentPageType()!==g.GV.ConfirmationPage)return!1;if(e){const e=await this.cashbackContext.getAnid();if(!e)return!1;const t=await this.cashbackDAO.GetBlossomUserStatus(e);if(t&&this.validBlossomStatus.has(t))return!0}else{const e=await this.cashbackDAO.GetShouldShowBlossomFlag();if(this.loggerService.Log(`getBlossomNotificationString: Blossom string requested. Should show: ${e}.`,g.xu.RebatesConfirmationBlossomNotification,C.g.CouponImpressionId),e)return this.cashbackDAO.ResetBlossomNotificationFlag(),!0}return!1}getSPBPDPOffer(){const e=this.cashbackDAO.getSpbPdpOffer();return e&&(e.cashbackType=n.hB.SPBPDPCashback,e.cashbackState=n.VS.NonActivated),e}navigateToMicrosoftRewards(){this.pageHandler.NavigateToMicrosoftRewards()}navigateToTermsStatementFlyout(){this.pageHandler.NavigateToTermsStatementFlyout()}navigateToPrivacyCookiesStatement(){this.pageHandler.NavigateToPrivacyCookiesStatement()}navigateToRebateHistory(){this.pageHandler.NavigateToUrl("https://www.bing.com/rebates/history")}calcDiscount(e){if(e?.productPrice&&e?.cashbackAmount)return`${(100-100*(e.productPrice.price-e.cashbackAmount.price)/e.productPrice.price).toFixed(0)}%`}getCashbackPriceAfterDiscount(e){if(e.productPrice&&e.cashbackAmount)return`${(e.productPrice.price-e.cashbackAmount.price).toFixed(2)}`}LogUserShownModule(e,t){const o=this.cashbackContext.getCurrentUserType();"confirmationPage"===e?this.loggerService.Log("User saw confirmation notification, new UX",g.xu.RebatesConfirmationNotification,C.g.CouponImpressionId):"PCBconfirmationPage"===e&&this.loggerService.Log("User saw confirmation notification, new UX",g.xu.PersonalizedCashbackConfirmationNotification,C.g.CouponImpressionId);let i="";t?.isBlossom&&(i+="bloossom;"),t?.is3xIncentive&&(i+="3xIncentive;");const r=this.cashbackContext.getCurrentPageType(),a=this.cashbackContext.getCurrentUrl(),n=this.cashbackDAO.isPane()?g.xu.UnifiedCashBackShorelineModule:g.xu.UnifiedCashBackNotificationModule,s={viewName:e,buttonName:"none",cashback:t,userType:o,additionalInfo:i,pageType:r,pageUrl:a,popupOrigination:this.pageHandler.PopupOrigination};this.loggerService.Log("Cashback was shown",n,C.g.CouponImpressionId,s)}async getPersonalizedOfferHero(){const e=this.cashbackDAO.getRecentActivatedOffer();if(e){const t=this.cashbackContext.getCurrentUserType();t===n.qx.LinkableAAD||t===n.qx.NonRebateUser||t===n.qx.NotEnrollledUser?e.cashbackState=n.VS.NonActivated:e.cashbackState=n.VS.Activated}return e}showPrivacyText(){const e=this.cashbackContext.getCurrentUserType();return e===n.qx.NotEnrollledUser||e===n.qx.LinkableAAD||e===n.qx.NonRebateUser}experimentalFlight(){return!1}async anyCashbackScenarioAvailable(){if(this.cashbackDAO.shouldSuppressRebatesScenarios())return!1;const e=await this.spbSearchScenarioAvailable(),t=this.cashbackDAO.getActivatedOffers(),o=this.storewideOfferAvailable()||t&&t.length>0||e;return this.loggerService.LogDebugInfo(`Any scenario avaiable ${o}`),o}storewideOfferAvailable(){return void 0!==this.cashbackDAO.highestCashbackCategory()}getStoreWideOffer(){if(!this.cashbackDAO.getFeatureFlagEnabledByDefault("edge.affiliateoffer.module"))return;const e=new S,t=this.cashbackDAO.highestCashbackCategory(),o=this.cashbackDAO.storewideCategories(),i=this.cashbackDAO.isStorewideCashBackActivated(),r=this.cashbackDAO.getActivateRebateStatus();return o&&t?(e.cashbackType=n.hB.Storewide,i||r===f.FA.ACTIVATED||r===f.FA.PENDING_ACTIVATION_IN_PROFILE?e.cashbackState=n.VS.Activated:e.cashbackState=n.VS.NonActivated,t&&(e.cashbackCategories=o,e.cashbackAmount=new m(t.commissionValue,t.commissionType)),e):void 0}async getSpbSearchHeroForOffer(){if(await this.spbSearchScenarioAvailable()){const e=await this.getSearchSpbOffersForCurrentPage();for(let t of e){if(void 0===t.shouldAutoshow||null===t.shouldAutoshow)return t;if((0,l.Nx)(t.shouldAutoshow))return t}}}getAllActivatedOffers(){const e=this.cashbackDAO.getActivatedOffers();return e.forEach((e=>{e.cashbackState=n.VS.Activated})),e}async getSearchSpbOffersForCurrentPage(){const e=this.cashbackContext.getCurrentUrl(),t=await this.cashbackDAO.getSearchSpbOffers();return t.requestedForSearchUrl!==e?(this.loggerService.LogDebugInfo(`spb search not shown due to diffrent url ${t.requestedForSearchUrl} and ${e}`),Promise.resolve([])):(t.cashbackItems.forEach((e=>{e.cashbackState=n.VS.NonActivated,e.cashbackType=n.hB.SPBSearchCashback})),t.cashbackItems)}getCashbackTransactions(){return this.cashbackDAO.getCashbackTransactions()}async spbSearchScenarioAvailable(){const e=await this.getSearchSpbOffersForCurrentPage();return!!(e&&e.length>0)}LogButtonClick(e,t,o,i=""){const r=this.cashbackContext.getCurrentUserType(),a=this.cashbackDAO.isPane()?g.xu.UnifiedCashBackShorelineBtnClick:g.xu.UnifiedCashBackNotificationBtnClick,n={viewName:e,buttonName:t,cashback:o,userType:r,pageUrl:this.cashbackContext.getCurrentUrl()};this.loggerService.Log(i,a,C.g.CouponImpressionId,n)}}(this.getCashbackLogger(),this.getCashbackDAO(),this.getCasbackContext(),this.pageHandlerModule)),this.cashbackAvailableScenarioService}getCashbackLogger(){return new class{constructor(e){(0,i.Z)(this,"logModule",void 0),this.logModule=e}Log(e,t,o,i){const r=new E.Z(t);r.Metadata=JSON.stringify(i),this.logModule.LogInfoEvent(g.R.EdgeFlyoutStatus,e,r,o)}LogDebugInfo(e,t){const o=new E.Z(g.xu.UnifiedCashBackDebugLog);o.Metadata=JSON.stringify(t),this.logModule.LogInfoEvent(g.R.EdgeFlyoutStatus,e,o)}LogError(e,t){const o=new E.Z(g.xu.UnifiedCashBackDebugLog);o.Metadata=JSON.stringify({user:void 0,componentData:t}),this.logModule.LogErrorEvent(g.R.EdgeFlyoutStatus,e,o)}LogInfo(e,t){throw new Error("Method not implemented.")}LogInfoWithEvenType(e,t,o){throw new Error("Method not implemented.")}}(this.logModule)}static didBaseURLChange(e,t){return e!==t&&(!e||!t||new URL(e).origin!==new URL(t).origin)}static initFactory(e,t,o){const i=this.instance?.cashbackContext?.getCurrentUrl(),r=t.dataStoreModule.CashBackData?.lastCommittedURL,a=this.didBaseURLChange(i,r);return this.instance&&!a||(this.instance=new w(e,t,o)),this.instance}static getFactory(){return this.instance}static resetFactory(e){this.instance&&(this.instance.flyoutData=e,this.instance.cashbackDAO=void 0,this.instance.cashbackAvailableScenarioService=void 0,this.instance.cashbackUIService=void 0,this.instance.cashbackUIService=void 0)}}(0,i.Z)(w,"instance",void 0);var L=w},42544:function(e,t,o){var i=o(72370);t.Z=class{constructor(e){(0,i.Z)(this,"category",void 0),(0,i.Z)(this,"commissionType",void 0),(0,i.Z)(this,"commissionValue",void 0),(0,i.Z)(this,"priority",void 0),this.category=e?.category,this.commissionType=e?.commissionType,this.commissionValue=e?.commissionValue,this.priority=e?.priority}}},8553:function(e,t,o){var i=o(72370),r=o(4872),a=o(31656),n=o(93209),s=o(59645),c=o(11232),l=o(40843),u=o(65358),d=o(5144),h=o(88767),p=o(55590),g=o(36493),C=o(33491),S=o(91495),m=o(91897),A=o(27689),P=o(81687);function f(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function E(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?f(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const T=["ja-jp","de-de","en-gb","en-ca","en-in","fr-fr","it-it","es-es","es-mx"];class O{static showedOOSNotifcationRecently(){try{const e=9e5;return Date.now()-+new Date(S.Q.ProductTrackingOOSLastShown)<e}catch(e){return!1}}static getDomainFromUrl(e){if(!e)return"";e=e.startsWith("http")?e:`https://${e}`;try{const t=new URL(e).hostname.split("."),o=t.length<3?t[0]:t[1];return`${o[0].toUpperCase()}${o.substring(1)}`}catch(t){return e}}static GetStrippedTitle(e,t){const o=new RegExp(`[\\s\\W]*${t}[\\s\\W]*`,"gi");return e?.replace(o,"")}static GetStrippedUrl(e){const t=O.getDomainFromUrl(e)?.toLocaleLowerCase();return"amazon"===t?e.replace(/\/ref=[A-z0-9_]+/,""):e}static isSameUrl(e,t){return(e=O.GetStrippedUrl(e))===O.GetStrippedUrl(t)}static isSameUrlByPathName(e,t){if(O.isSameUrl(e,t))return!0;try{const o=new URL(O.GetStrippedUrl(e.toLowerCase())),i=new URL(O.GetStrippedUrl(t.toLowerCase()));return o.origin===i.origin&&o.pathname===i.pathname}catch(e){return!1}}static IsSameProduct(e,t){if(!e||!t)return!1;if(e&&(e?.ProductId??e?.productId)===(t?.ProductId??t?.productId))try{const o=new URL(e.ProductUrl??e.productUrl);return new URL(t.ProductUrl??t.productUrl).hostname===o.hostname}catch{}return!1}static async IsTrackedProductForAOC(e){const t=O.getUrlAndProductToMap(S.Q.UrlToProductMap)?.[e];let o=[];const i=(0,A.Ad)(S.Q.TrackedProductsData??"{}");if(o=i?.trackedProducts??[],t)return o?.find((e=>O.IsSameProduct(e,t)));if(o){let t=!0;for(const i of o){if(O.isSameUrl(i.ProductUrl,e))return i;O.isSameUrlByPathName(i.ProductUrl,e)&&(t=!1)}if(t)return}try{const e=await fetch("https://www.bing.com/api/shopping/v1/savings/product-tracking/is-tracked",{headers:{Source:"ProductTracking",Service:"Extension/UX"}}).then((e=>e.json()));return e?.product??void 0}catch{}}static ProductWithPriceDropAndNoNotification(e){if(e?.length)return e.find((e=>e&&!e.notificationEnabled&&e.basePrice&&e.CurrentPrice&&e.CurrentPrice<e.basePrice&&!this.productExpired(e)))}static productExpired(e){const t=new Date,o=new Date(e.expirationDate??"");return"Invalid Date"===o.toString()||(e.expirationDate?.endsWith("Z")||o.setMinutes(o.getMinutes()-t.getTimezoneOffset()),+o<+t)}static getUrlAndProductToMap(e){if(!e)return{};let t={};return t=(0,A.Ad)(e),t||(t={}),t}constructor(e,t,o){this.flyoutData=t,this.stateManagement=o,(0,i.Z)(this,"pageHandlerModule",void 0),(0,i.Z)(this,"logModule",void 0),(0,i.Z)(this,"telemetryUtilities",void 0),(0,i.Z)(this,"utilities",void 0),(0,i.Z)(this,"storageHandler",void 0),(0,i.Z)(this,"anid",void 0),(0,i.Z)(this,"dealsEndpoint","https://www.bing.com/api/shopping/v1/savings"),(0,i.Z)(this,"trackedProductsCachePeriod",12e5),(0,i.Z)(this,"anidTrackingDataCachePeriod",864e5),(0,i.Z)(this,"userConsented",void 0),this.pageHandlerModule=e.pageHandlerModule,this.logModule=e.logModule,this.utilities=e.viewModulesUtilities,this.storageHandler=e.storageHandler,this.telemetryUtilities=e.telemetryHandler}AnidTrackingAvailable(){const e=this.flyoutData.dataLoader.GetLoadTimeDataValue("aadEmail",void 0);return a.R.isExperimentActive(r.H.PTEmail)&&!e}async shouldRenderProductCollections(e){let t=!1;const o=a.R.isExperimentActive(r.H.productTracking),i=this.flyoutData.common.market?.toLowerCase()??"",n="en-us"===i||!i,s=await this.GetLocalProductTrackingData(),c=e?.toLocaleLowerCase().includes("amazon."),l=c&&T.includes(i);return s&&s?.trackedProducts?.length>0&&(t=!0),Promise.resolve((o||n||l||t)&&this.flyoutData.common.isPane)}async hasUserConsented(){if(!this.AnidTrackingAvailable())return!1;if(void 0!==this.userConsented)return this.userConsented;const e=await this.storageHandler.getStorageString(p.Q.ProductTrackingConsentStatus),t=(0,A.Ad)(e)??"";let o="";if(this.pageHandlerModule.IsMessageAllowed("getEdgeAnid")&&(o=(await this.pageHandlerModule.GetEdgeAnid(!0))?.anid,!o))return!1;if(t&&t.IsAnidTrackingConsented)return!0;const i=await this.GetAnidProductTrackingData(o),r=i?.trackingPreferences?.IsAnidTrackingConsented,a=await this.GetLocalProductTrackingData();i?.trackingPreferences&&this.storageHandler.setStorageString(p.Q.ProductTrackingConsentStatus,JSON.stringify({IsAnidTrackingConsented:!!r,timestamp:Date.now()}));const n=r||void 0===r&&0===a?.trackedProducts?.length;return this.userConsented=n}async anidLoggedInHasTrackedProductsButNotExplicitlyConsented(){if(!this.AnidTrackingAvailable())return!1;const e=(await this.pageHandlerModule.GetEdgeAnid(!0))?.anid,t=await this.GetAnidProductTrackingData(e),o=t?.trackingPreferences?.IsAnidTrackingConsented,i=await this.GetLocalProductTrackingData();return e&&!o&&i?.trackedProducts?.length}setConsentLastShown(e){e&&this.storageHandler.setStorageString(p.Q.ProductCollectionBannerLastShown,JSON.stringify({timestamp:Date.now(),banner:e}))}async shownBannerRecently(e){const t=await this.storageHandler.getStorageString(p.Q.ProductCollectionBannerLastShown),o=(0,A.Ad)(t);return o?.banner===e&&Date.now()-o.timestamp<2*m.nQ}static isSupportedDomainForPrice(e,t,o){const i=t?.isUnsupportedDomain;if(!0===i)return!1;o=o?.toLowerCase();const n=a.R.isExperimentActive(r.H.productTracking),s="en-us"===o||!o,c=e?.toLocaleLowerCase().includes("amazon."),l=c&&T.includes(o);return n||s||l}static isSupportedDomainAOC(e,t,o){return this.isSupportedDomainForPrice(e,t,o)}async GetAnidProductTrackingData(e){if(!e)return null;const t=await this.storageHandler.getStorageString(p.Q.ProductTrackingAnidData);if(t){const e=(0,A.Ad)(t);if(e?.timestamp&&!this.isStaleAnidTrackingData(e))return e}return this.GetAnidProductTrackingDataFromEndpoint(e)}async GetAnidProductTrackingDataFromEndpoint(e){e=e??await this.getAnid();const t=await this.createRequest(`tracked-products?anid=${e}`,void 0,"GET"),o=new l.Z(t?.productTrackingData);return o.timestamp=Date.now().toString(),this.storageHandler.setStorageString(p.Q.ProductTrackingAnidData,JSON.stringify(o)),o}async TrackProduct(e,t,o,i){const r=await this.createTrackProductBody(e,this.flyoutData.common,t,o,i);if(!r){const r=new s.Z(d.xu.ProductTrackingDebug);return r.Metadata=JSON.stringify({product:e,isOutOfStock:t,duration:o,priceDrop:i}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,"Failed to track product. Invalid product data",r),null}try{const t=await this.createRequest("track",r);if(await this.GetLocalProductTrackingDataFromEndpoint(),!t?.success)throw new Error(t.errorCode||t.errorMessage);return t.product&&this.addProductToUrlProductsMap(e.ProductUrl,t.product),new u.ZP(t.product)}catch(t){const o=new s.Z(d.xu.ProductTrackingNetworkError);o.Metadata=JSON.stringify({product:e,err:t,productRequest:r}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Track product request failed: ${t}`,o)}return null}async TrackProductLocal(e){if(!e)return[];let t=await this.GetLocalProductTrackingData();if(t&&Array.isArray(t.trackedProducts)){const o=t.trackedProducts.findIndex((t=>O.IsSameProduct(t,e)));-1===o?t.trackedProducts.push(e):t.trackedProducts[o]=e}else t={trackedProducts:[e]};return t.timestamp=(new Date).toString(),this.storageHandler.setStorageString(p.Q.ProductTrackingTrackedProducts,JSON.stringify(t)),t.trackedProducts}async UntrackProduct(e){const t=await this.createUntrackProductBody(e,this.flyoutData.common);try{const o=await this.createRequest("untrack",t);if(this.GetLocalProductTrackingDataFromEndpoint(),!o.success)throw new Error(o.errorCode||o.errorMessage);return await this.removeProductFromUrlProductsMap(e.ProductUrl),o.success}catch(o){const i=new s.Z(d.xu.ProductTrackingNetworkError);i.Metadata=JSON.stringify({product:e,productRequest:t,err:o}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Untrack product request failed: ${o}`,i)}return!1}async UntrackProductLocal(e){if(!e)return[];const t=await this.GetLocalProductTrackingData();return t?(t.trackedProducts=(t?.trackedProducts||[]).filter((t=>!O.IsSameProduct(t,e))),t.timestamp=(new Date).toString(),this.removeProductFromUrlProductsMap(e.ProductUrl),this.storageHandler.setStorageString(p.Q.ProductTrackingTrackedProducts,JSON.stringify(t)),t.trackedProducts):[]}async SetAbandondedCartPreferences(e){const t={Muid:this.flyoutData.common.muid,Anid:await this.getAnid(),Preferences:{AbandonedCartTrackingEnabled:e}};try{const e=await this.createRequest("set-user-preferences",t);if(this.GetLocalProductTrackingDataFromEndpoint(),!e.success)throw new Error(e.errorCode||e.errorMessage);return e.success}catch(e){const t=new s.Z(d.xu.ProductTrackingNetworkError);t.Metadata=JSON.stringify({err:e}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Set Muid preferences request failed: ${e}`,t)}return!1}async RoamProductsFromEndpoint(){const e=await this.getAnid(),t=this.flyoutData.common.muid,o=(await this.pageHandlerModule.GetEmailForMSA(!0))?.email,i={Muid:t,Anid:e,Email:o};try{const t=await this.createRequest("roam-products",i);if(this.GetLocalProductTrackingDataFromEndpoint(),this.GetAnidProductTrackingDataFromEndpoint(e),!t.success)throw new Error(t.errorCode||t.errorMessage);return this.storageHandler.setStorageString(p.Q.ProductTrackingConsentStatus,JSON.stringify({IsAnidTrackingConsented:!0,timestamp:Date.now()})),t.success}catch(e){const t=new s.Z(d.xu.ProductTrackingNetworkError);t.Metadata=JSON.stringify({err:e}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Roam products request failed: ${e}`,t)}return!1}async LogProductNotification(e,t,o){if(!e||!t)return!1;try{const i=await this.createRequest("log-notification",{Muid:e,ProductUrl:t},"POST",o);if(!i.success)throw new Error(i.errorCode||i.errorMessage);return!0}catch(o){const i=new s.Z(d.xu.ProductTrackingNetworkError);i.Metadata=JSON.stringify({Url:t,Muid:e,err:o}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Log notification request failed: ${o}`,i)}return!1}async GetTrackedProductFromApi(e){const t=await this.getAnid(),o=this.flyoutData.common.muid;try{let i={Muid:o,Url:e};await this.canUseAnidForRequest(t)&&(i={Anid:t,Url:e});const r=await this.createRequest("is-tracked",i);if(!r.success)throw new Error(r.errorCode||r.errorMessage);return r.product}catch(i){const r=new s.Z(d.xu.ProductTrackingNetworkError);return r.Metadata=JSON.stringify({Url:e,Muid:o,Anid:t,err:i}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,"Is tracked product request failed",r),null}}async GetTrackedProductsBySource(e){const t=await this.getProductTrackingData(),o=t?.trackedProducts.filter((t=>t.trackingSource===e));return o}async getProductTrackingData(){const e=await this.GetLocalProductTrackingData();return!e||await this.isStaleTrackedProducts(e)?await this.GetLocalProductTrackingDataFromEndpoint():e}async SetProductTrackingData(e,t){const o=e.trackedProducts,i=e.trackingPreferences;if(!o)return[];let r;return r&&Array.isArray(r.trackedProducts)?r.trackedProducts=o:r={trackedProducts:o},i&&(r.trackingPreferences=i),t?r._anid=await this.getAnid():r._muid=this.flyoutData.common.muid,r.timestamp=(new Date).toString(),this.storageHandler.setStorageString(p.Q.ProductTrackingTrackedProducts,JSON.stringify(r)),r.trackedProducts}async GetLocalProductTrackingData(){const e=await this.storageHandler.getStorageString(p.Q.ProductTrackingTrackedProducts);try{const t=JSON.parse(e);if(Array.isArray(t?.trackedProducts))return t}catch(e){return{trackedProducts:[]}}}async isTrackedProduct(e){return!!await this.GetTrackedProduct(e)}async GetTrackedProduct(e){if(!e)return null;const t=await this.storageHandler.getStorageString(p.Q.ProductTrackingUrlProductCache);let o=O.getUrlAndProductToMap(t);if(this.AnidTrackingAvailable()){const e=await this.getAnid();!e&&o.anid&&(o={},this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify({muid:this.flyoutData.common.muid}))),await this.canUseAnidForRequest(e)&&o.muid&&(o={},this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify({anid:e})))}const i=o?.[e];if(i)return i;const r=await this.GetLocalProductTrackingData();let a=!0;if(r?.trackedProducts){for(const t of r.trackedProducts){if(O.isSameUrl(t.ProductUrl,e))return t;O.isSameUrlByPathName(t.ProductUrl,e)&&(a=!1)}if(a)return null}const n=await this.GetTrackedProductFromApi(e);return n&&await this.addProductToUrlProductsMap(e,n),n}async checkIsOutOfStock(){const e=await this.getOutOfStockData();return!!e&&(O.isSameUrlByPathName(e?.productUrl,this.flyoutData.common.lastCommittedURL)?e&&"OUT_OF_STOCK"===e?.status:(this.storageHandler.clearStorage(p.Q.ProductTrackingOOSData),!1))}async getOutOfStockData(){const e=await this.storageHandler.getStorageString(p.Q.ProductTrackingOOSData);if(e)return(0,A.Ad)(e)}async sendTrackingData(e,t,o,i,r){const{strings:a}=this.flyoutData;if(!e){const e=new s.Z(d.xu.ProductTrackingDebug);return e.Metadata=JSON.stringify({url:this.flyoutData.common.lastCommittedURL,isOutOfStock:o}),void this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,"Product unavailable, unable to track or untrack",e)}const n=new CustomEvent(P.e1.ProductTrackingUpdate);if(t){const t=await this.TrackProduct(e,o,i,r);if(await this.TrackProductLocal(t),t){const e=o?a.productTrackingStockTrackAlert:a.productTrackingPriceTrackAlert;this.stateManagement.dispatchEvent((0,P.eT)({text:e}))}else this.stateManagement.dispatchEvent((0,P.eT)({text:a.productTrackingTrackFailed}))}else{const t=await this.GetTrackedProduct(e.ProductUrl);this.UntrackProductLocal(t),await this.UntrackProduct(e)||this.stateManagement.dispatchEvent((0,P.eT)({text:a.productTrackingUntrackFailed}))}this.stateManagement.dispatchEvent(n)}recordTrackingToggleChange(e,t,o,i,r,a,s){const c=Object.assign({},t,{base64ProductImage:void 0}),l=this.flyoutData.common.openedWith===h.Te.Auto,u=JSON.stringify(E(E({duration:a,priceDropValue:s},c),{},{source:r,isOutOfStock:i,isNotification:l})),p=new n.Z(e,this.telemetryUtilities.setContentViewed(r),this.flyoutData.common.domain,u),g=`Product ${o?"":"un"}tracked from ${r}`;this.logModule.LogInfoEvent(d.R.ButtonClick,g,p)}setAlertSettingsPrefs(e,t){(0,C.Xo)("ptAlertSettingsPrefs",`${e}-${t}`)}getAlertSettingsPrefs(){const e=(0,C.Mw)("ptAlertSettingsPrefs"),t={};if(e){const[o,i]=e.split("-",2);isNaN(Number(o))||(t.priceDropValue=Number(o)),isNaN(Number(i))||(t.durationValue=Number(i))}return t}resetAlertSettingsPrefs(){(0,C.TJ)("ptAlertSettingsPrefs")}extractExtractedEntityData(e,t,o){if(!e)return null;const i=e?.entity??e.product_og_entity,r=i?.image||e.image_url,a=O.GetStrippedTitle(i?.name||e?.title,this.flyoutData.common.domain);let n=i?.price_value||i?.["offers/price"]?.substring(1);if(n||(n=this.flyoutData.dataLoader.GetLoadTimeDataValue("price",void 0)?.toString()??o),a&&(n||t)){const e=new c.Z(a,r,i?.price_currency??"$");return e.price=n||"",e.ProductUrl=this.flyoutData.common.lastCommittedURL,e}return null}ResetOutOfFlowNotificationFrequency(){const e=this.flyoutData.dataStoreModule.ProductTrackingNotificationData?.TrackedProducts;e&&e.length>2?this.pageHandlerModule.setShoppingNotificationFrequencyHours(3):this.pageHandlerModule.setShoppingNotificationFrequencyHours(24)}getAndCacheAfdMarket(){const e=this.flyoutData.common.afdMarket;return e?((0,C.Xo)("afdMarket",e),e):(0,C.Mw)("afdMarket")||""}async canUseAnidForRequest(e){return this.AnidTrackingAvailable()&&!!e&&await this.hasUserConsented()}async getAnid(){if(!this.AnidTrackingAvailable())return"";if(!this.anid){const e=(await this.pageHandlerModule.GetEdgeAnid(!0)).anid;this.anid=e??""}return this.anid}async GetLocalProductTrackingDataFromEndpoint(){try{const e=await this.getAnid();let t=!1,o=`tracked-products?muid=${this.flyoutData.common.muid}&trackingSource=5`;await this.canUseAnidForRequest(e)&&(o=`tracked-products?anid=${e}&trackingSource=5`,t=!0);const i=await this.createRequest(o,void 0,"GET"),r=new l.Z(i?.productTrackingData);return r&&this.SetProductTrackingData(r,t),r}catch(e){const t=new s.Z(d.xu.ProductTrackingNetworkError);return this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Unable to get tracked products ${e}`,t),new l.Z(void 0)}}async addProductToUrlProductsMap(e,t){const o=await this.storageHandler.getStorageString(p.Q.ProductTrackingUrlProductCache),i=E(E({},O.getUrlAndProductToMap(o)),{},{[e]:t});this.AnidTrackingAvailable()?i.anid=await this.hasUserConsented()?await this.getAnid():void 0:i.muid=this.flyoutData.common.muid,this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify(i))}async removeProductFromUrlProductsMap(e){const t=await this.storageHandler.getStorageString(p.Q.ProductTrackingUrlProductCache),o=O.getUrlAndProductToMap(t);this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify(E(E({},o),{},{[e]:void 0})))}async createRequest(e,t,o="POST",i){const r=this.flyoutData.dataLoader.GetLoadTimeDataValue("enabledservicefeatures",{}),a=this.flyoutData.dataLoader.GetLoadTimeDataValue("enabledservicefeaturesv2",{}),n=await fetch(`${this.dealsEndpoint}/product-tracking/${e}`,{body:JSON.stringify(t),headers:{"Content-Type":"application/json",Source:"ProductTracking",Service:i??"Extension/UX",EnabledServiceFeatures:JSON.stringify(r),EnabledServiceFeaturesv2:JSON.stringify(a)},method:o});return await n.json()}async createUntrackProductBody(e,t){const o={Currency:e.currency??e.CurrencySymbol,Domain:t.domain,Market:t.market??t.afdMarket,Muid:t.muid,Url:e.ProductUrl},i=await this.getAnid();return await this.canUseAnidForRequest(i)&&(o.Anid=await this.getAnid()),o}async createTrackProductBody(e,t,o,i,r){const a={Currency:e.currency||"$",Domain:t.domain,ImageUrl:e.imageUrl,Market:t.market??t.afdMarket,Muid:t.muid,ProductStockStatus:o?2:1,TrackingType:o?"OutOfStock":"PriceDrop",Title:O.GetStrippedTitle(e.title,t.domain),Url:O.GetStrippedUrl(e.ProductUrl??t.lastCommittedURL)},n=await this.getAnid();await this.canUseAnidForRequest(n)&&(a.Anid=n,a.Muid=t.muid);const s=(0,g.K)(e?.price?.toString()??"");return Number.isNaN(s)||(a.Price=s),i&&(a.DurationInWeeks=i),r&&!o&&(a.DropPercentage=r),a}async isStaleTrackedProducts(e){if(!e)return!0;const{timestamp:t}=e,o=await this.hasUserConsented();if(!o&&e._anid)return!0;if(o&&e._muid)return!0;if(!t)return!0;try{const e=new Date(t);return Date.now()-+e>this.trackedProductsCachePeriod}catch(e){return!0}}isStaleAnidTrackingData(e){if(!e)return!0;const{timestamp:t}=e;if(!t)return!0;try{const e=new Date(+t);return Date.now()-+e>this.anidTrackingDataCachePeriod}catch(e){return!0}}}t.ZP=O},56764:function(e,t,o){o.d(t,{g:function(){return i}});let i=function(e){return e.EdgeImpressionId="EdgeImpressionId",e.CouponImpressionId="CouponImpressionId",e.DomainName="DomainName",e.Client="Client",e.FlyoutId="FlyoutId",e.EdgeChannel="EdgeChannel",e}({})},87605:function(e,t,o){o.d(t,{bS:function(){return i}});let i=function(e){return e.VIEW_PRODUCT_SUMMARY_CARD="VIEW_PRODUCT_SUMMARY_CARD",e.COUPONS_COPIED="COUPONS_COPIED",e.DISMISSED="DISMISSED",e.FLYOUT_SNOOZED="SNOOZED",e.FLYOUT_SNOOZE_UNDO="FLYOUT_SNOOZE_UNDO",e.FRE_DISMISSED="FRE_DISMISSED",e.FRE_GOT_IT="FRE_GOT_IT",e.FRE_MANAGE="FRE_MANAGE",e.FRE_NO_THANKS="FRE_NO_THANKS",e.FRE_SETTINGS="FRE_SETTINGS",e.MANAGE="MANAGE",e.NAVIGATE_TO_RETAILER="NAVIGATE_TO_RETAILER",e.TRY_ALL_COUPONS="TRY_ALL_COUPONS",e.TURN_OFF_AUTO_SHOW="TURN_OFF_AUTO_SHOW",e.TURN_ON_AUTO_SHOW="TURN_ON_AUTO_SHOW",e.VIEW_MORE_COUPONS="VIEW_MORE_COUPONS",e.VIEW_MORE_RETAILERS="VIEW_MORE_RETAILERS",e.VIEW_MORE_GROCERY_COUPONS="VIEW_MORE_GROCERY_COUPONS",e.LIGHT_DISMISSED="LIGHT_DISMISSED",e.SHOW_MORE_SELLERS="SHOW_MORE_SELLERS",e.REBATES_VIEW_IN_PANE="REBATES_VIEW_IN_PANE",e.REBATES_LEARN_MORE="REBATES_LEARN_MORE",e.REBATES_ACCOUNT="REBATES_ACCOUNT",e.REBATES_HISTORY="REBATES_HISTORY",e.ACTIVATE_CASHBACK="ACTIVATE_CASHBACK",e.EXPAND_PRICE_HISTORY_GRAPH="EXPAND_PRICE_HISTORY_GRAPH",e.HIDE_PRICE_HISTORY_GRAPH="HIDE_PRICE_HISTORY_GRAPH",e.FIRST_HOVER_PRICE_HISTORY_GRAPH="FIRST_HOVER_PRICE_HISTORY_GRAPH",e.VIEW_PRICE_HISTORY="VIEW_PRICE_HISTORY",e.HIDE_PRICE_HISTORY="HIDE_PRICE_HISTORY",e.NAVIGATE_TO_DEAL_OFFER="NAVIGATE_TO_DEAL_OFFER",e.NAVIGATE_TO_PROFESSIONAL_REVIEW="NAVIGATE_TO_PROFESSIONAL_REVIEW",e.NAVIGATE_TO_VIDEO_REVIEW="NAVIGATE_TO_VIDEO_REVIEW",e.TRY_ALL_COUPON_WITH_EXPRESS_CHECKOUT="TRY_ALL_COUPON_WITH_EXPRESS_CHECKOUT",e.TRY_ALL_COUPON_WITH_EXPRESS_CHECKOUT_FORZIP="TRY_ALL_COUPON_WITH_EXPRESS_CHECKOUT_FORZIP",e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.EXPRESS_CHECKOUT_FORZIP="EXPRESS_CHECKOUT_FORZIP",e.EXPRESS_CHECKOUT_WITHOUT_PAYMENT="EXPRESS_CHECKOUT_WITHOUT_PAYMENT",e.NAVIGATE_TO_RECOMMENDATION_OFFER="NAVIGATE_TO_RECOMMENDATION_OFFER",e.CLIP_COUPON="CLIP_COUPON",e.ACTIVATE_CASHBACK_NEW="ACTIVATE_CASHBACK_NEW",e.NAVIGATE_TO_OTHER_SELLER="NAVIGATE_TO_OTHER_SELLER",e.ADD_TO_CART_FROM_OTHER_SELLER="ADD_TO_CART_FROM_OTHER_SELLER",e.ITEMIZED_CASHBACK_ADD_TO_CART="ITEMIZED_CASHBACK_ADD_TO_CART",e.PRODUCT_HISTORY_NAVIGATION="PRODUCT_HISTORY_NAVIGATION",e.PRODUCT_HISTORY_EXPAND_SECTION="PRODUCT_HISTORY_EXPAND_SECTION",e.PRODUCT_HISTORY_COLLAPSE_SECTION="PRODUCT_HISTORY_COLLAPSE_SECTION",e.TIPS_CLICK="TIPS_CLICK",e.OPEN_PANE_FROM_FLYOUT="OPEN_PANE_FROM_FLYOUT",e.WALLET_HUB_NAVIGATION="WALLET_HUB_NAVIGATION",e.PAYMENT_OPTIONS_EXPAND_SECTION="PAYMENT_OPTIONS_EXPAND_SECTION",e.PAYMENT_OPTIONS_COLLAPSE_SECTION="PAYMENT_OPTIONS_COLLAPSE_SECTION",e.EXPRESS_CHECKOUT_ZIP_OPTION_SELECTED="EXPRESS_CHECKOUT_ZIP_OPTION_SELECTED",e.EXPRESS_CHECKOUT_SHOWN_IN_ZIP_FEATURE="EXPRESS_CHECKOUT_SHOWN_IN_ZIP_FEATURE",e.EXPRESS_CHECKOUT_ZIP_OPTION_SHOWN="EXPRESS_CHECKOUT_ZIP_OPTION_SHOWN",e.CONTINUE_TO_ZIP_CLICKED="CONTINUE_TO_ZIP_CLICKED",e.DELETE_TRACKER="DELETE_TRACKER",e.CASHBACK_RETAILER_CLICK="CASHBACK_RETAILER_CLICK",e.ACTIVATE_CASHBACK_RETURNED="ACTIVATE_CASHBACK_RETURNED",e.PRINT_COUPONS_CLICK="PRINT_COUPONS_CLICK",e.SELECT_PRINTABLE_COUPON="SELECT_PRINTABLE_COUPON",e.CLICK_SEEALL_PRINTABLE_COUPON="CLICK_SEEALL_PRINTABLE_COUPON",e.DIGITAL_GROCERY_COUPONS_CLICK="DIGITAL_GROCERY_COUPONS_CLICK",e.DIGITAL_GROCERY_COUPONS_SEEALL="DIGITAL_GROCERY_COUPONS_SEEALL",e.PACKAGE_TRACKING_OPT_IN="PACKAGE_TRACKING_TRACK_ORDER_OPT_IN",e.PACKAGE_TRACKING_OPT_OUT="PACKAGE_TRACKING_TRACK_ORDER_DO_NOT_TRACK",e.PACKAGE_TRACKING_EXPAND_SECTION="PACKAGE_TRACKING_EXPAND_SECTION",e.PACKAGE_TRACKING_SEE_MORE="PACKAGE_TRACKING_SEE_MORE",e.PACKAGE_TRACKING_COLLAPSE_SECTION="PACKAGE_TRACKING_COLLAPSE_SECTION",e.PACKAGE_TRACKING_CARD_CLICKED="PACKAGE_TRACKING_CARD_CLICKED",e.ACTIVATE_REWARDS_NEW="ACTIVATE_REWARDS_NEW",e.REWARDS_SIGNIN_CLICK="REWARDS_SIGNIN_CLICK",e.REWARDS_REDEEM_CLICK="REWARDS_REDEEM_CLICK",e.SUSTAINABILITYSHOP_CLICK="SUSTAINABILITYSHOP_CLICK",e.PWILO_NOTIFICATION_PRICE_DROP="PWILO_NOTIFICATION_PRICE_DROP",e.PWILO_NOTIFICATION_PRICE_DROP_DELETE="PWILO_NOTIFICATION_PRICE_DROP_DELETE",e.PWILO_NOTIFICATION_PRICE_DROP_DISABLE_REMINDERS="PWILO_NOTIFICATION_PRICE_DROP_DISABLE_REMINDERS",e.EXPRESS_CHECKOUT_ZIP_LEARN_MORE_LINK_CLICKED="EXPRESS_CHECKOUT_ZIP_LEARN_MORE_LINK_CLICKED",e.EXPRESS_CHECKOUT_ZIP_PREFERENCE_LINK_CLICKED="EXPRESS_CHECKOUT_ZIP_PREFERENCE_LINK_CLICKED",e.SUSTAINABILITY_LANDING_FULL_LEARN_MORE="SUSTAINABILITY_LANDING_FULL_LEARN_MORE",e.SUSTAINABILITY_LANDING_FOOTER_LEARN_MORE="SUSTAINABILITY_LANDING_FOOTER_LEARN_MORE",e.SUSTAINABILITY_PURCHASE_CONFIRMATION_LEARN_MORE="SUSTAINABILITY_PURCHASE_CONFIRMATION_LEARN_MORE",e.CLICK_PCB_CROSS_SESSION="CLICK_PCB_CROSS_SESSION",e.REWARD_JOIN_NOW="REWARD_JOIN_NOW",e.REWARD_MAYBE_LATER="REWARD_MAYBE_LATER",e.REWARD_DISMISS="REWARD_DISMISS",e.REWARD_LINK_CLICK="REWARD_LINK_CLICK",e.ATTAINABLE_COUPON_CONTINUE="ATTAINABLE_COUPON_CONTINUE",e.ATTAINABLE_COUPON_CLICK="ATTAINABLE_COUPON_CLICK",e.ACTIVATE_CLICK_ITEMIZED_CASHBACK="ACTIVATE_CLICK_ITEMIZED_CASHBACK",e.ACTIVATED_CLICK_ITEMIZED_CASHBACK="ACTIVATED_CLICK_ITEMIZED_CASHBACK",e.CLICK_ITEMIZED_CASHBACK_SEE_ALL="CLICK_ITEMIZED_CASHBACK_SEE_ALL",e.HOVER_INFO_ICON_ITEMIZED_CASHBACK="HOVER_INFO_ICON_ITEMIZED_CASHBACK",e.CLICK_DISCLAIMER_ITEMIZED_CASHBACK="CLICK_DISCLAIMER_ITEMIZED_CASHBACK",e.PERSONALIZED_CASHBACK_SEEMORE="PERSONALIZED_CASHBACK_SEEMORE",e.FEED_MOMENT_IN_TIME="FEED_MOMENT_IN_TIME",e.FEED_TRENDING_OFFERS="FEED_TRENDING_OFFERS",e.FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB="FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB",e.FEED_TRENDING_OFFERS_SHOW_MORE="FEED_TRENDING_OFFERS_SHOW_MORE",e.FEED_SIMILAR_OFFERS="FEED_SIMILAR_OFFERS",e.FEED_SIMILAR_OFFERS_SHOW_MORE="FEED_SIMILAR_OFFERS_SHOW_MORE",e.FEED_SEARCH_RESULTS="FEED_SEARCH_RESULTS",e.FEED_SEARCH_RESULTS_SHOW_MORE="FEED_SEARCH_RESULTS_SHOW_MORE",e.FEED_NATIVE_ADS="FEED_NATIVE_ADS",e.FEED_NATIVE_ADS_SHOW_MORE="FEED_NATIVE_ADS_SHOW_MORE",e.FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB_SHOW_MORE="FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB_SHOW_MORE",e.FEED_DAILY_DEALS="FEED_DAILY_DEALS",e.FEED_DAILY_DEALS_SHOW_MORE="FEED_DAILY_DEALS_SHOW_MORE",e.FEED_BUY_DIRECT="FEED_BUY_DIRECT",e.FEED_BUY_DIRECT_SHOW_MORE="FEED_BUY_DIRECT_SHOW_MORE",e.FEED_INFINITE_CATEGORY="FEED_INFINITE_CATEGORY",e.FEED_INFINITE_CATEGORY_AD="FEED_INFINITE_CATEGORY_AD",e.FEED_INFINITE_CATEGORY_SHOW_MORE="FEED_INFINITE_CATEGORY_SHOW_MORE",e.FEED_INFINITE_CATEGORY_AD_SHOW_MORE="FEED_INFINITE_CATEGORY_AD_SHOW_MORE",e.FEED_VISUAL_SEARCH="FEED_VISUAL_SEARCH",e.FEED_VISUAL_SEARCH_SHOW_MORE="FEED_VISUAL_SEARCH_SHOW_MORE",e.FEED_RELATED_PRODUCTS="FEED_RELATED_PRODUCTS",e.FEED_RELATED_PRODUCTS_SHOW_MORE="FEED_RELATED_PRODUCTS_SHOW_MORE",e.SWITCH_TO_TAB1="SWITCH_TO_TAB1",e.SWITCH_TO_TAB2="SWITCH_TO_TAB2",e.SWITCH_TO_TAB3="SWITCH_TO_TAB3",e.SCROLL_TO_TAB1="SCROLL_TO_TAB1",e.SCROLL_TO_TAB2="SCROLL_TO_TAB2",e.SCROLL_TO_TAB3="SCROLL_TO_TAB3",e.AUTOS_MARKETPLACE_TITLE_CLICK="AUTOS_MARKETPLACE_TITLE_CLICK",e.AUTOS_MARKETPLACE_LISTING_HOVER="AUTOS_MARKETPLACE_LISTING_HOVER",e.AUTOS_MARKETPLACE_RECOMMENDATION_CLICK="AUTOS_MARKETPLACE_RECOMMENDATION_CLICK",e.AUTOS_MARKETPLACE_SEE_MORE_CLICK="AUTOS_MARKETPLACE_SEE_MORE_CLICK",e.AUTOS_MARKETPLACE_MYGARAGE_CHECK_NOW="AUTOS_MARKETPLACE_MYGARAGE_CHECK_NOW",e.AUTOS_PRICE_INSIGHT_HOVER="AUTOS_PRICE_INSIGHT_HOVER",e.AUTOS_PRICE_INSIGHT_SEE_MORE_CLICK="AUTOS_PRICE_INSIGHT_SEE_MORE_CLICK",e.AUTOS_PRICE_INSIGHT_RATINGURL_CLICK="AUTOS_PRICE_INSIGHT_RATINGURL_CLICK",e.AUTOS_REVIEWS_VIDEO_CLICK="AUTOS_REVIEWS_VIDEO_CLICK",e.AUTOS_REVIEWS_VIDEO_SEE_MORE_CLICK="AUTOS_REVIEWS_VIDEO_SEE_MORE_CLICK",e.AUTOS_MYGARAGE_TITLE_CLICK="AUTOS_MYGARAGE_TITLE_CLICK",e.AUTOS_MYGARAGE_HOVER="AUTOS_MYGARAGE_HOVER",e.AUTOS_MYGARAGE_MODULE_CLICK="AUTOS_MYGARAGE_MODULE_CLICK",e.GO_TO_ABANDONED_CART="GO_TO_ABANDONED_CART",e.GO_TO_WIN_CART="GO_TO_WIN_CART",e.SEE_ALL_TRENDING_DEALS="SEE_ALL_TRENDING_DEALS",e.NAVIGATE_TO_TRENDING_DEAL="NAVIGATE_TO_TRENDING_DEAL",e.GROCERY_CASHBACK_SINGIN_CLICKED="GROCERY_CASHBACK_SINGIN_CLICKED",e.MS_CASHBACK_ACCOUNT_CLICKED="MS_CASHBACK_ACCOUNT_CLICKED",e.CLICK_DISCLAIMER_PENDING_CASHBACK="CLICK_DISCLAIMER_PENDING_CASHBACK",e.CLICK_DISCLAIMER_CLAIMMED_PENDING_CASHBACK="CLICK_DISCLAIMER_CLAIMMED_PENDING_CASHBACK",e.HOVER_INFO_ICON_PENDING_CASHBACK="HOVER_INFO_ICON_PENDING_CASHBACK",e.HOVER_INFO_ICON_CLAIMMED_PENDING_CASHBACK="HOVER_INFO_ICON_CLAIMMED_PENDING_CASHBACK",e.SUBMIT_COUPON="SUBMIT_COUPON",e.AWARENESS_SEE_MORE="AWARENESS_SEE_MORE",e.CLICK_SPB_CASHBACK_SEE_MORE="CLICK_SPB_CASHBACK_SEE_MORE",e.ACTIVATE_CLICK_SPB_CASHBACK="ACTIVATE_CLICK_SPB_CASHBACK",e.ACTIVATED_CLICK_SPB_CASHBACK="ACTIVATED_CLICK_SPB_CASHBACK",e.HOVER_INFO_ICON_SPB_CASHBACK="HOVER_INFO_ICON_SPB_CASHBACK",e.CLICK_DISCLAIMER_SPB_CASHBACK="CLICK_DISCLAIMER_SPB_CASHBACK",e.INPUT_COUPON="INPUT_COUPON",e.CLICK_BEST_COUPON="CLICK_BEST_COUPON",e.SEE_MORE_TRENDING_COUPONS="SEE_MORE_TRENDING_COUPONS",e.PRODUCT_TRACKED_STOCK="PRODUCT_TRACKED_STOCK",e.PRODUCT_TRACKED_PRICE="PRODUCT_TRACKED_PRICE",e.PRODUCT_TRACKED_STOCK_SETTINGS="PRODUCT_TRACKED_STOCK_SETTINGS",e.PRODUCT_TRACKED_PRICE_SETTINGS="PRODUCT_TRACKED_PRICE_SETTINGS",e.PRODUCT_TRACKING_PRODUCT_NOTIFICATION_CLICK="PRODUCT_TRACKING_PRODUCT_NOTIFICATION_CLICK",e.PRODUCT_TRACKING_PRODUCT_COLLECTIONS_CLICK="PRODUCT_TRACKING_PRODUCT_COLLECTIONS_CLICK",e.PRODUCT_TRACKING_PRODUCT_NOTIFICATION_UNTRACK_CLICK="PRODUCT_TRACKING_PRODUCT_NOTIFICATION_UNTRACK_CLICK",e.PRODUCT_TRACKING_PRODUCT_COLLECTIONS_UNTRACK_CLICK="PRODUCT_TRACKING_PRODUCT_COLLECTIONS_UNTRACK_CLICK",e.PRODUCT_TRACKING_NOTIFICATION_TRACK="PRODUCT_TRACKING_NOTIFICATION_TRACK",e.PRODUCT_TRACKING_NOTIFICATION_UNTRACK="PRODUCT_TRACKING_NOTIFICATION_UNTRACK",e.PRODUCT_TRACKING_COLLECTIONS_RECENT_SEE_MORE_CLICK="PRODUCT_TRACKING_COLLECTIONS_RECENT_SEE_MORE_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_TRACKED_PRODUCT_SEE_MORE_CLICK="PRODUCT_TRACKING_COLLECTIONS_TRACKED_PRODUCT_SEE_MORE_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_TAB_SWITCH_1="PRODUCT_TRACKING_COLLECTIONS_TAB_SWITCH_1",e.PRODUCT_TRACKING_COLLECTIONS_TAB_SWITCH_2="PRODUCT_TRACKING_COLLECTIONS_TAB_SWITCH_2",e.PRODUCT_TRACKING_COLLECTIONS_TAB_SWITCH_3="PRODUCT_TRACKING_COLLECTIONS_TAB_SWITCH_3",e.PRODUCT_TRACKED_STOCK_UNTRACK="PRODUCT_TRACKED_STOCK_UNTRACK",e.PRODUCT_TRACKED_PRICE_UNTRACK="PRODUCT_TRACKED_PRICE_UNTRACK",e.PRODUCT_TRACKING_COLLECTIONS_TRACK_CLICK="PRODUCT_TRACKING_COLLECTIONS_TRACK_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_VIEW_STEPS="PRODUCT_TRACKING_COLLECTIONS_VIEW_STEPS",e.PRODUCT_TRACKING_COLLECTIONS_START_TRACKING="PRODUCT_TRACKING_COLLECTIONS_START_TRACKING",e.PRODUCT_TRACKED_VIEW_TRACKED_PRODUCTS="PRODUCT_TRACKED_VIEW_TRACKED_PRODUCTS",e.PRODUCT_TRACKING_ABANDONED_CART_TRACK_CLICK="PRODUCT_TRACKING_ABANDONED_CART_TRACK_CLICK",e.PRODUCT_TRACKING_ABANDONED_CART_UNTRACK_CLICK="PRODUCT_TRACKING_ABANDONED_CART_UNTRACK_CLICK",e.INBOX_COUPONS_SIGN_IN_EDGE="INBOX_COUPONS_SIGN_IN_EDGE",e.INBOX_COUPONS_CONNECT_OUTLOOK_INBOX="INBOX_COUPONS_CONNECT_OUTLOOK_INBOX",e.INBOX_COUPONS_CONNECT_GMAIL_INBOX="INBOX_COUPONS_CONNECT_GMAIL_INBOX",e.INBOX_COUPONS_RECONNECT_INBOX="INBOX_COUPONS_RECONNECT_INBOX",e.INBOX_COUPONS_COPY_COUPON="INBOX_COUPONS_COPY_COUPON",e.INBOX_COUPONS_DISCONNECT_INBOX="INBOX_COUPONS_DISCONNECT_INBOX",e.PINTEREST_COUPON_COPIED="PINTEREST_COUPON_COPIED",e.PINTEREST_CASHBACK_ACTIVATED="PINTEREST_CASHBACK_ACTIVATED",e.PINTEREST_VIEW_PRICE_HISTORY="PINTEREST_VIEW_PRICE_HISTORY",e.ATTAINABLE_COUPON_VIEWED="ATTAINABLE_COUPON_VIEWED",e.MORE_MENU_OPENED="MORE_MENU_OPENED",e.FEEDBACK_THUMBS_UP="FEEDBACK_THUMBS_UP",e.FEEDBACK_THUMBS_DOWN="FEEDBACK_THUMBS_DOWN",e.AUTOS_MARKETPLACE_RATING_REVIEW_HOVER="AUTOS_MARKETPLACE_RATING_REVIEW_HOVER",e.FETCH_SEARCH_RESULTS="FETCH_SEARCH_RESULTS",e.SEARCH_BOX_FOCUSED="SEARCH_BOX_FOCUSED",e.PRICE_COMPARISON_COMPONENT_CLICK="PRICE_COMPARISON_COMPONENT_CLICK",e.CJK_OPEN_FLYOUT="CJK_OPEN_FLYOUT",e.CJK_OPEN_PANE_FROM_FLYOUT="CJK_OPEN_PANE_FROM_FLYOUT",e.CJK_OPEN_PANE_FROM_SIDEBAR="CJK_OPEN_PANE_FROM_SIDEBAR",e.CJK_SCROLL_PAGE="CJK_SCROLL_PAGE",e.CJK_SWITCH_TO_TAB1="CJK_SWITCH_TO_TAB1",e.CJK_SWITCH_TO_TAB2="CJK_SWITCH_TO_TAB2",e.CJK_COUPONS_CLICK="CJK_COUPONS_CLICK",e.CJK_COUPONS_SEE_MORE="CJK_COUPONS_SEE_MORE",e.CJK_COUPONS_CHECK_COUPON="CJK_COUPONS_CHECK_COUPON",e.CJK_VIEW_PRICE_HISTORY="CJK_VIEW_PRICE_HISTORY",e.CJK_PRICE_HISTORY_SET_TIMERANGE="CJK_PRICE_HISTORY_SET_TIMERANGE",e.CJK_PRICE_COMPARISON_CLICK="CJK_PRICE_COMPARISON_CLICK",e.CJK_CLICK_PRICE_COMPARISON_SEE_MORE="CJK_CLICK_PRICE_COMPARISON_SEE_MORE",e.CJK_SIMILAR_PRODUCTS_CLICK="CJK_SIMILAR_PRODUCTS_CLICK",e.CJK_ACTIVITY_CLICK="CJK_ACTIVITY_CLICK",e.CJK_ACTIVITY_SEE_MORE="CJK_ACTIVITY_SEE_MORE",e.CJK_TRENDING_PRODUCTS_CLICK="CJK_TRENDING_PRODUCTS_CLICK",e.CJK_TRENDING_PRODUCTS_SET_CATEGORY="CJK_TRENDING_PRODUCTS_SET_CATEGORY",e.CJK_TRENDING_PRODUCTS_SET_RETAILER="CJK_TRENDING_PRODUCTS_SET_RETAILER",e.FEED_CAMPAIGN_SHOW_MORE="FEED_CAMPAIGN_SHOW_MORE",e.TRY_PRODUCT_BEST_COUPON="TRY_PRODUCT_BEST_COUPON",e.AX_SHOPPING_NAV_TRY_NOW_CLICK="AX_SHOPPING_NAV_TRY_NOW_CLICK",e.PRICE_MATCH_OPT_IN="PRICE_MATCH_OPT_IN",e.PRICE_MATCH_OPT_OUT="PRICE_MATCH_OPT_OUT",e.PRICE_MATCH_CARD_CLICK="PRICE_MATCH_CARD_CLICK",e.PRICE_MATCH_CARD_CTA_CLICK="PRICE_MATCH_CARD_CTA_CLICK",e.PRICE_MATCH_NOTIFICATION_CTA_CLICK="PRICE_MATCH_NOTIFICATION_CTA_CLICK",e.DISCOVER_NOTIFICATION_CLICK="DISCOVER_NOTIFICATION_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_SIGN_IN="PRODUCT_TRACKING_COLLECTIONS_SIGN_IN",e.PRODUCT_TRACKING_COLLECTIONS_SIGN_IN_CLOSE="PRODUCT_TRACKING_COLLECTIONS_SIGN_IN_CLOSE",e.PRODUCT_TRACKING_COLLECTIONS_ROAM="PRODUCT_TRACKING_COLLECTIONS_ROAM",e.PRODUCT_TRACKING_COLLECTIONS_ROAM_CLOSE="PRODUCT_TRACKING_COLLECTIONS_ROAM_CLOSE",e.PRODUCT_TRACKING_SUMMARY_CARD="PRODUCT_TRACKING_SUMMARY_CARD",e.TRY_BGAA_BEST_COUPON="TRY_BGAA_BEST_COUPON",e.TRAVEL_CHEAPER_FLIGHTS_CLICK="TRAVEL_CHEAPER_FLIGHTS_CLICK",e.TRAVEL_CHEAPER_HOTEL_CLICK="TRAVEL_CHEAPER_HOTEL_CLICK ",e.BUYING_OPTIONS_FILTERCHANGE="BUYING_OPTIONS_FILTERCHANGE",e.BUYING_OPTIONS_RETAILER_HOVER="BUYING_OPTIONS_RETAILER_HOVER",e}({})},2388:function(e,t,o){o.d(t,{r:function(){return i}});let i=function(e){return e.COUPONS_AVAILABLE="COUPONS_AVAILABLE",e.COUPONS_AUTO_APPLY="COUPONS_AUTO_APPLY",e.COUPONS_CLIPPING="COUPONS_CLIPPING",e.SIMILAR_OFFERS="SIMILAR_OFFERS",e.PRICE_COMPARE_LOWER_PRICES="PRICE_COMPARE_LOWER_PRICES",e.PRICE_COMPARE_BEST_PRICE="PRICE_COMPARE_BEST_PRICE",e.REBATES_ACTIVATE_CASHBACK="REBATES_ACTIVATE_CASHBACK",e.REBATES_BING_CONFIRMATION="REBATES_BING_CONFIRMATION",e.PRICE_HISTORY_DROP="PRICE_HISTORY_DROP",e.PRICE_DROP_PLUS_COUPONS="PRICE_DROP_PLUS_COUPONS",e.PRICE_DROP_PLUS_CASHBACK="PRICE_DROP_PLUS_CASHBACK",e.CASHBACK_PLUS_COUPONS="CASHBACK_PLUS_COUPONS",e.LOWER_PRICE_PLUS_CASHBACK_PLUS_COUPONS="LOWER_PRICE_PLUS_CASHBACK_PLUS_COUPONS",e.PRICE_HISTORY_STABLE="PRICE_HISTORY_STABLE",e.PRICE_HISTORY_INCREASE="PRICE_HISTORY_INCREASE",e.PRICE_HISTORY_NO_INSIGHT="PRICE_HISTORY_NO_INSIGHT",e.DEALS="DEALS",e.PROFESSIONAL_REVIEWS="PROFESSIONAL_REVIEWS",e.VIDEO_REVIEWS="VIDEO_REVIEWS",e.RECOMMENDATIONS="RECOMMENDATIONS",e.ACTIVATE_CASHBACK_NEW="ACTIVATE_CASHBACK_NEW",e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.ACTIVATE_REWARDS_NEW="ACTIVATE_REWARDS_NEW",e.OTHER_SELLER="OTHER_SELLER",e.PRODUCT_HISTORY="PRODUCT_HISTORY",e.PAYMENT_OPTIONS="PAYMENT_OPTIONS",e.TIPS="TIPS",e.PACKAGE_TRACKING_OPT_IN="PACKAGE_TRACKING_OPT_IN",e.PACKAGE_TRACKING_STATUS_VIEW="PACKAGE_TRACKING_STATUS_VIEW",e.PINTEREST_COUPONS_AVAILABLE="PINTEREST_COUPONS_AVAILABLE",e.PINTEREST_PRICE_HISTORY_DROP="PINTEREST_PRICE_HISTORY_DROP",e.PINTEREST_PRICE_HISTORY_INCREASE="PINTEREST_PRICE_HISTORY_INCREASE",e.PINTEREST_PRICE_HISTORY_STABLE="PINTEREST_PRICE_HISTORY_STABLE",e.PINTEREST_REBATES_ACTIVATE_CASHBACK="PINTEREST_REBATES_ACTIVATE_CASHBACK",e.CASHBACK_RETAILER="CASHBACK_RETAILER",e.GROCERY_PRINT_COUPONS="GROCERY_PRINT_COUPONS",e.GROCERY_DIGITAL_COUPONS="GROCERY_DIGITAL_COUPONS",e.PWILO_NOTIFICATION_PRICE_DROP="PWILO_NOTIFICATION_PRICE_DROP",e.SUSTAINABILITY_LANDING_FULL="SUSTAINABILITY_LANDING_FULL",e.SUSTAINABILITY_LANDING_FOOTER="SUSTAINABILITY_LANDING_FOOTER",e.SUSTAINABILITY_PURCHASE_CONFIRMATION="SUSTAINABILITY_PURCHASE_CONFIRMATION",e.ATTAINABLE_COUPONS="ATTAINABLE_COUPONS",e.COUPON_ATTAINED="COUPON_ATTAINED",e.ATTAINABLE_COUPONS_OVERLAY="ATTAINABLE_COUPONS_OVERLAY",e.ITEMIZED_CASHBACK="ITEMIZED_CASHBACK",e.FEED_TRENDING_OFFERS="FEED_TRENDING_OFFERS",e.FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB="FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB",e.FEED_DAILY_DEALS="FEED_DAILY_DEALS",e.FEED_INFINITE_CATEGORY="FEED_INFINITE_CATEGORY",e.FEED_MOMENT_IN_TIME="FEED_MOMENT_IN_TIME",e.AUTOS_MARKETPLACE="AUTOS_MARKETPLACE",e.AUTOS_PRICE_INSIGHT="AUTOS_PRICE_INSIGHT",e.AUTOS_INCENTIVES="AUTOS_INCENTIVES",e.ABANDONED_CART="ABANDONED_CART",e.AWARENESS="AWARENESS",e.PRODUCT_TRACKING_STOCK="PRODUCT_TRACKING_STOCK",e.PRODUCT_TRACKING_PRICE="PRODUCT_TRACKING_PRICE",e.PRODUCT_TRACKING_NOTIFICATION="PRODUCT_TRACKING_NOTIFICATION",e.PRODUCT_TRACKING_COLLECTIONS="PRODUCT_TRACKING_COLLECTIONS",e.SHOPPING_TRIPS="SHOPPING_TRIPS",e.VIEW_BEST_COUPON_MODULE="VIEW_BEST_COUPON_MODULE",e.INBOX_COUPONS="INBOX_COUPONS",e.ACTIVE_RETAILER_INBOX_COUPONS="ACTIVE_RETAILER_INBOX_COUPONS",e.PRODUCT_TRACKING_OUT_OF_STOCK_NOTIFICATION="PRODUCT_TRACKING_OUT_OF_STOCK_NOTIFICATION",e.PRODUCT_TRACKING_OFFERS_COUPON_NOTIFICATION="PRODUCT_TRACKING_OFFERS_COUPON_NOTIFICATION",e.PRODUCT_TRACKING_BACK_IN_STOCK_NOTIFICATION="PRODUCT_TRACKING_BACK_IN_STOCK_NOTIFICATION",e.PRODUCT_BEST_COUPON="PRODUCT_BEST_COUPON",e.PRODUCT_TRACKING_ALERT="PRODUCT_TRACKING_ALERT",e.ABANDONED_CART_NOTIFICATION_COUPONS="ABANDONED_CART_NOTIFICATION_COUPONS",e.REWARD_GIFT_CARD="REWARD_GIFT_CARD",e.YOUTUBE_COUPONS_RETAILER="YOUTUBE_COUPONS_RETAILER",e.YOUTUBE_COUPONS_RETAILER_CHECKOUT="YOUTUBE_COUPONS_RETAILER_CHECKOUT",e.YOUTUBE_COUPONS_HOME="YOUTUBE_COUPONS_HOME",e.YOUTUBE_COUPONS_VIDEO="YOUTUBE_COUPONS_VIDEO",e.SAN_CONSENT_NOTIFICATION="SAN_CONSENT_NOTIFICATION",e.FEED_BUY_DIRECT="FEED_BUY_DIRECT",e.CODEX_CHAT="CODEX_CHAT",e.AX_SHOPPING_NAV="AX_SHOPPING_NAV",e.INSTANT_ADD_TO_CART_OVERLAY="INSTANT_ADD_TO_CART_OVERLAY",e.SEARCH_RESULTS="SEARCH_RESULTS",e.FEED_VISUAL_SEARCH="FEED_VISUAL_SEARCH",e.FEED_RELATED_PRODUCTS="FEED_RELATED_PRODUCTS",e.FEED_NATIVE_ADS="FEED_NATIVE_ADS",e.DISCOVER_SHOPPING="DISCOVER_SHOPPING",e.DISCOVER_CHAT_CHIPS="DISCOVER_CHAT_CHIPS",e.SHOPPING_CHIPS="SHOPPING_CHIPS",e.SMART_COMPARE="SMART_COMPARE",e.PRODUCT_SUMMARY="PRODUCT_SUMMARY",e.PRODUCT_SUMMARY_CARD="PRODUCT_SUMMARY_CARD",e.BUYING_GUIDES="BUYING_GUIDES",e.USER_INSIGHTS="USER_INSIGHTS",e.EXPERT_INSIGHTS="EXPERT_INSIGHTS",e.WIN_CART="WIN_CART",e.DISCOVER_CHAT="DISCOVER_CHAT",e.SAFARI_FIRST_RUN_EXPERIENCE="SAFARI_FIRST_RUN_EXPERIENCE",e.SIDEPANE_CASHBACK="SIDEPANE_CASHBACK",e.CAMPAIGN_PDP_CASHBACK="CAMPAIGN_PDP_CASHBACK",e.CAMPAIGN_BANNER="CAMPAIGN_BANNER",e.FEED_CAMPAIGN="FEED_CAMPAIGN ",e.CAMPAIGN_PDP_CASHBACK_NOTIFICATION="CAMPAIGN_PDP_CASHBACK_NOTIFICATION",e.CAMPAIGN_AWARENESS_NOTIFICATION="CAMPAIGN_AWARENESS_NOTIFICATION",e.CJK_SIMILAR_PRODUCTS="CJK_SIMILAR_PRODUCTS",e.WISHLIST="WISHLIST ",e.MENU="MENU",e.FOOTER="FOOTER",e.EDGE_OVERLAY="OVERLAY",e.EXTENSION_POPUP="EXTENSION_POPUP",e.EXTENSION_AUTOAPPLY="EXTENSION_AUTOAPPLY",e.BELL_ICON="BELL_ICON",e.BANNER="BANNER",e.SEARCH_IN_PANE="SEARCH_IN_PANE",e.ENROLL_TO_CASHBACK_CONFIRMATION_NOTIFICATION="ENROLL_TO_CASHBACK_CONFIRMATION_NOTIFICATION",e.POST_PURCHASE_CONSENT_NOTIFICATION="POST_PURCHASE_CONSENT_NOTIFICATION",e.SEARCHBOXDEMO_NOTIFICATION="SEARCHBOXDEMO_NOTIFICATION",e.PRICE_MATCH_PRICE_DROP_NOTIFICATION="PRICE_MATCH_PRICE_DROP_NOTIFICATION",e.INBOX_PRICE_MATCH_PRICE_DROP_NOTIFICATION="INBOX_PRICE_MATCH_PRICE_DROP_NOTIFICATION",e.TRAVEL_CHEAPER_FLIGHT_NOTIFICATION="TRAVEL_CHEAPER_FLIGHT_NOTIFICATION",e.DISCOVER_NOTIFICATION="DISCOVER_NOTIFICATION",e.AX_SHOPPING_NAV_NOTIFICATION="AX_SHOPPING_NAV_NOTIFICATION",e.ARTICLES_CASHBACK="ARTICLES_CASHBACK",e.BACKGROUND_AUTO_APPLY="BACKGROUND_AUTO_APPLY",e.TRAVEL_CHEAPER_HOTEL_NOTIFICATION="TRAVEL_CHEAPER_HOTEL_NOTIFICATION",e.POST_PURCHASE_REWARDS_NOTIFICATION="POST_PURCHASE_REWARDS_NOTIFICATION",e.CASHBACK_DASHBOARD="CASHBACK_DASHBOARD",e.BUYING_OPTIONS="BUYING_OPTIONS",e}({})},84901:function(e,t,o){o.d(t,{FV:function(){return i}});let i=function(e){return e.VIEW_PRODUCT_SUMMARY_CARD="VIEW_PRODUCT_SUMMARY_CARD",e.PRODUCT_SUMMARY_CARD_SAVE_WL="PRODUCT_SUMMARY_CARD_SAVE_WL",e.PRODUCT_SUMMARY_CARD_UNSAVE_WL="PRODUCT_SUMMARY_CARD_UNSAVE_WL",e.COUPONS_COPIED="COUPONS_COPIED",e.NAVIGATE_TO_RETAILER="NAVIGATE_TO_RETAILER",e.TRY_ALL_COUPONS="TRY_ALL_COUPONS",e.SHOW_MORE_SELLERS="SHOW_MORE_SELLERS",e.REBATES_LEARN_MORE="REBATES_LEARN_MORE",e.REBATES_VIEW_IN_PANE="REBATES_VIEW_IN_PANE",e.REBATES_ACCOUNT="REBATES_ACCOUNT",e.REBATES_HISTORY="REBATES_HISTORY",e.ACTIVATE_CASHBACK="ACTIVATE_CASHBACK",e.EXPAND_GRAPH="EXPAND_GRAPH",e.VIEW_PRICE_HISTORY="VIEW_PRICE_HISTORY",e.COUPONS_COPIED_AUTOFILL="COUPONS_COPIED_AUTOFILL",e.TRY_ALL_COUPONS_AUTOFILL="TRY_ALL_COUPONS_AUTOFILL",e.NAVIGATE_TO_DEAL_OFFER="NAVIGATE_TO_DEAL_OFFER",e.NAVIGATE_TO_PROFESSIONAL_REVIEW="NAVIGATE_TO_PROFESSIONAL_REVIEW",e.NAVIGATE_TO_VIDEO_REVIEW="NAVIGATE_TO_VIDEO_REVIEW",e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.OPEN_FLYOUT="OPEN_FLYOUT",e.OPEN_PANE_FROM_FLYOUT="OPEN_PANE_FROM_FLYOUT",e.NAVIGATE_TO_RECOMMENDATION_OFFER="NAVIGATE_TO_RECOMMENDATION_OFFER",e.CLIP_COUPON="CLIP_COUPON",e.ACTIVATE_CASHBACK_NEW="ACTIVATE_CASHBACK_NEW",e.PRODUCT_HISTORY_NAVIGATION="PRODUCT_HISTORY_NAVIGATION",e.NAVIGATE_TO_OTHER_SELLER="NAVIGATE_TO_OTHER_SELLER",e.TIPS_CLICK="TIPS_CLICK",e.REWARDS_SIGNIN_CLICK="REWARDS_SIGNIN_CLICK",e.REWARDS_REDEEM_CLICK="REWARDS_REDEEM_CLICK",e.CASHBACK_OTHERSITES_CLICK="CASHBACK_OTHERSITES_CLICK",e.ZIP_CHECKOUT="ZIP_CHECKOUT",e.PWILO_NOTIFICATION_PRICE_DROP="PWILO_NOTIFICATION_PRICE_DROP",e.YOUTUBE_COUPON_COPIED_HOME="YOUTUBE_COUPON_COPIED_HOME",e.YOUTUBE_COUPON_COPIED_VIDEO="YOUTUBE_COUPON_COPIED_VIDEO",e.YOUTUBE_COUPON_COPIED_RETAILER="YOUTUBE_COUPON_COPIED_RETAILER",e.YOUTUBE_COUPON_COPIED_RETAILER_CHECKOUT="YOUTUBE_COUPON_COPIED_RETAILER_CHECKOUT",e.YOUTUBE_TRY_ALL_COUPONS="YOUTUBE_TRY_ALL_COUPONS",e.CASHBACK_RETAILER_CLICK="CASHBACK_RETAILER_CLICK",e.ACTIVATE_CASHBACK_RETURNED="ACTIVATE_CASHBACK_RETURNED",e.PRINT_COUPONS_CLICK="PRINT_COUPONS_CLICK",e.SELECT_PRINTABLE_COUPON="SELECT_PRINTABLE_COUPON",e.DIGITAL_GROCERY_COUPONS_CLICK="DIGITAL_GROCERY_COUPONS_CLICK",e.PINTEREST_COUPON_COPIED="PINTEREST_COUPON_COPIED",e.PINTEREST_CASHBACK_ACTIVATED="PINTEREST_CASHBACK_ACTIVATED",e.PINTEREST_VIEW_PRICE_HISTORY="PINTEREST_VIEW_PRICE_HISTORY",e.PACKAGE_TRACKING_EXPAND_SECTION="PACKAGE_TRACKING_EXPAND_SECTION",e.PACKAGE_TRACKING_OPT_IN="PACKAGE_TRACKING_OPT_IN",e.PACKAGE_TRACKING_CARD_CLICKED="PACKAGE_TRACKING_CARD_CLICKED",e.AUTOS_MARKETPLACE_TITLE_CLICK="AUTOS_MARKETPLACE_TITLE_CLICK",e.AUTOS_MARKETPLACE_RECOMMENDATION_CLICK="AUTOS_MARKETPLACE_RECOMMENDATION_CLICK",e.AUTOS_MARKETPLACE_SEE_MORE_CLICK="AUTOS_MARKETPLACE_SEE_MORE_CLICK",e.AUTOS_MARKETPLACE_MYGARAGE_CHECK_NOW="AUTOS_MARKETPLACE_MYGARAGE_CHECK_NOW",e.AUTOS_PRICE_INSIGHT_SEE_MORE_CLICK="AUTOS_PRICE_INSIGHT_SEE_MORE_CLICK",e.AUTOS_PRICE_INSIGHT_RATINGURL_CLICK="AUTOS_PRICE_INSIGHT_RATINGURL_CLICK",e.AUTOS_REVIEWS_VIDEO_CLICK="AUTOS_REVIEWS_VIDEO_CLICK",e.AUTOS_REVIEWS_VIDEO_SEE_MORE_CLICK="AUTOS_REVIEWS_VIDEO_SEE_MORE_CLICK",e.AUTOS_MYGARAGE_TITLE_CLICK="AUTOS_MYGARAGE_TITLE_CLICK",e.AUTOS_MYGARAGE_MODULE_CLICK="AUTOS_MYGARAGE_MODULE_CLICK",e.GO_TO_ABANDONED_CART="GO_TO_ABANDONED_CART",e.GO_TO_WIN_CART="GO_TO_WIN_CART",e.INPUT_COUPON="INPUT_COUPON",e.SUBMIT_COUPON="SUBMIT_COUPON",e.AWARENESS_SEE_MORE="AWARENESS_SEE_MORE",e.PRODUCT_TRACKED_STOCK="PRODUCT_TRACKED_STOCK",e.PRODUCT_TRACKED_PRICE="PRODUCT_TRACKED_PRICE",e.PRODUCT_TRACKING_PRODUCT_NOTIFICATION_CLICK="PRODUCT_TRACKING_PRODUCT_NOTIFICATION_CLICK",e.PRODUCT_TRACKING_PRODUCT_COLLECTIONS_CLICK="PRODUCT_TRACKING_PRODUCT_COLLECTIONS_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_TRACK_CLICK="PRODUCT_TRACKING_COLLECTIONS_TRACK_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_VIEW_STEPS="PRODUCT_TRACKING_COLLECTIONS_VIEW_STEPS",e.PRODUCT_TRACKING_COLLECTIONS_START_TRACKING="PRODUCT_TRACKING_COLLECTIONS_START_TRACKING",e.PRODUCT_TRACKED_VIEW_TRACKED_PRODUCTS="PRODUCT_TRACKED_VIEW_TRACKED_PRODUCTS",e.PRODUCT_TRACKING_ABANDONED_CART_TRACK_CLICK="PRODUCT_TRACKING_ABANDONED_CART_TRACK_CLICK",e.CLICK_BEST_COUPON="CLICK_BEST_COUPON",e.SEE_MORE_TRENDING_COUPONS="SEE_MORE_TRENDING_COUPONS",e.INBOX_COUPONS_SIGN_IN_EDGE="INBOX_COUPONS_SIGN_IN_EDGE",e.INBOX_COUPONS_CONNECT_OUTLOOK_INBOX="INBOX_COUPONS_CONNECT_OUTLOOK_INBOX",e.INBOX_COUPONS_CONNECT_GMAIL_INBOX="INBOX_COUPONS_CONNECT_GMAIL_INBOX",e.INBOX_COUPONS_RECONNECT_INBOX="INBOX_COUPONS_RECONNECT_INBOX",e.INBOX_COUPONS_COPY_COUPON="INBOX_COUPONS_COPY_COUPON",e.INBOX_COUPONS_DISCONNECT_INBOX="INBOX_COUPONS_DISCONNECT_INBOX",e.NAVIGATE_TO_TRENDING_DEAL="NAVIGATE_TO_TRENDING_DEAL",e.PRODUCT_TRACKING_NOTIFICATION_TRACK="PRODUCT_TRACKING_NOTIFICATION_TRACK",e.PRODUCT_TRACKING_COLLECTIONS_RECENT_SEE_MORE_CLICK="PRODUCT_TRACKING_COLLECTIONS_RECENT_SEE_MORE_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_TRACKED_PRODUCT_SEE_MORE_CLICK="PRODUCT_TRACKING_COLLECTIONS_TRACKED_PRODUCT_SEE_MORE_CLICK",e.NOTIFICATION_MOMENT_IN_TIME="NOTIFICATION_MOMENT_IN_TIME",e.FEED_MOMENT_IN_TIME="FEED_MOMENT_IN_TIME",e.FEED_TRENDING_OFFERS="FEED_TRENDING_OFFERS",e.FEED_TRENDING_OFFERS_SHOW_MORE="FEED_TRENDING_OFFERS_SHOW_MORE",e.FEED_DAILY_DEALS="FEED_DAILY_DEALS",e.FEED_DAILY_DEALS_SHOW_MORE="FEED_DAILY_DEALS_SHOW_MORE",e.FEED_INFINITE_CATEGORY="FEED_INFINITE_CATEGORY",e.FEED_INFINITE_CATEGORY_SHOW_MORE="FEED_INFINITE_CATEGORY_SHOW_MORE",e.SWITCH_TO_TAB1="SWITCH_TO_TAB1",e.SWITCH_TO_TAB2="SWITCH_TO_TAB2",e.SWITCH_TO_TAB3="SWITCH_TO_TAB3",e.SCROLL_TO_TAB1="SCROLL_TO_TAB1",e.SCROLL_TO_TAB2="SCROLL_TO_TAB2",e.SCROLL_TO_TAB3="SCROLL_TO_TAB3",e.FEED_BUY_DIRECT="FEED_BUY_DIRECT",e.FEED_BUY_DIRECT_SHOW_MORE="FEED_BUY_DIRECT_SHOW_MORE",e.FETCH_SEARCH_RESULTS="FETCH_SEARCH_RESULTS",e.SEARCH_BOX_FOCUSED="SEARCH_BOX_FOCUSED",e.FEED_INFINITE_CATEGORY_AD="FEED_INFINITE_CATEGORY_AD",e.FEED_RELATED_PRODUCTS="FEED_RELATED_PRODUCTS",e.FEED_NATIVE_ADS="FEED_NATIVE_ADS",e.FEED_SEARCH_RESULTS="FEED_SEARCH_RESULTS",e.FEED_SIMILAR_OFFERS="FEED_SIMILAR_OFFERS",e.FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB="FEED_TRENDING_OFFERS_ON_CONTEXTUAL_TAB",e.FEED_VISUAL_SEARCH="FEED_VISUAL_SEARCH",e.CJK_OPEN_FLYOUT="CJK_OPEN_FLYOUT",e.CJK_OPEN_PANE_FROM_FLYOUT="CJK_OPEN_PANE_FROM_FLYOUT",e.CJK_OPEN_PANE_FROM_SIDEBAR="CJK_OPEN_PANE_FROM_SIDEBAR",e.CJK_SCROLL_PAGE="CJK_SCROLL_PAGE",e.CJK_SWITCH_TO_TAB1="CJK_SWITCH_TO_TAB1",e.CJK_SWITCH_TO_TAB2="CJK_SWITCH_TO_TAB2",e.CJK_COUPONS_CLICK="CJK_COUPONS_CLICK",e.CJK_COUPONS_SEE_MORE="CJK_COUPONS_SEE_MORE",e.CJK_VIEW_PRICE_HISTORY="CJK_VIEW_PRICE_HISTORY",e.CJK_PRICE_HISTORY_SET_TIMERANGE="CJK_PRICE_HISTORY_SET_TIMERANGE",e.CJK_PRICE_COMPARISON_CLICK="CJK_PRICE_COMPARISON_CLICK",e.CJK_CLICK_PRICE_COMPARISON_SEE_MORE="CJK_CLICK_PRICE_COMPARISON_SEE_MORE",e.CJK_SIMILAR_PRODUCTS_CLICK="CJK_SIMILAR_PRODUCTS_CLICK",e.CJK_ACTIVITY_CLICK="CJK_ACTIVITY_CLICK",e.CJK_ACTIVITY_SEE_MORE="CJK_ACTIVITY_SEE_MORE",e.CJK_TRENDING_PRODUCTS_CLICK="CJK_TRENDING_PRODUCTS_CLICK",e.CJK_TRENDING_PRODUCTS_SET_CATEGORY="CJK_TRENDING_PRODUCTS_SET_CATEGORY",e.CJK_TRENDING_PRODUCTS_SET_RETAILER="CJK_TRENDING_PRODUCTS_SET_RETAILER",e.CJK_COUPONS_CHECK_COUPON="CJK_COUPONS_CHECK_COUPON",e.CAMPAIGN_SHOP_NOW_BANNER_BUTTON_CLICK="CAMPAIGN_SHOP_NOW_BANNER_BUTTON_CLICK",e.FEED_CAMPAIGN="FEED_CAMPAIGN",e.CAMPAIGN_CASHBACK_BANNER="CAMPAIGN_CASHBACK_BANNER",e.AX_SHOP_INVOKED_PRODUCT_NAME="AX_SHOP_INVOKED_PRODUCT_NAME",e.AX_SHOP_INVOKED_PRODUCT_PRICE="AX_SHOP_INVOKED_PRODUCT_PRICE",e.AX_SHOP_INVOKED_PRODUCT_REVIEW_COUNT="AX_SHOP_INVOKED_PRODUCT_REVIEW_COUNT",e.AX_SHOP_INVOKED_PRODUCT_MANUFACTURER="AX_SHOP_INVOKED_PRODUCT_MANUFACTURER",e.AX_SHOP_INVOKED_PRODUCT_OUT_OF_STOCK_MESSAGE="AX_SHOP_INVOKED_PRODUCT_OUT_OF_STOCK_MESSAGE",e.AX_SHOP_INVOKED_PRODUCT_RATING="AX_SHOP_INVOKED_PRODUCT_RATING",e.AX_SHOP_INVOKED_PRODUCT_OTHER="AX_SHOP_INVOKED_PRODUCT_OTHER",e.TRY_PRODUCT_BEST_COUPON="TRY_PRODUCT_BEST_COUPON",e.VIEW_COUPONS_FROM_NOTIFICATION="VIEW_COUPONS_FROM_NOTIFICATION",e.VIEW_PRICE_COMPARISON_FROM_NOTIFICATION="VIEW_PRICE_COMPARISON_FROM_NOTIFICATION",e.CAMPAIGN_AWARENESS_BANNER_BUTTON_CLICK="CAMPAIGN_AWARENESS_BANNER_BUTTON_CLICK",e.SHOPPING_CHIPS="SHOPPING_CHIPS",e.SMART_COMPARE="SMART_COMPARE",e.BUYING_GUIDES="BUYING_GUIDES",e.WISHLIST_SAVE="WISHLIST_SAVE",e.WISHLIST_UNSAVE="WISHLIST_UNSAVE",e.WISHLIST_SEE_ALL="WISHLIST_SEE_ALL",e.PRICE_MATCH_OPT_IN="PRICE_MATCH_OPT_IN",e.PRICE_MATCH_CARD_CLICK="PRICE_MATCH_CARD_CLICK",e.PRICE_MATCH_CARD_CTA_CLICK="PRICE_MATCH_CARD_CTA_CLICK",e.PRICE_MATCH_NOTIFICATION_CTA_CLICK="PRICE_MATCH_NOTIFICATION_CTA_CLICK",e.CASHBACK_MODULE_VIEW_OFFER_DETAILS_CLICK="CASHBACK_MODULE_VIEW_OFFER_DETAILS_CLICK",e.CASHBACK_MODULE_VIEW_OFFER_DETAILS_SEELESS_CLICK="CASHBACK_MODULE_VIEW_OFFER_DETAILS_SEELESS_CLICK",e.CASHBACK_MODULE_FLYOUT_TAG_CLICK="CASHBACK_MODULE_FLYOUT_TAG_CLICK",e.PRODUCT_TRACKING_COLLECTIONS_SIGN_IN="PRODUCT_TRACKING_COLLECTIONS_SIGN_IN",e.PRODUCT_TRACKING_COLLECTIONS_ROAM="PRODUCT_TRACKING_COLLECTIONS_ROAM",e.ACTIVATE_CLICK_SPB_CASHBACK="ACTIVATE_CLICK_SPB_CASHBACK",e.TRY_BGAA_BEST_COUPON="TRY_BGAA_BEST_COUPON",e.TRAVEL_CHEAPER_FLIGHTS_CLICK="TRAVEL_CHEAPER_FLIGHTS_CLICK",e.TRAVEL_CHEAPER_HOTEL_CLICK="TRAVEL_CHEAPER_HOTEL_CLICK ",e.BUYING_OPTIONS_FILTERCHANGE="BUYING_OPTIONS_FILTERCHANGE",e.BUYING_OPTIONS_RETAILER_HOVER="BUYING_OPTIONS_RETAILER_HOVER",e}({})},86127:function(e,t,o){},33105:function(e,t,o){o.d(t,{q:function(){return i}});let i=function(e){return e.Unknown="",e.PriceCompare="PriceCompare",e.PriceHistory="PriceHistory",e.Deals="Deals",e.PreviouslyViewedSimilar="PreviouslyViewedSimilar",e.CategoryInsights="CategoryInsights",e.ProductSummary="ProductSummary",e.OfferInsights="OfferInsights",e.DynamicSuggestionChips="DynamicSuggestionChips",e}({})},15255:function(e,t,o){o.d(t,{a:function(){return i}});let i=function(e){return e.PageStatus="pageStatus",e.EnabledFeatures="enabled_features",e.CouponsApiResponse="couponsApiResponse",e.PackageTrackingFreShown="packageTrackingFreShown",e.PackageTrackingUserConsented="packageTrackingUserConsented",e.PackageTrackerResponse="packageTrackingData",e.ShouldShowPackageTrackingNotification="shouldShowPackageTrackingNotification",e.EdgeDriverDataForFlyout="edgeDriverDataForFlyout",e.GuestCouponsApiResponse="guestCouponsApiResponse",e.AutofillProfileEnabled="autofillProfileEnabled",e.AutofillCreditCardEnabled="autofillCreditCardEnabled",e.BgaaInfo="bgaa_info",e.ProductItemizedCashBack="productItemizedCashBack",e.NotificationData="notification_data",e.EnabledServiceFeatures="enabledservicefeatures",e.EnabledServiceFlights="enabledserviceflights",e.ExtractedEntity="extracted_entity",e.ShoppingDataContainer="shoppingDataContainer",e.IsDiscoverPane="isDiscoverPane",e.ShouldOpenSettingsPane="shouldOpenSettings",e.IsCJKEnabled="cjk_data",e.JourneyStage="journeyStage",e.UserInsights="userInsights",e.ExpertInsights="expertInsights",e.EnabledServiceFeaturesv2="enabledservicefeaturesv2",e}({})},64106:function(e,t,o){o(5144),o(88767)},21908:function(e,t,o){var i=o(72370),r=o(88767),a=o(73557);let n='button:enabled:not([slot="header-actions"]), textarea, input[type="text"], input[type="password"], div[role="slider"],\n      input[type="radio"]:checked, input[type="checkbox"]:enabled, a[href]:not([slot="header-actions"]):not(#infoIcon),\n      select:not([style*="display: none"]), details, a.autosMarketplaceListing, msft-shopping-link, msft-product-card,\n      fluent-button:not([slot="header-actions"]), fluent-anchor:not([class="aHeaderContent"]), msft-shopping-recommendation,\n      fluent-accordion, fluent-option, fluent-listbox, div.tipsDiv, msft-shopping-cashback-card, msft-shopping-coupon,\n      div#divHomeNotification, msft-shopping-coupon-printable, div#divYoutubeCouponsNotification, msft-micro-feedback-item,\n      msft-shopping-tooltip, #divPriceHistory svg, msft-shopping-cart:not([id="unselectable"]), rect.priceInsightBar,\n      msft-shopping-section:not([slot="header-content"]), msft-shopping-coupon-new, msft-banner-card, msft-product-feed,\n      div#packageTrackingAcknowledgementDescriptionDiv, msft-package-tracker-card-new, msft-travel-cheaper-flight-card, fluent-select\n      ';class s{constructor(){(0,i.Z)(this,"container",void 0),(0,i.Z)(this,"currentFocusElement",void 0),(0,i.Z)(this,"isEdgeDriver",!1),(0,i.Z)(this,"flyoutData",void 0),(0,i.Z)(this,"initialize",((e,t,o)=>{this.container=e,this.isEdgeDriver=t,this.flyoutData=o,this.container.addEventListener("keydown",this.trapFocus)})),(0,i.Z)(this,"removeListeners",(()=>{this.container.removeEventListener("keydown",this.trapFocus)})),(0,i.Z)(this,"trapFocus",(e=>{if("Tab"!==e.key||e.ctrlKey||!this.container)return;let t=Array.prototype.slice.call(this.container.querySelectorAll('fluent-button[slot="header-actions"], a[slot="header-actions"], button[slot="header-actions"]'));const o=Array.prototype.slice.call(this.container.querySelectorAll('#divPinterestSubTitle[slot="header-content"], fluent-anchor[slot="header-content"], fluent-button[slot="header-content"], button[slot="header-content"], div#divYoutubeCouponsNotification, msft-shopping-tooltip#header-tooltip, msft-shopping-section[slot="header-content"] msft-shopping-coupon-new, div[slot="header-content"] msft-shopping-tooltip'));t.push.apply(t,o),this.flyoutData&&this.flyoutData.common.openedWith===r.Te.Auto&&this.flyoutData.common.popupOrigination===a.sR.AUTO_SHOW_PRICE_HISTORY&&(n+=", #divPriceHistorySection");let i=Array.prototype.slice.call(this.container.querySelectorAll(n));i=i.filter((e=>!o.includes(e))),t.push.apply(t,i),this.isEdgeDriver&&(t=t.filter((e=>"fluent-accordion"!==e.nodeName.toLowerCase()&&e.offsetHeight>0))),this.flyoutData&&this.flyoutData.common.openedWith===r.Te.Auto&&(t=t.filter((e=>"msft-micro-feedback-item"!==e.nodeName.toLowerCase())));const s=Array.prototype.slice.call(this.container.querySelectorAll('fluent-anchor[slot="footer"], fluent-button[slot="footer"],\n           button[slot="footer"], #footerDiv fluent-button'));if(t=t.filter((e=>!s.includes(e))),t.push.apply(t,s),t&&t.length>0){const o=t[0];let i=t[t.length-1];for(const e of t)e.classList.contains("checkoutButton")&&(i=e);let r=document.activeElement;if(r){if("divOverlayWrapper"===r.id){const e=r.shadowRoot;e&&(r=e.activeElement)}if(r===o&&e.shiftKey){let t=i?.parentElement?.shadowRoot;if("previousCashBackSection"===i.parentElement?.id){const e=i.parentElement?.parentElement?.shadowRoot;if(e){const o=e.querySelector("fluent-accordion-item");if(o&&!o.classList.contains("expanded")){const e=o.shadowRoot?.querySelector("button");e&&(e.focus(),t=null)}}}if(t){const e=t.querySelector("fluent-accordion-item");if(e&&!e.classList.contains("expanded")){const t=e.shadowRoot?.querySelector("button");t&&t.focus()}else i.focus()}else"previousCashBackSection"!==i.parentElement?.id&&(i.focus(),e.preventDefault())}else r!==i||e.shiftKey||(o.focus(),e.preventDefault())}}}))}static getInstance(){return null===s.currentInstance&&(s.currentInstance=new s),s.currentInstance}static getFirstFocusableElementInParent(e){return e.querySelectorAll(n)[0]}makeFocusOnActiveElement(e){if(this.currentFocusElement===document.activeElement)return;const t=e.querySelectorAll(n);0!==t.length&&(t.forEach((e=>{document.activeElement!==e||(this.currentFocusElement=e)})),this.currentFocusElement&&this.currentFocusElement.focus())}}(0,i.Z)(s,"currentInstance",null)},57549:function(e,t,o){o(4872),o(31656),o(31714),o(12710),o(5144),o(88767),o(73557),o(27689),o(86743),o(27775),o(56764),o(87605),o(2388),o(84901),o(86127),o(81687),o(65302),o(79710)},11542:function(e,t,o){var i=o(88767),r=o(73557);class a{static GetProductIdsFromUrl(e){let t;const o=[];try{t=new URL(e)}catch(e){return o}const i=a.IsPDPURL(t);return i.IsPDP&&0!==i.ProductIds.length?(o.push(...i.ProductIds),o):o}static IsGroceryCashbackNotification(e,t){const o=e===r.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK||e===r.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING;return t===i.Te.Auto&&o}static IsPDPURL(e){if(e.hostname.includes("amazon.com")){const t=e.pathname.match("/dp/([a-zA-Z0-9]+)($|/)|/gp/product/([a-zA-Z0-9]+)($|/)");if(t&&t.length>3)return{IsPDP:!0,ProductIds:[t[1]||t[3]]}}else if(e.hostname.includes("target.com")){const t=e.pathname.match("/p/.*/A-([a-zA-Z0-9]+)($|#|\\?)"),o=[];if(t&&t.length>1&&o.push(t[1]),e.searchParams.has("preselect")&&o.push(e.searchParams.get("preselect")||""),o.length>0)return{IsPDP:!0,ProductIds:o}}else if(e.hostname.includes("walmart.com")){const t=e.pathname.match("/ip/.*/([a-zA-Z0-9]+)($|#|\\?)");if(t&&t.length>1)return{IsPDP:!0,ProductIds:[t[1]]}}return{IsPDP:!1,ProductIds:[]}}}t.Z=a},75434:function(e,t,o){o.d(t,{F0:function(){return p},H:function(){return h},rm:function(){return g}});var i=o(72370),r=o(4872),a=o(31656),n=o(59645),s=o(5144),c=(o(55590),o(64641),o(56764)),l=(o(87605),o(11542),o(49259));function u(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function d(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?u(Object(o),!0).forEach((function(t){(0,i.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}async function h(e){const t=await e.GetAnid(!0);return t?.anid??""}function p(e,t,o,i,u,h={},p){const g=new n.Z(p||s.xu.GroceryCashbackError),C=function(e,t){const o=void 0!==e?.dataStoreModule?.ICVariations?Object.fromEntries(e.dataStoreModule.ICVariations):{},i=l.Z.getFactory().getCasbackContext();return e?{bingSignedInUser:e.dataStoreModule.UserInfo.isBingSignedInUser,isPane:e.common.isPane,isRebatesEnabled:e.common.isRebatesEnabled,isRebatesUser:e.dataStoreModule.UserInfo.isRebatesUser,msaSignedInUser:e.dataStoreModule.UserInfo.isMSASignedIn,openedWith:e.common.openedWith,pageType:t??"",popupOrigination:e.common.popupOrigination,url:i.getCurrentUrl(),domain:e.common.domain,variations:o,anonymousUserId:e.dataStoreModule.UserInfo.anonymousUserId,channel:e.common.channel,isAnonymousFlowEnabled:e.dataStoreModule.UserInfo.isAnonymousFlowEnabled,isAad:e.dataStoreModule.UserInfo.isAadEmailPresent,searchQuerySpb:e.dataStoreModule.SPBItemizedCashbackData?.searchQuery||"",categoryNameSpb:e.dataStoreModule.SPBItemizedCashbackData?.categoryName||"",searchQueryQt:e.dataStoreModule.GroceryCashbackData?.searchCategoryData?.searchQuery||"",categoryNameQt:e.dataStoreModule.GroceryCashbackData?.searchCategoryData?.categoryName||"",pdpDataSpb:e.dataStoreModule.SPBItemizedCashbackData?.SpbPDPData?.pdpData,pdpDataQt:e.dataStoreModule.GroceryCashbackData?.Cashback?.pdpCashBack?.pdpData,isAOCActive:a.R.isExperimentActive(r.H.autoOpenControllerScript),isDiscoverPane:e.common.isDiscoverPane,cashbackMetadata:e.dataStoreModule.CashBackData?.CreateLogMetadata()}:{pageType:t??""}}(e,u??"");g.Metadata=JSON.stringify(d(d(d({isError:!0,errorStr:i?JSON.stringify(i):""},C),h),{},{message:o})),t&&t.LogInfoEvent(s.R.EdgeFlyoutStatus,o,g,c.g.CouponImpressionId)}function g(e){try{if(!e)return;return JSON.parse(e)}catch(e){return}}},64550:function(e,t,o){o(5144)},93978:function(e,t,o){o.d(t,{YE:function(){return i}}),new Set(["en-us"]),new Set(["ar-sa","da-dk","de-de","de-at","de-ch","de-li","el-gr","en-us","en-au","en-ca","en-gb","en-ie","en-in","en-my","en-nz","en-ph","en-za","es-es","es-ar","es-cl","es-co","es-mx","es-pe","es-ve","fi-fi","fr-fr","fr-be","hu-hu","it-it","ja-jp","nb-no","nl-nl","nl-be","pl-pl","pt-pt","pt-br","sv-se","tr-tr","zh-hk","zh-tw"]),new Set(["en-us"]),new Set(["en-us"]),new Set(["en-us"]),new Set(["da-dk","de-de","de-at","de-ch","de-li","el-gr","en-us","en-au","en-ca","en-gb","en-ie","en-in","en-za","es-es","es-ar","es-cl","es-mx","fi-fi","fr-fr","hu-hu","it-it","ja-jp","nb-no","nl-nl","nl-be","pl-pl","pt-pt","pt-br","sv-se","tr-tr"]),new Set(["de-de","en-us","en-au","en-ca","en-in","en-gb","fr-fr"]),new Set(["da-dk","de-de","de-at","de-ch","en-us","en-au","en-ca","en-es","en-gb","en-id","en-ie","en-in","en-my","en-nz","en-ph","en-sg","en-th","en-vn","es-mx","es-ar","es-cl","es-co","es-pe","es-us","es-ve","fi-fi","fr-fr","fr-be","fr-ca","fr-ch","it-it","nl-nl","nl-be","no-no","pt-br","sv-se","zh-hk","zh-tw"]),new Set(["en-us"]),new Set(["en-us"]);const i=new Set(["da-dk","de-de","en-us","en-au","en-ca","en-es","en-gb","en-in","en-nz","en-sg","es-mx","es-us","fr-fr","fr-be","fr-ca","ja-jp","it-it","pt-br"]);new Set(["en-us","en-in","en-au","en-ca","es-mx","en-my","en-za","es-ar","zh-hk","zh-tw","en-sg","en-ph","en-nz","es-pe","es-ve","es-cl","en-ae"]),new Set(["en-us","en-gb","en-in","en-au","en-ca","ja-jp","fr-fr","de-de","es-es","it-it","nl-nl","fr-be","de-at","de-ch","nb-no","sv-se","en-ie"]),new Set(["en-us","en-au","en-ca","en-in"])},81687:function(e,t,o){o.d(t,{e1:function(){return c},eT:function(){return l}});var i=o(72370),r=o(59645),a=o(5144),n=o(88767),s=o(56764);let c=function(e){return e.onCashbackActivationError="onCashbackActivationError",e.onCashBackActivated="onCashBackActivated",e.onDelayedCashBackActivated="onDelayedCashBackActivated",e.onCashBackActivatedForRewards="onCashBackActivatedForRewards",e.telemetryCashBackActivationError="telemetryCashBackActivationError",e.onSignedInAndEnrolledInRebates="onSignedInAndEnrolledInRebates",e.onSignedInAndEnrolledInRebatesFailed="onSignedInAndEnrolledInRebatesFailed",e.telemetryCashBackActivated="telemetryCashBackActivated",e.StyleActivatedState="StyleActivatedState",e.StyleProcessingState="StyleProcessingState",e.CreateCommissionArrow="CreateCommissionArrow",e.CreateModules="CreateModules",e.CreateFeedbackModule="CreateFeedbackModule",e.CreateShortFeedbackModule="CreateShortFeedbackModule",e.ModulesRendered="ModulesRendered",e.PWILOPriceHistory="PWILOPriceHistory",e.onRebatesTelemetrySuccess="onRebatesTelemetrySuccess",e.onRebatesTelemetryFail="onRebatesTelemetryFail",e.onRewardsTelemetrySuccess="onRewardsTelemetrySuccess",e.onRewardsTelemetryFail="onRewardsTelemetryFail",e.onFlyoutResize="onFlyoutResize",e.rebatesNotActivating="rebatesNotActivating",e.rebatesSignInPendingSuccess="rebatesSignInPendingSuccess",e.rebatesSignInFail="rebatesSignInFail",e.rebatesFetchUserInfoFail="rebatesFetchUserInfoFail",e.PDPUpdate="PDPUpdate",e.onDataUpdate="onDataUpdate",e.domainEligibility="domainEligibility",e.pdpEligibility="pdpEligibility",e.flyoutRefresh="flyoutRefresh",e.PWILODeleted="PWILODeleted",e.WinCartDeleted="WinCartDeleted",e.PWILOEmpty="PWILOEmpty",e.PDPRemoved="PDPRemoved",e.CreateCBLearnMore="CreateCBLearnMore",e.FooterCreated="FooterCreated",e.ReRankFlyout="ReRankFlyout",e.MenuOptionClicked="MenuOptionClicked",e.RequestRefresh="RequestRefresh",e.FocusProductCollections="FocusProductCollections",e.FocusProductTracking="FocusProductTracking",e.FocusshoppingTrips="FocusShoppingTrips",e.ProductTrackingUpdate="ProductTrackingUpdate",e.InboxCouponUserLoggedIn="InboxCouponUserLoggedIn",e.InboxCouponUserDisconnected="InboxCouponUserDisconnected",e.ActiveRetailerInboxCouponsEmpty="ActiveRetailerInboxCouponsEmpty",e.InboxCouponsOpenSettings="InboxCouponsOpenSettings",e.InboxCouponsUpsellTriggered="InboxCouponsUpsellTriggered",e.ClientEngagement="ClientEngagement",e.ClientAction="ClientAction",e.OnFlyoutDismissed="OnFlyoutDismissed",e.HomeTabActive="HomeTabActive",e.SeeMoreClick="SeeMoreClick",e.ToastNotification="ToastNotification",e.CompleteEntityExtracted="CompleteEntityExtracted",e.ChangeContextualTitle="ChangeContextualTitle",e.ShoppingSettingsOpened="ShoppingSettingsOpened",e.InboxCouponsEdgeUserSuccsefullySignedIn="InboxCouponsEdgeUserSuccsefullySignedIn",e.InboxCouponsEdgeUserWorkProfileSuccsefullySignedIn="InboxCouponsEdgeUserWorkProfileSuccsefullySignedIn",e}({});const l=e=>new CustomEvent(c.ToastNotification,{detail:e});class u{constructor(e,t){(0,i.Z)(this,"logModule",void 0),(0,i.Z)(this,"shopping",void 0),(0,i.Z)(this,"renderedModules",void 0),this.logModule=e,this.shopping=t,this.renderedModules=new Set,this.cleanStateMapping(),this.cleanShoppingEventListeners()}getState(e){return u.stateMapping.get(e)}setState(e,t){u.stateMapping.set(e,t)}addEventListener(e,t){try{this.addShoppingEventListener(e,t),this.shopping.addEventListener(e,t)}catch(t){const o=s.g.EdgeImpressionId,i=new r.Z(a.xu.OnErrorInvoked);this.logModule.LogErrorEvent(a.R.EdgeFlyoutStatus,`addEventListener exception: ${e} ${t}`,i,o)}}removeEventListener(e,t){try{this.shopping.removeEventListener(e,t),this.removeShoppingEventListener(e,t)}catch(t){const o=s.g.EdgeImpressionId,i=new r.Z(a.xu.OnErrorInvoked);this.logModule.LogErrorEvent(a.R.EdgeFlyoutStatus,`removeEventListener exception: ${e} ${t}`,i,o)}}dispatchEvent(e){try{this.shopping.dispatchEvent(e)}catch(t){const o=s.g.EdgeImpressionId,i=new r.Z(a.xu.OnErrorInvoked);this.logModule.LogErrorEvent(a.R.EdgeFlyoutStatus,`dispatchEvent exception: ${e?.type} ${t}`,i,o)}}AddDiscoverRenderModule(e){this.renderedModules.add(e)}CanDiscoverRender(e){return e in n.ModuleNames&&this.renderedModules.has(n.ModuleNames[e])}cleanStateMapping(){u.stateMapping=new Map}cleanShoppingEventListeners(){try{u.wrapperEventListener.forEach(((e,t)=>{e.forEach((e=>{this.shopping.removeEventListener(t,e)}))})),u.wrapperEventListener.clear()}catch(e){this.logModule.LogErrorEvent,new r.Z(a.xu.RefreshError),a.R.EdgeFlyoutStatus}}addShoppingEventListener(e,t){u.wrapperEventListener.has(e)||u.wrapperEventListener.set(e,new Set),u.wrapperEventListener.get(e)?.add(t)}removeShoppingEventListener(e,t){u.wrapperEventListener.get(e)?.delete(t)}}(0,i.Z)(u,"stateMapping",new Map),(0,i.Z)(u,"wrapperEventListener",new Map)},23582:function(e,t,o){var i=o(72370);let r=!1;const a=e=>!!(e instanceof Array&&Object.isFrozen(e)),n=(e,t)=>(e=>{if(a(e)&&e.raw&&a(e.raw)&&e.length===e.raw.length&&1===e.length)return e.join("");if(r)return e.join("");throw new TypeError("Static Types only allows static Template literals")})(t),s={createHTML:n,createScript:n,createScriptURL:n};(0,i.Z)(class{static getTrustedHTML(e){return this.staticPolicy.createHTML("",e)}static getTrustedScript(e){return this.staticPolicy.createScript("",e)}static getTrustedScriptURL(e){return this.staticPolicy.createScriptURL("",e)}static setStoryBook(){r=!0}},"staticPolicy",window.trustedTypes?window.trustedTypes.createPolicy("shopping-static",s):s)},91221:function(e,t,o){o.d(t,{Z:function(){return S}});var i=o(72370),r=o(64865),a=o(59645),n=o(5144),s=o(91495),c=o(27689),l=o(21650);class u{constructor(){(0,i.Z)(this,"intValue",void 0)}static Create(e){const t=new u;return t.intValue=e.intValue,t}static CreateFromInteger(e){const t=new u;return t.intValue=e,t}}var d=u;class h{constructor(){(0,i.Z)(this,"nullValue",void 0)}static Create(e){const t=new h;return t.nullValue=e.nullValue,t}}var p=h,g=o(96834);class C{static hasNotificationBeenShownRecently(e,t){try{if(void 0===C.storage)return!1;const o=C.storage[e];if(o&&""!==o){const e=(new Date).toUTCString();return new Date(e).getTime()-new Date(o).getTime()<t}return!1}catch(e){return!1}}constructor(e,t,o){let r;(0,i.Z)(this,"pageHandlerModule",void 0),(0,i.Z)(this,"logModule",void 0),(0,i.Z)(this,"storageEmpty",void 0),(0,i.Z)(this,"autoClearedKeySubstrings",void 0),(0,i.Z)(this,"customCleaningKeys",void 0),(0,i.Z)(this,"storageCleanerKey","StorageCleaner"),(0,i.Z)(this,"cleaningSchedule",6048e5),t&&(r=t.GetLoadTimeDataValue("storage",void 0)),this.logModule=o,this.storageEmpty=!1,r?(s.Q.setRawStorageObject(r),C.storage=s.Q.rawStorageObj):this.storageEmpty=!0,this.pageHandlerModule=e,this.autoClearedKeySubstrings=["SuggestedCoupons","OtherSellers","price","EstimatedCashback","BackgroundAutoApplyData","InboxCouponsResponseCache","InboxCouponsAuthToken","isCheckoutPage","CashbackProductUrl"],this.customCleaningKeys=["AutoOpenData","AutoOpenDomainPrefData","AutoOpenPrefData","AAConsentData","InboxCouponsGetAllCouponsResponseCache","InboxCouponsUserEmailsStatusCache","UserConsentedInboxCoupon",this.storageCleanerKey]}async getStorageBool(e){let t=C.storage[e];return this.storageEmpty&&(t=await this.pageHandlerModule.GetStorageValue(e),t=t?.value?.boolValue),t||null}async getStorageInteger(e){let t=C.storage[e];return this.storageEmpty&&(t=await this.pageHandlerModule.GetStorageValue(e),t=t?.value?.intValue),t||NaN}async getStorageString(e,t){let o=C.storage[e];return(this.storageEmpty||t&&(!o||""===o||null===o))&&(o=await this.pageHandlerModule.GetStorageValue(e),o=o?.value?.stringValue,C.storage[e]=o),o?.value?"string"!=typeof o.value?JSON.stringify(o.value):o.value:"string"!=typeof o?JSON.stringify(o):o||""}setStorageBool(e,t){this.storageEmpty=!1,C.storage[e]=t,this.pageHandlerModule.SetStorageValue(e,l.Z.CreateFromBool(t))}setStorageInteger(e,t){this.storageEmpty=!1,C.storage[e]=t,this.pageHandlerModule.SetStorageValue(e,d.CreateFromInteger(t))}setStorageString(e,t){this.storageEmpty=!1,C.storage[e]=t,this.pageHandlerModule.SetStorageValue(e,g.Z.CreateFromString(t))}setStorageValueByDottedPath(e,t){this.storageEmpty=!1,C.storage[e]=t,this.pageHandlerModule.SetStorageValueByDottedPath(e,g.Z.CreateFromString(t))}async getStorageValueByDottedPath(e){let t=C.storage[e];return this.storageEmpty&&(t=await this.pageHandlerModule.GetStorageValueByDottedPath(e),t=t?.value?.stringValue),t?.value?"string"!=typeof t.value?JSON.stringify(t.value):t.value:"string"!=typeof t?JSON.stringify(t):t||""}clearStorage(e){this.pageHandlerModule.SetStorageValue(e,new p)}clearStorageByDottedPath(e){this.pageHandlerModule.ClearStorageValue(e)}async scheduledStorageCleaner(){const e=await this.getStorageString(this.storageCleanerKey);if(e&&e&&"{}"!==e){const t=(0,c.BQ)(e,!0);if(Date.now()-t<this.cleaningSchedule)return}const t=Object.getOwnPropertyNames(s.Q);t&&(t.forEach((e=>{if(s.Q[e]&&-1===this.customCleaningKeys.findIndex((t=>e.includes(t))))if(-1!==this.autoClearedKeySubstrings.findIndex((t=>e.includes(t))))this.clearStorage(e);else{let t=s.Q[e];if("string"!=typeof s.Q[e]&&(t=JSON.stringify(s.Q[e])),t.length>1e5){this.clearStorage(e);const t=new a.Z(n.xu.StorageLimitReached);this.logModule.LogInfoEvent(n.R.EdgeFlyoutStatus,"storage bigger than 100K",t)}}})),this.setStorageString(this.storageCleanerKey,Date.now().toString()))}async clearDomainMappedStringStorage(e,t,o){if(!e||!t)return;let i;if(o)i=o;else{const t=await this.getStorageString(e);if(!(0,r.TF)(t))try{i=JSON.parse(t)??{}}catch(e){}}i&&(i[t]=null,this.setStorageString(e,JSON.stringify(i)))}}(0,i.Z)(C,"storage",[]);var S=C},65302:function(e,t,o){o.d(t,{YU:function(){return a},H6:function(){return s},Pw:function(){return n}}),o(4872),o(31656),o(5144);var i=o(93190),r=o(73557);function a(e){return`${e?.name??""} ${e?.message??""} ${e?.stack??""}`}function n(e){switch(e){case i.p.ATTAINABLE_COUPONS:return r.sR.AUTO_SHOW_ATTAINABLE_COUPONS;case i.p.AUTOS_MARKETPLACE:return r.sR.AUTO_SHOW_AUTOS_MARKETPLACE;case i.p.COUPONS_CLIPPING:return r.sR.AUTO_SHOW_COUPONS_CLIPPING;case i.p.EXCLUSIVE_COUPONS:return r.sR.AUTO_SHOW_SOCIAL_COUPONS;case i.p.GROCERY_ITEMIZED_CASHBACK:return r.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK;case i.p.SPB_CASHBACK_LANDING:return r.sR.AUTO_SHOW_SPB_CASHBACK_LANDING;case i.p.GROCERY_ITEMIZED_CASHBACK_LANDING:return r.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING;case i.p.OTHER_SELLERS_CONFIRMATION:return r.sR.AUTO_SHOW_ITEM_ADDED_TO_CART_FROM_OTHER_SELLER;case i.p.OTHER_SELLERS:case i.p.OTHER_SELLERS_TRIGGER:return r.sR.AUTO_SHOW_OTHER_SELLERS;case i.p.PRINT_GROCERY:return r.sR.AUTO_SHOW_RECOMMENDATIONS;case i.p.PRODUCT_TRACKING_OUT_OF_STOCK:return r.sR.AUTO_PRODUCT_TRACKING_OUT_OF_STOCK;case i.p.REWARDS_GIFT_CARD:return r.sR.AUTO_SHOW_GIFT_CARD;case i.p.AA_CONSENT:return r.sR.AA_CONSENT;default:return null}}function s(e){switch(e){case r.sR.AUTO_SHOW_COUPONS_CHECKOUT:case r.sR.AA_CONSENT:case r.sR.AUTO_SHOW_BING_SEARCH:return r.Ke.COUPONS_CHECKOUT;case r.sR.AUTO_SHOW_URL_PARAM_REBATES:return r.Ke.REBATES_BING;case r.sR.AUTO_SHOW_AUTOS_MARKETPLACE:return r.Ke.AUTOS_MARKETPLACE;case r.sR.AUTO_SHOW_COUPONS_CLIPPING:return r.Ke.COUPONS_CLIPPING;case r.sR.AUTO_SHOW_LOWER_PRICE_FOUND:case r.sR.AUTO_SHOW_URL_PARAM_PRICE_COMPARISON:return r.Ke.PRICE_COMPARE;case r.sR.AUTO_SHOW_PRICE_HISTORY:case r.sR.AUTO_SHOW_URL_PARAM_PRICE_HISTORY:return r.Ke.PRICE_HISTORY;case r.sR.AUTO_SHOW_REBATES_CONFIRMATION:return r.Ke.REBATES_CONFIRMATION;case r.sR.AUTO_SHOW_REBATES:return r.Ke.REBATES_BING;case r.sR.AUTO_SHOW_REBATES_ORGANIC:case r.sR.AUTO_SHOW_REBATES_ORGANIC_NEW:return r.Ke.REBATES_ORGANIC;case r.sR.AUTO_SHOW_REBATES_CHECKOUT:return r.Ke.REBATES_CHECKOUT;case r.sR.AUTO_SHOW_PERSONALIZED_CASHBACK||r.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_ADDRESSBAR:return r.Ke.PERSONALIZED_CASHBACK;case r.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION:return r.Ke.PERSONALIZED_CASHBACK_CONFIRMATION;case r.sR.AUTO_SHOW_EXPRESS_CHECKOUT:return r.Ke.EXPRESS_CHECKOUT;case r.sR.AUTO_SHOW_SERVER_DRIVEN_REWARDS:return r.Ke.REWARDS;case r.sR.AUTO_SHOW_OTHER_SELLERS:case r.sR.AUTO_SHOW_ITEM_ADDED_TO_CART_FROM_OTHER_SELLER:return r.Ke.OTHER_SELLER;case r.sR.AUTO_SHOW_PROFESSIONAL_REVIEWS:return r.Ke.REVIEWS;case r.sR.AUTO_SHOW_SOCIAL_COUPONS:return r.Ke.EXCLUSIVE_COUPONS;case r.sR.AUTO_SHOW_GUEST_DOMAIN_COUPONS:return r.Ke.GUEST_COUPONS;case r.sR.AUTO_SHOW_SUSTAINABILITY_LANDING:return r.Ke.SUSTAINABILITY_LANDING;case r.sR.AUTO_SHOW_SUSTAINABILITY_PURCHASE:return r.Ke.SUSTAINABILITY_PURCHASE;case r.sR.AUTO_SHOW_PACKAGE_TRACKING:return r.Ke.PACKAGE_TRACKING;case r.sR.AUTO_SHOW_ATTAINABLE_COUPONS:return r.Ke.ATTAINABLE_COUPONS;case r.sR.AUTO_SHOW_GIFT_CARD:return r.Ke.REWARDS_GIFT_CARD;case r.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK:return r.Ke.GROCERY_ITEMIZED_CASHBACK;case r.sR.AUTO_PRODUCT_TRACKING_OUT_OF_STOCK:return r.Ke.OUT_OF_STOCK;case r.sR.AUTO_SHOW_VIRTUAL_CARD:return r.Ke.VIRTUAL_CARD;case r.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING:return r.Ke.GROCERY_ITEMIZED_CASHBACK_LANDING;case r.sR.AUTO_SHOW_SPB_CASHBACK_LANDING:return r.Ke.SPB_CASHBACK_LANDING;case r.sR.OPEN_FLYOUT_FROM_EDGE_DRIVER_EC:return r.Ke.EXPRESS_CHECKOUT;case r.sR.AUTO_SHOW_RECOMMENDATIONS:return r.Ke.RECOMMENDATIONS;default:return r.Ke.NONE}}o(56764),o(21597),o(56372),o(29247),o(17675),o(13018),o(12710),o(88767),o(84901),o(86743),o(36493),o(64106),o(79710),o(57549),o(91221),o(1583),o(55590),o(18549),o(91495),o(2388),o(75434),o(64550),o(54380),o(46357),o(87605),o(3960)},79710:function(e,t,o){o(5144),o(27689),o(27775),o(87605)},3960:function(e,t,o){o(5144),o(88767),o(73557),o(81687),o(79710),o(4872),o(31656),o(36493),o(27689),o(23582),o(21908),o(65302)},46357:function(e,t,o){var i;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.Top=2]="Top",e[e.Bottom=3]="Bottom"}(i||(i={}))},45908:function(e,t,o){function i(e,t,o,i){var r,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(a<3?r(n):a>3?r(t,o,n):r(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n}o.d(t,{gn:function(){return i}})},72370:function(e,t,o){o.d(t,{Z:function(){return r}});var i=o(39316);function r(e,t,o){return(t=(0,i.Z)(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}},82387:function(e,t,o){o.d(t,{Z:function(){return r}});var i=o(25039);function r(e,t){if("object"!==(0,i.Z)(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!==(0,i.Z)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},39316:function(e,t,o){o.d(t,{Z:function(){return a}});var i=o(25039),r=o(82387);function a(e){var t=(0,r.Z)(e,"string");return"symbol"===(0,i.Z)(t)?t:String(t)}},25039:function(e,t,o){function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}o.d(t,{Z:function(){return i}})},5597:function(e,t,o){o.d(t,{so:function(){return c}});var i=o(2907),r=o(98557),a=o(18438);const n=Object.freeze({locate:(0,a.j8)()}),s={toView(e){return e?"true":"false"},fromView(e){return null!=e&&"false"!==e&&!1!==e&&0!==e}};class c{constructor(e,t,o=t.toLowerCase(),i="reflect",r){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=o,this.mode=i,this.converter=r,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===i&&void 0===r&&(this.converter=s)}setValue(e,t){const o=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),o!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](o,t),e.$fastController.notify(this.name))}getValue(e){return i.y$.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,o=this.guards;o.has(e)||"fromView"===t||r.SO.queueUpdate((()=>{o.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;r.SO.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":r.SO.setBooleanAttribute(e,this.attribute,i)}o.delete(e)}))}static collect(e,...t){const o=[];t.push(n.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];"string"==typeof i?o.push(new c(e,i)):o.push(new c(e,i.property,i.attribute,i.mode,i.converter))}}return o}}},72171:function(e,t,o){o.d(t,{W:function(){return u}});var i=o(18438),r=o(2907),a=o(2681),n=o(5597);const s={mode:"open"},c={},l=i.Bo.getById(4,(()=>{const e=new Map;return Object.freeze({register(t){return!e.has(t.type)&&(e.set(t.type,t),!0)},getByType(t){return e.get(t)}})}));class u{constructor(e,t=e.definition){"string"==typeof t&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;const o=n.so.collect(e,t.attributes),i=new Array(o.length),r={},l={};for(let e=0,t=o.length;e<t;++e){const t=o[e];i[e]=t.attribute,r[t.name]=t,l[t.attribute]=t}this.attributes=o,this.observedAttributes=i,this.propertyLookup=r,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?s:null===t.shadowOptions?void 0:Object.assign(Object.assign({},s),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?c:Object.assign(Object.assign({},c),t.elementOptions),this.styles=void 0===t.styles?void 0:Array.isArray(t.styles)?a.XL.create(t.styles):t.styles instanceof a.XL?t.styles:a.XL.create([t.styles])}get isDefined(){return!!l.getByType(this.type)}define(e=customElements){const t=this.type;if(l.register(this)){const e=this.attributes,o=t.prototype;for(let t=0,i=e.length;t<i;++t)r.y$.defineProperty(o,e[t]);Reflect.defineProperty(t,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return e.get(this.name)||e.define(this.name,t,this.elementOptions),this}}u.forType=l.getByType},2816:function(e,t,o){o.d(t,{H:function(){return h}});var i=o(98557),r=o(55208),a=o(2907),n=o(72171);const s=new WeakMap,c={bubbles:!0,composed:!0,cancelable:!0};function l(e){return e.shadowRoot||s.get(e)||null}class u extends r.A{constructor(e,t){super(e),this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=e,this.definition=t;const o=t.shadowOptions;if(void 0!==o){const t=e.attachShadow(o);"closed"===o.mode&&s.set(e,t)}const i=a.y$.getAccessors(e);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let o=0,r=i.length;o<r;++o){const r=i[o].name,a=e[r];void 0!==a&&(delete e[r],t[r]=a)}}}get isConnected(){return a.y$.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,a.y$.notify(this,"isConnected")}get template(){return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get styles(){return this._styles}set styles(e){this._styles!==e&&(null!==this._styles&&this.removeStyles(this._styles),this._styles=e,this.needsInitialization||null===e||this.addStyles(e))}addStyles(e){const t=l(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.append(e);else if(!e.isAttachedTo(t)){const o=e.behaviors;e.addStylesTo(t),null!==o&&this.addBehaviors(o)}}removeStyles(e){const t=l(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.removeChild(e);else if(e.isAttachedTo(t)){const o=e.behaviors;e.removeStylesFrom(t),null!==o&&this.removeBehaviors(o)}}addBehaviors(e){const t=this.behaviors||(this.behaviors=new Map),o=e.length,i=[];for(let r=0;r<o;++r){const o=e[r];t.has(o)?t.set(o,t.get(o)+1):(t.set(o,1),i.push(o))}if(this._isConnected){const e=this.element;for(let t=0;t<i.length;++t)i[t].bind(e,a.Wp)}}removeBehaviors(e,t=!1){const o=this.behaviors;if(null===o)return;const i=e.length,r=[];for(let a=0;a<i;++a){const i=e[a];if(o.has(i)){const e=o.get(i)-1;0===e||t?o.delete(i)&&r.push(i):o.set(i,e)}}if(this._isConnected){const e=this.element;for(let t=0;t<r.length;++t)r[t].unbind(e)}}onConnectedCallback(){if(this._isConnected)return;const e=this.element;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(e,a.Wp);const t=this.behaviors;if(null!==t)for(const[o]of t)o.bind(e,a.Wp);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const e=this.view;null!==e&&e.unbind();const t=this.behaviors;if(null!==t){const e=this.element;for(const[o]of t)o.unbind(e)}}onAttributeChangedCallback(e,t,o){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.element,o)}emit(e,t,o){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},c),o)))}finishInitialization(){const e=this.element,t=this.boundObservables;if(null!==t){const o=Object.keys(t);for(let i=0,r=o.length;i<r;++i){const r=o[i];e[r]=t[r]}this.boundObservables=null}const o=this.definition;null===this._template&&(this.element.resolveTemplate?this._template=this.element.resolveTemplate():o.template&&(this._template=o.template||null)),null!==this._template&&this.renderTemplate(this._template),null===this._styles&&(this.element.resolveStyles?this._styles=this.element.resolveStyles():o.styles&&(this._styles=o.styles||null)),null!==this._styles&&this.addStyles(this._styles),this.needsInitialization=!1}renderTemplate(e){const t=this.element,o=l(t)||t;null!==this.view?(this.view.dispose(),this.view=null):this.needsInitialization||i.SO.removeChildNodes(o),e&&(this.view=e.render(t,o,t))}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const o=n.W.forType(e.constructor);if(void 0===o)throw new Error("Missing FASTElement definition.");return e.$fastController=new u(e,o)}}function d(e){return class extends e{constructor(){super(),u.forCustomElement(this)}$emit(e,t,o){return this.$fastController.emit(e,t,o)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(e,t,o){this.$fastController.onAttributeChangedCallback(e,t,o)}}}const h=Object.assign(d(HTMLElement),{from(e){return d(e)},define(e,t){return new n.W(e,t).define().type}})},98557:function(e,t,o){o.d(t,{SO:function(){return u}});var i=o(18438);const r=i.P3.FAST.getById(1,(()=>{const e=[],t=[];function o(){if(t.length)throw t.shift()}function r(e){try{e.call()}catch(e){t.push(e),setTimeout(o,0)}}function a(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let o=0,i=e.length-t;o<i;o++)e[o]=e[o+t];e.length-=t,t=0}e.length=0}return Object.freeze({enqueue:function(t){e.length<1&&i.P3.requestAnimationFrame(a),e.push(t)},process:a})})),a=i.P3.trustedTypes.createPolicy("fast-html",{createHTML:e=>e});let n=a;const s=`fast-${Math.random().toString(36).substring(2,8)}`,c=`${s}{`,l=`}${s}`,u=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(e){if(n!==a)throw new Error("The HTML policy can only be set once.");n=e},createHTML(e){return n.createHTML(e)},isMarker(e){return e&&8===e.nodeType&&e.data.startsWith(s)},extractDirectiveIndexFromMarker(e){return parseInt(e.data.replace(`${s}:`,""))},createInterpolationPlaceholder(e){return`${c}${e}${l}`},createCustomAttributePlaceholder(e,t){return`${e}="${this.createInterpolationPlaceholder(t)}"`},createBlockPlaceholder(e){return`\x3c!--${s}:${e}--\x3e`},queueUpdate:r.enqueue,processUpdates:r.process,nextUpdate(){return new Promise(r.enqueue)},setAttribute(e,t,o){null==o?e.removeAttribute(t):e.setAttribute(t,o)},setBooleanAttribute(e,t,o){o?e.setAttribute(t,""):e.removeAttribute(t)},removeChildNodes(e){for(let t=e.firstChild;null!==t;t=e.firstChild)e.removeChild(t)},createTemplateWalker(e){return document.createTreeWalker(e,133,null,!1)}})},55208:function(e,t,o){o.d(t,{A:function(){return r},q:function(){return i}});class i{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else-1===t.indexOf(e)&&t.push(e)}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const o=t.indexOf(e);-1!==o&&t.splice(o,1)}}notify(e){const t=this.spillover,o=this.source;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(o,e),void 0!==i&&i.handleChange(o,e)}else for(let i=0,r=t.length;i<r;++i)t[i].handleChange(o,e)}}class r{constructor(e){this.subscribers={},this.sourceSubscribers=null,this.source=e}notify(e){var t;const o=this.subscribers[e];void 0!==o&&o.notify(e),null===(t=this.sourceSubscribers)||void 0===t||t.notify(e)}subscribe(e,t){var o;if(t){let o=this.subscribers[t];void 0===o&&(this.subscribers[t]=o=new i(this.source)),o.subscribe(e)}else this.sourceSubscribers=null!==(o=this.sourceSubscribers)&&void 0!==o?o:new i(this.source),this.sourceSubscribers.subscribe(e)}unsubscribe(e,t){var o;if(t){const o=this.subscribers[t];void 0!==o&&o.unsubscribe(e)}else null===(o=this.sourceSubscribers)||void 0===o||o.unsubscribe(e)}}},2907:function(e,t,o){o.d(t,{LO:function(){return s},Wp:function(){return u},y$:function(){return n}});var i=o(98557),r=o(18438),a=o(55208);const n=r.Bo.getById(2,(()=>{const e=/(:|&&|\|\||if)/,t=new WeakMap,o=i.SO.queueUpdate;let n,s=e=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function c(e){let o=e.$fastController||t.get(e);return void 0===o&&(Array.isArray(e)?o=s(e):t.set(e,o=new a.A(e))),o}const l=(0,r.j8)();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const o=this.field,i=e[o];if(i!==t){e[o]=t;const r=e[this.callback];"function"==typeof r&&r.call(e,i,t),c(e).notify(this.name)}}}class d extends a.q{constructor(e,t,o=!1){super(e,t),this.binding=e,this.isVolatileBinding=o,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(e,t){this.needsRefresh&&null!==this.last&&this.disconnect();const o=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const i=this.binding(e,t);return n=o,i}disconnect(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(e,t){const o=this.last,i=c(e),r=null===o?this.first:{};if(r.propertySource=e,r.propertyName=t,r.notifier=i,i.subscribe(this,t),null!==o){if(!this.needsRefresh){let t;n=void 0,t=o.propertySource[o.propertyName],n=this,e===t&&(this.needsRefresh=!0)}o.next=r}this.last=r}handleChange(){this.needsQueue&&(this.needsQueue=!1,o(this))}call(){null!==this.last&&(this.needsQueue=!0,this.notify(this))}records(){let e=this.first;return{next:()=>{const t=e;return void 0===t?{value:void 0,done:!0}:(e=e.next,{value:t,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(e){s=e},getNotifier:c,track(e,t){void 0!==n&&n.watch(e,t)},trackVolatile(){void 0!==n&&(n.needsRefresh=!0)},notify(e,t){c(e).notify(t)},defineProperty(e,t){"string"==typeof t&&(t=new u(t)),l(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get:function(){return t.getValue(this)},set:function(e){t.setValue(this,e)}})},getAccessors:l,binding(e,t,o=this.isVolatileBinding(e)){return new d(e,t,o)},isVolatileBinding(t){return e.test(t.toString())}})}));function s(e,t){n.defineProperty(e,t)}const c=r.Bo.getById(3,(()=>{let e=null;return{get(){return e},set(t){e=t}}}));class l{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return c.get()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(e){c.set(e)}}n.defineProperty(l.prototype,"index"),n.defineProperty(l.prototype,"length");const u=Object.seal(new l)},18438:function(e,t,o){o.d(t,{Bo:function(){return a},P3:function(){return i},j8:function(){return n}});const i=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;try{return new Function("return this")()}catch(e){return{}}}();void 0===i.trustedTypes&&(i.trustedTypes={createPolicy:(e,t)=>t});const r={configurable:!1,enumerable:!1,writable:!1};void 0===i.FAST&&Reflect.defineProperty(i,"FAST",Object.assign({value:Object.create(null)},r));const a=i.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,o){let i=e[t];return void 0===i&&(i=o?e[t]=o():null),i}},r))}function n(){const e=new WeakMap;return function(t){let o=e.get(t);if(void 0===o){let i=Reflect.getPrototypeOf(t);for(;void 0===o&&null!==i;)o=e.get(i),i=Reflect.getPrototypeOf(i);o=void 0===o?[]:o.slice(0),e.set(t,o)}return o}}Object.freeze([])},85888:function(e,t,o){o.d(t,{v:function(){return i}});class i{createCSS(){return""}createBehavior(){}}},2681:function(e,t,o){o.d(t,{XL:function(){return r}});var i=o(98557);class r{constructor(){this.targets=new WeakSet}addStylesTo(e){this.targets.add(e)}removeStylesFrom(e){this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}}function a(e){return e.map((e=>e instanceof r?a(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}function n(e){return e.map((e=>e instanceof r?e.behaviors:null)).reduce(((e,t)=>null===t?e:(null===e&&(e=[]),e.concat(t))),null)}r.create=(()=>{if(i.SO.supportsAdoptedStyleSheets){const e=new Map;return t=>new l(t,e)}return e=>new d(e)})();let s=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},c=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(i.SO.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),s=(e,t)=>{e.adoptedStyleSheets.push(...t)},c=(e,t)=>{for(const o of t){const t=e.adoptedStyleSheets.indexOf(o);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}class l extends r{constructor(e,t){super(),this.styles=e,this.styleSheetCache=t,this._styleSheets=void 0,this.behaviors=n(e)}get styleSheets(){if(void 0===this._styleSheets){const e=this.styles,t=this.styleSheetCache;this._styleSheets=a(e).map((e=>{if(e instanceof CSSStyleSheet)return e;let o=t.get(e);return void 0===o&&(o=new CSSStyleSheet,o.replaceSync(e),t.set(e,o)),o}))}return this._styleSheets}addStylesTo(e){s(e,this.styleSheets),super.addStylesTo(e)}removeStylesFrom(e){c(e,this.styleSheets),super.removeStylesFrom(e)}}let u=0;class d extends r{constructor(e){super(),this.styles=e,this.behaviors=null,this.behaviors=n(e),this.styleSheets=a(e),this.styleClass="fast-style-class-"+ ++u}addStylesTo(e){const t=this.styleSheets,o=this.styleClass;e=this.normalizeTarget(e);for(let i=0;i<t.length;i++){const r=document.createElement("style");r.innerHTML=t[i],r.className=o,e.append(r)}super.addStylesTo(e)}removeStylesFrom(e){const t=(e=this.normalizeTarget(e)).querySelectorAll(`.${this.styleClass}`);for(let o=0,i=t.length;o<i;++o)e.removeChild(t[o]);super.removeStylesFrom(e)}isAttachedTo(e){return super.isAttachedTo(this.normalizeTarget(e))}normalizeTarget(e){return e===document?document.body:e}}},11127:function(e,t,o){o.d(t,{DesignToken:function(){return v}});var i=o(45908),r=o(85888),a=o(2907),n=o(2816),s=o(98584),c=o(98557),l=o(2681);const u=document.createElement("div");class d{setProperty(e,t){c.SO.queueUpdate((()=>this.target.setProperty(e,t)))}removeProperty(e){c.SO.queueUpdate((()=>this.target.removeProperty(e)))}}class h extends d{constructor(){super();const e=new CSSStyleSheet;this.target=e.cssRules[e.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}}class p extends d{constructor(){super(),this.style=document.createElement("style"),document.head.appendChild(this.style);const{sheet:e}=this.style;if(e){const t=e.insertRule(":root{}",e.cssRules.length);this.target=e.cssRules[t].style}}}class g{constructor(e){this.store=new Map,this.target=null;const t=e.$fastController;this.style=document.createElement("style"),t.addStyles(this.style),a.y$.getNotifier(t).subscribe(this,"isConnected"),this.handleChange(t,"isConnected")}targetChanged(){if(null!==this.target)for(const[e,t]of this.store.entries())this.target.setProperty(e,t)}setProperty(e,t){this.store.set(e,t),c.SO.queueUpdate((()=>{null!==this.target&&this.target.setProperty(e,t)}))}removeProperty(e){this.store.delete(e),c.SO.queueUpdate((()=>{null!==this.target&&this.target.removeProperty(e)}))}handleChange(e,t){const{sheet:o}=this.style;if(o){const e=o.insertRule(":host{}",o.cssRules.length);this.target=o.cssRules[e].style}else this.target=null}}(0,i.gn)([a.LO],g.prototype,"target",void 0);class C{constructor(e){this.target=e.style}setProperty(e,t){c.SO.queueUpdate((()=>this.target.setProperty(e,t)))}removeProperty(e){c.SO.queueUpdate((()=>this.target.removeProperty(e)))}}class S{setProperty(e,t){S.properties[e]=t;for(const o of S.roots.values())P.getOrCreate(S.normalizeRoot(o)).setProperty(e,t)}removeProperty(e){delete S.properties[e];for(const t of S.roots.values())P.getOrCreate(S.normalizeRoot(t)).removeProperty(e)}static registerRoot(e){const{roots:t}=S;if(!t.has(e)){t.add(e);const o=P.getOrCreate(this.normalizeRoot(e));for(const e in S.properties)o.setProperty(e,S.properties[e])}}static unregisterRoot(e){const{roots:t}=S;if(t.has(e)){t.delete(e);const o=P.getOrCreate(S.normalizeRoot(e));for(const e in S.properties)o.removeProperty(e)}}static normalizeRoot(e){return e===u?document:e}}S.roots=new Set,S.properties={};const m=new WeakMap,A=c.SO.supportsAdoptedStyleSheets?class extends d{constructor(e){super();const t=new CSSStyleSheet;this.target=t.cssRules[t.insertRule(":host{}")].style,e.$fastController.addStyles(l.XL.create([t]))}}:g,P=Object.freeze({getOrCreate(e){if(m.has(e))return m.get(e);let t;return t=e===u?new S:e instanceof Document?c.SO.supportsAdoptedStyleSheets?new h:new p:e instanceof n.H?new A(e):new C(e),m.set(e,t),t}});class f extends r.v{constructor(e){super(),this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=e.name,null!==e.cssCustomPropertyName&&(this.cssCustomProperty=`--${e.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=f.uniqueId(),f.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new f({name:"string"==typeof e?e:e.name,cssCustomPropertyName:"string"==typeof e?e:void 0===e.cssCustomPropertyName?e.name:e.cssCustomPropertyName})}static isCSSDesignToken(e){return"string"==typeof e.cssCustomProperty}static isDerivedDesignTokenValue(e){return"function"==typeof e}static getTokenById(e){return f.tokensById.get(e)}getOrCreateSubscriberSet(e=this){return this.subscribers.get(e)||this.subscribers.set(e,new Set)&&this.subscribers.get(e)}createCSS(){return this.cssVar||""}getValueFor(e){const t=_.getOrCreate(e).get(this);if(void 0!==t)return t;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${e} or an ancestor of ${e}.`)}setValueFor(e,t){return this._appliedTo.add(e),t instanceof f&&(t=this.alias(t)),_.getOrCreate(e).set(this,t),this}deleteValueFor(e){return this._appliedTo.delete(e),_.existsFor(e)&&_.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(u,e),this}subscribe(e,t){const o=this.getOrCreateSubscriberSet(t);t&&!_.existsFor(t)&&_.getOrCreate(t),o.has(e)||o.add(e)}unsubscribe(e,t){const o=this.subscribers.get(t||this);o&&o.has(e)&&o.delete(e)}notify(e){const t=Object.freeze({token:this,target:e});this.subscribers.has(this)&&this.subscribers.get(this).forEach((e=>e.handleChange(t))),this.subscribers.has(e)&&this.subscribers.get(e).forEach((e=>e.handleChange(t)))}alias(e){return t=>e.getValueFor(t)}}f.uniqueId=(()=>{let e=0;return()=>(e++,e.toString(16))})(),f.tokensById=new Map;class E{constructor(e,t,o){this.source=e,this.token=t,this.node=o,this.dependencies=new Set,this.observer=a.y$.binding(e,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,a.Wp))}}class T{constructor(){this.values=new Map}set(e,t){this.values.get(e)!==t&&(this.values.set(e,t),a.y$.getNotifier(this).notify(e.id))}get(e){return a.y$.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}}const O=new WeakMap,I=new WeakMap;class _{constructor(e){this.target=e,this.store=new T,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(e,t)=>{const o=f.getTokenById(t);if(o&&(o.notify(this.target),f.isCSSDesignToken(o))){const t=this.parent,i=this.isReflecting(o);if(t){const r=t.get(o),a=e.get(o);r===a||i?r===a&&i&&this.stopReflectToCSS(o):this.reflectToCSS(o)}else i||this.reflectToCSS(o)}}},O.set(e,this),a.y$.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof n.H?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return O.get(e)||new _(e)}static existsFor(e){return O.has(e)}static findParent(e){if(u!==e.target){let t=(0,s.T)(e.target);for(;null!==t;){if(O.has(t))return O.get(t);t=(0,s.T)(t)}return _.getOrCreate(u)}return null}static findClosestAssignedNode(e,t){let o=t;do{if(o.has(e))return o;o=o.parent?o.parent:o.target!==u?_.getOrCreate(u):null}while(null!==o);return null}get parent(){return I.get(this)||null}has(e){return this.assignedValues.has(e)}get(e){const t=this.store.get(e);if(void 0!==t)return t;const o=this.getRaw(e);return void 0!==o?(this.hydrate(e,o),this.get(e)):void 0}getRaw(e){var t;return this.assignedValues.has(e)?this.assignedValues.get(e):null===(t=_.findClosestAssignedNode(e,this))||void 0===t?void 0:t.getRaw(e)}set(e,t){f.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,t),f.isDerivedDesignTokenValue(t)?this.setupBindingObserver(e,t):this.store.set(e,t)}delete(e){this.assignedValues.delete(e),this.tearDownBindingObserver(e);const t=this.getRaw(e);t?this.hydrate(e,t):this.store.delete(e)}bind(){const e=_.findParent(this);e&&e.appendChild(this);for(const e of this.assignedValues.keys())e.notify(this.target)}unbind(){this.parent&&I.get(this).removeChild(this)}appendChild(e){e.parent&&I.get(e).removeChild(e);const t=this.children.filter((t=>e.contains(t)));I.set(e,this),this.children.push(e),t.forEach((t=>e.appendChild(t))),a.y$.getNotifier(this.store).subscribe(e);for(const[t,o]of this.store.all())e.hydrate(t,this.bindingObservers.has(t)?this.getRaw(t):o)}removeChild(e){const t=this.children.indexOf(e);return-1!==t&&this.children.splice(t,1),a.y$.getNotifier(this.store).unsubscribe(e),e.parent===this&&I.delete(e)}contains(e){return function(e,t){let o=t;for(;null!==o;){if(o===e)return!0;o=(0,s.T)(o)}return!1}(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),_.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),_.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,t){const o=f.getTokenById(t);o&&this.hydrate(o,this.getRaw(o))}hydrate(e,t){if(!this.has(e)){const o=this.bindingObservers.get(e);f.isDerivedDesignTokenValue(t)?o?o.source!==t&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,t)):this.setupBindingObserver(e,t):(o&&this.tearDownBindingObserver(e),this.store.set(e,t))}}setupBindingObserver(e,t){const o=new E(t,e,this);return this.bindingObservers.set(e,o),o}tearDownBindingObserver(e){return!!this.bindingObservers.has(e)&&(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0)}}_.cssCustomPropertyReflector=new class{startReflection(e,t){e.subscribe(this,t),this.handleChange({token:e,target:t})}stopReflection(e,t){e.unsubscribe(this,t),this.remove(e,t)}handleChange(e){const{token:t,target:o}=e;this.add(t,o)}add(e,t){P.getOrCreate(t).setProperty(e.cssCustomProperty,this.resolveCSSValue(_.getOrCreate(t).get(e)))}remove(e,t){P.getOrCreate(t).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&"function"==typeof e.createCSS?e.createCSS():e}},(0,i.gn)([a.LO],_.prototype,"children",void 0);const v=Object.freeze({create:function(e){return f.from(e)},notifyConnection(e){return!(!e.isConnected||!_.existsFor(e)||(_.getOrCreate(e).bind(),0))},notifyDisconnection(e){return!(e.isConnected||!_.existsFor(e)||(_.getOrCreate(e).unbind(),0))},registerRoot(e=u){S.registerRoot(e)},unregisterRoot(e=u){S.unregisterRoot(e)}})},98584:function(e,t,o){function i(e){const t=e.parentElement;if(t)return t;{const t=e.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}o.d(t,{T:function(){return i}})},64865:function(e,t,o){function i(e){return!e||!e.trim()}o.d(t,{TF:function(){return i}})}},t={};function o(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,o),a.exports}o.d=function(e,t){for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e=o(64865),t=o(31656),i=o(57176),r=o(91495),a=o(27689),n=o(60269),s=o(1094),c=o(46557),l=o(83879),u=o(72370),d=o(29247),h=o(90066),p=o(84830),g=o(5144),C=o(39088),S=o(71544),m=o(89366);class A extends m.Z{initializeRuntime(e){}handleMessages(e,t){if("MonitorUserActions"===t)try{"interactive"===document.readyState||"complete"===document.readyState?window.IsProductPageValid(e):window.addEventListener&&window.addEventListener("DOMContentLoaded",(t=>{window.CheckAndIsProductPageValid(e)}))}catch(e){}}getNativeHandler(){return productPageNativeHandler}}const P=new A;let f=function(e){return e.LogScriptTelemetry="LogScriptTelemetry",e.ItemAddedToCart="ItemAddedToCart",e.SetStorageValue="SetStorageValue",e}({});class E{constructor(){(0,u.Z)(this,"traceId",void 0),(0,u.Z)(this,"impressionId",void 0)}static SendMessage(e,t){P.postMessageToHost(e,t)}static SendStorageMessage(e,t){this.SendMessage(f.SetStorageValue,[e,t])}SetTraceId(e){this.traceId=e}SetImpressionId(e){this.impressionId=e}SendItemAddedToCartMessage(){E.SendMessage(f.ItemAddedToCart,[this.traceId,""])}SendLogEventMessage(e,t,o,i){const r={};r.JsonData=JSON.stringify(e),r.EventType=t,r.LogLevel=i,r.Message=o,r.ClientContext=new p.Z(S.Z.GetClientName(),C.MN,S.Z.GetBuildVersion(),S.Z.enabledServiceFlights),this.impressionId&&(r.ImpressionId=this.impressionId);const a=[JSON.stringify(r)];E.SendMessage(f.LogScriptTelemetry,a)}GetCurrentPathName(){return location.pathname}SendProductPageStatusLog(e,t,o){const i={Domain:(0,a.S8)(),PageUrl:(0,a.Ek)(),Status:t};this.SendLogEventMessage(i,o??g.R.ProductPageValidation,e,g.in.Information)}}var T=E;class O{static GetValidatorModule(){return this.validator||(this.validator=new T),this.validator}static GetProductAddService(){return this.productAddService||(this.productAddService=new class{constructor(e){(0,u.Z)(this,"addToCartButtonClass","BGAAListener"),(0,u.Z)(this,"validator",void 0),(0,u.Z)(this,"productPageSelectors",void 0),(0,u.Z)(this,"AddToCartClickHandler",(async()=>{await this.WaitUntilProductIsAdded(),this.validator.SendItemAddedToCartMessage(),this.validator.SendProductPageStatusLog("Product added to cart",f.ItemAddedToCart)})),this.validator=e}async SetUpAddToCartListener(e){this.productPageSelectors=e,await d.ZP.WaitForCondition((async()=>{const t=e.addToCartButtonSelector;return h.Z.HasVisibleElement(t)}),5e3).then((async t=>{let o="product page ";if(o+=t?"valid":"invalid",this.validator.SendProductPageStatusLog(o,t?"true":"false"),e.backgroundAAEnabled){await this.ListenForCartAdditions();const t=document.querySelector(e.addToCartButtonContainer);t&&new MutationObserver((async()=>{await this.ListenForCartAdditions()})).observe(t,{childList:!0,subtree:!0})}})).catch((e=>{this.validator.SendProductPageStatusLog(e?.message??"product page error.","error")}))}async ListenForCartAdditions(){const e=h.Z.GetAllVisibleElements(this.productPageSelectors.addToCartButtonSelector);for(const t of e)t.className.includes(this.addToCartButtonClass)||(t.addEventListener("click",this.AddToCartClickHandler),t.classList?.add(this.addToCartButtonClass))}async WaitUntilProductIsAdded(){const e=this.productPageSelectors.productAddedConfirmationSelector;e?await d.ZP.WaitForCondition((async()=>h.Z.HasVisibleElement(e)),1e4):d.ZP.Sleep(500)}}(this.GetValidatorModule())),this.productAddService}}(0,u.Z)(O,"validator",new T),(0,u.Z)(O,"productAddService",void 0);var I=O;let _=I.GetValidatorModule();async function v(o){_.SetTraceId(o[1]);const a=o[2];a&&t.R.Create(a,"");let u="";try{const t=o[0],a=function(e){if(e){const t=new n.Z;if(e.retailerData&&(t.retailerData=c.Z.Create(e.retailerData)),e.impressionId&&(t.impressionId=e.impressionId),e.coupons){t.coupons=[];for(const o of e.coupons)t.coupons.push(o)}return t}return new n.Z}(JSON.parse(t));if(u=a.impressionId??"",_.SetImpressionId(u),!a.retailerData||a?.coupons?.length>0==0)return!1;const d=s.Z.GetCurrentPathName(),h=a.retailerData.getCurrentProductPage(d);if(!h)return!1;if(o.length>2)try{const t=o[2];if(!(0,e.TF)(t)){const e=JSON.parse(t);r.Q.Create(e),r.Q.setRawStorageObject(e),r.Q.setStorageObjStr(t),l.Z.GetSuggestedCouponService().Init()}}catch(e){R("Error while getting storage data. "+e??"productpage error.")}l.Z.GetSuggestedCouponService().Update(i.s3.ProductPage,a.coupons,h.suggestedCouponElementSelector,h.suggestedCouponRegex,u),a.retailerData.updateCurrentCheckoutPage(a.retailerData.exactCheckoutPageUrl??"");const p=a.retailerData.getCurrentCheckoutPage();return p?!!p?.edgeEnabled&&(I.GetProductAddService().SetUpAddToCartListener(h),!0):(R("Unable to find target checkout page."),!1)}catch(e){return R(e?.message??"productpage error."),!1}}function R(e,t){try{_.SendProductPageStatusLog(e,"error",t)}catch(e){}}window.CheckAndIsProductPageValid=function(e){(0,a.cz)()||v(e)},window.IsProductPageValid=v,window.productPageScriptRuntime=P}()}();

Anon7 - 2021