GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Users/Administrator/AppData/Local/Microsoft/Edge/User Data/Edge Shopping/2.0.7271.0/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /Users/Administrator/AppData/Local/Microsoft/Edge/User Data/Edge Shopping/2.0.7271.0/edge_driver.js
!function(){"use strict";var e={56005:function(e,t,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"timeStamp",void 0),(0,o.Z)(this,"allowed",void 0)}static GetAAConsentStorageKey(e){return"AAConsentData_"+e}}},66933:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"commissionType",void 0),(0,o.Z)(this,"commissionValue",void 0),(0,o.Z)(this,"category",void 0),(0,o.Z)(this,"isRebatesSupportedDomain",void 0),(0,o.Z)(this,"isRebatesUser",void 0),(0,o.Z)(this,"merchantName",void 0),(0,o.Z)(this,"highestCashbackCategory",void 0)}static Create(e){const t=new a;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=a},35062:function(e,t,i){var o=i(72370),a=i(29247),r=i(75383);class n{static Create(e){let t=JSON.parse(atob(e));const i=[],o=new Map,n=t?.[0]?.Group;if(n){let e=n;for(const i of t)if(i){const t=i.Group;if(t&&a.ZP.IsOnPage(i.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&&!o.has(t)&&(i.push(t),o.set(t,new r.Z(e.PageUrl,t,e.checkoutElements)))}return{map:o,array:i}}constructor(e){if((0,o.Z)(this,"DomainName",void 0),(0,o.Z)(this,"AllcheckoutCompletionPages",void 0),(0,o.Z)(this,"AllPageTypeArr",void 0),(0,o.Z)(this,"AllCheckoutCompletionPagesStr",void 0),(0,o.Z)(this,"IsExpressCheckoutEnabled",void 0),(0,o.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:i}=n.Create(t);this.AllcheckoutCompletionPages=e,this.AllPageTypeArr=i}}}}(0,o.Z)(n,"PageTypeArr",[]),t.Z=n},65902:function(e,t,i){var o=i(72370);t.Z=class{constructor(e,t,i,a,r,n,s,c,l,u,d,h,p){(0,o.Z)(this,"Name",void 0),(0,o.Z)(this,"Type",void 0),(0,o.Z)(this,"Value",void 0),(0,o.Z)(this,"IsMandatory",void 0),(0,o.Z)(this,"Format",void 0),(0,o.Z)(this,"WaitForVisible",void 0),(0,o.Z)(this,"WaitForNotDisabled",void 0),(0,o.Z)(this,"WaitBefore",void 0),(0,o.Z)(this,"WaitAfter",void 0),(0,o.Z)(this,"WaitForNotVisible",void 0),(0,o.Z)(this,"NotAlwaysShown",void 0),(0,o.Z)(this,"DynamicFetch",void 0),(0,o.Z)(this,"ShouldValue",void 0),this.Name=e,this.Type=t,this.Value=i,this.IsMandatory=a,this.Format=r,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,i){var o=i(72370),a=i(65902);t.Z=class{constructor(e,t,i){if((0,o.Z)(this,"PageUrl",void 0),(0,o.Z)(this,"Type",void 0),(0,o.Z)(this,"CheckoutElements",void 0),this.PageUrl=e,this.Type=t,this.CheckoutElements=new Map,i)for(const e of i)if(e){const t=e.Name;let i=e.Value;t&&this.CheckoutElements.set(t,new a.Z(t,e.Type,i,e.IsMandatory,e.Format,e.WaitForVisible,e.WaitForNotDisabled,e.WaitBefore,e.WaitAfter,e.WaitForNotVisble,e.NotAlwaysShown,e.DynamicFetch,e.ShouldValue))}}}},41865:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"isOffTheRecord",void 0),(0,o.Z)(this,"buildVersion",void 0)}static Create(e){const t=new a;return t.isOffTheRecord=e?.clientInfo?.isOffTheRecord??void 0,t.buildVersion=e?.clientInfo?.buildVersion,t}}t.Z=a},69886:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"clipCouponSelector",void 0),(0,o.Z)(this,"signedInSelector",void 0),(0,o.Z)(this,"discountSelector",void 0),(0,o.Z)(this,"orderTotalDataElementSelector",void 0),(0,o.Z)(this,"clippedDiscountSelector",void 0),(0,o.Z)(this,"alreadyClippedSelector",void 0),(0,o.Z)(this,"waitForPageLoad",void 0),(0,o.Z)(this,"clickBeforeClipSelector",void 0),(0,o.Z)(this,"promoCodeSelector",void 0),(0,o.Z)(this,"isSalePriceNotDiscount",void 0),(0,o.Z)(this,"isSignInOptional",void 0)}static Create(e){const t=new a;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=a},605:function(e,t,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"attribution",void 0),(0,o.Z)(this,"couponCode",void 0),(0,o.Z)(this,"title",void 0),(0,o.Z)(this,"isLowSuccessRateCoupon",void 0),(0,o.Z)(this,"isStackable",void 0),(0,o.Z)(this,"successRate",void 0),(0,o.Z)(this,"minimumPurchase",void 0),(0,o.Z)(this,"shortHeader",void 0),(0,o.Z)(this,"calculatedCutoffPrice",void 0),(0,o.Z)(this,"discountPercent",void 0),(0,o.Z)(this,"discountValue",void 0),(0,o.Z)(this,"offerUrl",void 0),(0,o.Z)(this,"isPrivateCoupon",void 0),(0,o.Z)(this,"suggestedCouponType",void 0),(0,o.Z)(this,"isBlockedByCart",void 0),(0,o.Z)(this,"providerId",void 0)}}},4238:function(e,t,i){i.d(t,{Z:function(){return a}});var o=i(72370);class a{constructor(e,t,i){(0,o.Z)(this,"ruleName",void 0),(0,o.Z)(this,"maskType",void 0),(0,o.Z)(this,"ruleValue",void 0),this.ruleName=e,this.maskType=t,this.ruleValue=i}}},95457:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"SearchData",void 0),(0,o.Z)(this,"CategoryData",void 0),(0,o.Z)(this,"PdpData",void 0),(0,o.Z)(this,"AddedToCartData",void 0),(0,o.Z)(this,"CustomAutoShowData",void 0),(0,o.Z)(this,"categoryAutoShowCooldownInSeconds",void 0)}static Create(e){let t=new a;if(e)try{const i=atob(e);t=JSON.parse(i)}catch(e){}return t}}t.Z=a},88101:function(e,t,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"name",void 0),(0,o.Z)(this,"supported",void 0),(0,o.Z)(this,"variant",void 0),(0,o.Z)(this,"multipleVariants",void 0)}}},4872:function(e,t,i){i.d(t,{H:function(){return o}});let o=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.domMutationEnabled="msShoppingExp18",e.pdpSelectorExtraction="msShoppingExp19",e.newPriceHistoryGraph="msShoppingExp20",e.disableChatChips="msShoppingExp22",e.snoozeWithOptions="msShoppingExp23",e.searchInPane="msShoppingExp24",e.calculatedCutOffPriceFiltering="msShoppingExp25",e.pcbAddressBar="msShoppingExp29",e.shoppingRClient="msShoppingExp30",e.checkoutSkuCashbackEstimation="msShoppingExp31",e.spbInstantAutoActivate="msShoppingExp33",e.productTracking="msShoppingExp34",e.spbAutoDismissTreatment="msShoppingExp35",e.suggestedCouponEnhancement="msShoppingExp36",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.spbAutoSnoozeTreatment="msShoppingExp48",e.similarOffers="msShoppingExp49",e.alertSettings="msShoppingExp50",e.notificationURLTriggerCheck="msShoppingExp51",e.shorelineinboxcoupons="msShoppingExp52",e.spbPdpCashBack="msShoppingExp53",e.intersperseNativeAds="msShoppingExp54",e.sidepaneCashback="msShoppingExp55",e.spbAutoActivationOnSearch="msShoppingExp56",e.contextualCashback="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.ptIdenticalProducts="msShoppingTestExp9",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.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.productTrackingOmnibox="msEdgeShoppingProductTracking",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.CashbackTabDealDaysOffers="edgeServerUX.shopping.cashbackTabDealDaysOffers",e.CouponsPersonalization="edgeServerUX.shopping.couponsPersonalization",e.BlockingAmazonCoupons="edgeServerUX.shopping.blockingAmazonCoupons",e.DisableSortingCoupons="edgeServerUX.shopping.disableSortingCoupons",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.inProgressTitleV1="edgeServerUX.shopping.inProgressTitleV1",e.inProgressTitleV2="edgeServerUX.shopping.inProgressTitleV2",e.ServerSideSearchInPane="edgeServerUX.shopping.searchInPane",e.campaign="edgeServerUX.shopping.campaign",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.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.travelFUxBigSave="edgeServerUX.shopping.travelFUxBigSave",e.travelFUxSmallNotifNpc="edgeServerUX.shopping.travelFUxSmallNotifNpc",e.travelFUxSmallNotifPc="edgeServerUX.shopping.travelFUxSmallNotifPc",e.travelHUxBnDetail="edgeServerUX.shopping.travelHUxBnDetail",e.travelHUxSnNameImage="edgeServerUX.shopping.travelHUxSnNameImage",e.travelHUxSnMinimal="edgeServerUX.shopping.travelHUxSnMinimal",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.shoppingR="edgeServerUX.shopping.shoppingR",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.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.newCouponStringsT1="edgeServerUX.shopping.newCouponStringsT1",e.newCouponStringsT2="edgeServerUX.shopping.newCouponStringsT2",e.AARewardString="edgeServerUX.shopping.AARewardString",e.cashbackCloseSnooze="edgeServerUX.shopping.cashbackCloseSnooze",e.phCloseSnooze="edgeServerUX.shopping.phCloseSnooze",e.clipCloseSnooze="edgeServerUX.shopping.clipCloseSnooze",e.aaCloseSnooze="edgeServerUX.shopping.aaCloseSnooze",e.useWebComponentCoupon="edgeServerUX.shopping.useWebComponentCoupon",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.pcbStorewideUXDesignChange="edgeServerUX.shopping.pcbStorewideUXDesignChangev3",e.personalizePromotionNewUser="edgeServerUX.shopping.ppNewUser",e.reenableProductBestCoupon="edgeServerUX.shopping.reenableProductBestCoupon",e.reenableProductBestCouponSearchPage="edgeServerUX.shopping.reenableProductBestCouponSearchPage",e.pdpRerank="edgeServerUX.shopping.pdpRerank",e.ptNotifications="edgeServerUX.shopping.ptNotifications",e.improvedCartModelCouponCoverage="edgeServerUX.shopping.improvedCartModelCouponCoverage",e.aaWaitForBlockedCoupons="edgeServerUX.shopping.aaWaitForBlockedCoupons",e.onlyShowAANotificationWithEligibleCoupons="edgeServerUX.shopping.onlyShowAANotificationWithEligibleCoupons",e.delayForAAEligibleCouponsCheck="edgeServerUX.shopping.delayForAAEligibleCouponsCheck",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.closeOnClickAnywhere="edgeServerUX.shopping.closeOnClickAnywhere",e.sendNativePurchaseDetectionSignal="edgeServerUX.shopping.sendNativePurchaseDetectionSignal",e.disableAllFlights="edgeServerUX.shopping.disableAllFlights",e.triggerServiceEnabled="edgeServerUX.shopping.triggerServiceEnabled",e.shorelinerefreshredesign="edgeServerUX.shopping.shorelinerefreshredesign",e.fetchRewardOfferDuringAA="edgeServerUX.shopping.fetchRewardOfferDuringAA",e.disableConfirmationNotifications="edgeServerUX.shopping.disableConfirmationNotifications",e.logAggregatorData="edgeServerUX.shopping.logAggregatorData",e.disablefeed="edgeServerUX.shopping.disablefeed",e.enableLoadingSpinnerLabelsRotation="edgeServerUX.shopping.enableLoadingSpinnerLabelsRotation",e.loadingSpinnerRotationTimeInMS="edgeServerUX.shopping.loadingSpinnerRotationTimeInMS",e.serverSideLocalization="edgeServerUX.shopping.serverSideLocalization",e.couponClippingExpansion="edgeServerUX.shopping.couponClippingExpansion",e.disableZeroSuccessRateCouponShuffling="edgeServerUX.shopping.disableZeroSuccessRateCouponShuffling",e.enableAffiliateActivationStatusUpdate="edgeServerUX.shopping.enableAffiliateActivationStatusUpdate",e.pricehistoryWC="edgeServerUX.shopping.pricehistoryWC",e.autoApplyRewardsOverlay="edgeServerUX.shopping.autoApplyRewardsOverlay",e}({})},31714:function(e,t,i){i.d(t,{Gc:function(){return a},Nm:function(){return r},fG:function(){return c},nV:function(){return o},qG:function(){return s},qw:function(){return l},vr:function(){return n}});let o=function(e){return e.RuleBased="rule",e.ML="ml",e}({}),a=function(e){return e.Micro="mlmicro",e.Limit="mllimit",e}({}),r=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}({}),c=function(e){return e.FindMoreSavingsText="findMoreSavingsTxt",e.FindPersonalizedCouponsText="findPersonalizedCouponsTxt",e}({}),l=function(e){return e.ReturnAlways="ReturnAlways",e.ReturnIfSavingsFound="ReturnIfSavingsFound",e}({})},31656:function(e,t,i){i.d(t,{R:function(){return l}});var o=i(72370),a=i(88101),r=i(4872),n=i(78938),s=i(47594),c=i(64865);const l=new class{constructor(){(0,o.Z)(this,"experiments",new Map),(0,o.Z)(this,"serviceExperiments",new Map),(0,o.Z)(this,"experimentsSet",new Set),(0,o.Z)(this,"serviceExperimentsSet",new Set),(0,o.Z)(this,"enablePCBannerUX",!1),(0,o.Z)(this,"expRawData",void 0),(0,o.Z)(this,"serviceFeatures",void 0),(0,o.Z)(this,"rawEnabledFeatures",void 0),(0,o.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(r.H.disableAllFlights)&&!this.serviceExperimentsSet.has(r.H.disableAllFlights)&&(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,i,o){this.enablePCBannerUX=void 0!==e&&e||void 0!==t&&t&&void 0!==i&&i.CompetingPrices&&i.CompetingPrices.length>0&&void 0!==o&&o}isPCBannerUXExperimentActive(){return(this.experimentsSet.has(r.H.pcBannerUXExperimentation1)||this.experimentsSet.has(r.H.pcBannerUXExperimentation2)||this.experimentsSet.has(r.H.pcBannerUXExperimentation3)||this.experimentsSet.has(r.H.pcBannerUXExperimentation4)||this.experimentsSet.has(r.H.pcBannerUXExperimentation5)||this.experimentsSet.has(r.H.pcBannerUXExperimentation6))&&this.enablePCBannerUX}newFlyoutHeaderActive(){return this.experimentsSet.has(r.H.newHeader)}isVariantActive(e,t){return!!this.isExperimentActive(e)&&this.experiments.get(e)?.variant===t}isMultipleVariantActive(e,t,i){if(this.isExperimentActive(e)){const o=this.experiments.get(e);if(!o)return!1;if(o.variant===i)return!0;if(o.multipleVariants&&o.multipleVariants.length>0&&-1!==o.multipleVariants.findIndex((e=>e.key===t&&e.value===i)))return!0}return!1}getVariantValue(e,t,i){return parseInt(e.find((e=>e.key===t&&("number"==typeof e.value||!(0,c.TF)(e.value))))?.value??i.toString(),void 0)}getVariantStringValue(e,t,i){return e.find((e=>e.key===t&&!(0,c.TF)(e.value)))?.value??i}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 i=new n.Z,o=e[0];"object"==typeof e[1]?(i.value=e[1].value?.toString(),i.params=new Map(Object.entries(e[1].params))):(i.value=e[1],i.params=new Map),"false"!==i.value&&(t.set(o,i),this.serviceExperimentsSet.add(o))})),this.serviceExperiments=t}CreateClientFeatures(e){this.expRawData=e;const t=new Map;if(e&&e.length>0){const i=Object.values(r.H),o=Object.values(s.t);e.forEach((e=>{const r=new a.Z;r.name=e.name,r.supported=!1,e.params?.length>1?r.multipleVariants=e.params:e.params?.length>0&&(r.variant=e.params[0].value),(i.includes(e.name)||o.includes(e.name))&&(1===e.params?.length&&!1===e.params[0]?r.supported=!1:(r.supported=!0,this.experimentsSet.add(e.name))),t.set(r.name,r)}))}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,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"value",void 0),(0,o.Z)(this,"params",void 0)}}},47594:function(e,t,i){i.d(t,{t:function(){return o}});let o=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,i){var o=i(72370);class a{static Now(){return Math.round((new Date).getTime()/1e3)}constructor(e,t){(0,o.Z)(this,"Lifetime",void 0),(0,o.Z)(this,"Timestamp",void 0),this.Lifetime=e,this.Timestamp=t||a.Now()}Expired(){return a.Now()-this.Timestamp>=this.Lifetime}}t.Z=a},22801:function(e,t,i){i.d(t,{Z:function(){return a},e:function(){return r}});var o=i(72370);class a{constructor(e,t,i,a){(0,o.Z)(this,"requestSentTime",void 0),(0,o.Z)(this,"requestReceivedTime",void 0),(0,o.Z)(this,"notificationTriggeredTime",void 0),(0,o.Z)(this,"notificationShownTime",void 0),this.requestSentTime=e,this.requestReceivedTime=t,this.notificationTriggeredTime=i,this.notificationShownTime=a}}const r=-1},36818:function(e,t,i){var o=i(72370),a=i(5144),r=i(58474);class n extends r.Z{constructor(e,t){super(),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"EntryPoint",void 0),(0,o.Z)(this,"AutoApplyResult",void 0),(0,o.Z)(this,"CouponResults",void 0),(0,o.Z)(this,"AutoApplyProcessTime",void 0),(0,o.Z)(this,"BestCoupon",void 0),(0,o.Z)(this,"Discount",void 0),(0,o.Z)(this,"StartingPrice",void 0),(0,o.Z)(this,"ErrorName",void 0),(0,o.Z)(this,"Currency",void 0),(0,o.Z)(this,"PageCurrency",void 0),(0,o.Z)(this,"IsStackable",void 0),(0,o.Z)(this,"AutoApplyScenario",void 0),(0,o.Z)(this,"ExtractedSelectors",void 0),(0,o.Z)(this,"CartExtractionId",void 0),(0,o.Z)(this,"Market",void 0),(0,o.Z)(this,"PageUrl",void 0),(0,o.Z)(this,"Metadata",void 0),this.Domain=e,this.EntryPoint=t??a.N9.Shopping,this.PageUrl=window?.location?.href??""}SetResultData(e,t,i,o,a,r,n,s,c,l,u,d){this.AutoApplyResult=e,this.AutoApplyProcessTime=t,this.BestCoupon=i,this.CouponResults=o,this.Discount=a,this.StartingPrice=r,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,i){var o=i(72370),a=i(58474);class r extends a.Z{constructor(e,t,i,a,r){super(),(0,o.Z)(this,"ButtonClicked",void 0),(0,o.Z)(this,"ModuleId",void 0),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"Metadata",void 0),(0,o.Z)(this,"FlyoutId",void 0),this.ButtonClicked=e,this.ModuleId=t,this.Domain=i,this.Metadata=a,this.FlyoutId=r}}t.Z=r},84830:function(e,t,i){i.d(t,{Z:function(){return c}});var o=i(72370),a=i(4872),r=i(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,i){n.reportedClientContextInfo||(n.SetTag(n.TAGNAME_CLIENTNAME,e),n.SetTag(n.TAGNAME_JSVERSION,t),n.SetTag(n.TAGNAME_EDGEVERSION,i),n.reportedClientContextInfo=!0)}constructor(e){(0,o.Z)(this,"clarityEnabled",!1),(r.R?.isExperimentActive(a.H.clarity)||r.R?.isExperimentActive(a.H.clarityWithCookies))&&(this.clarityEnabled=!0)}async WaitForClarityToLoad(){for(;!window.hasOwnProperty(n.clarityKey);)await new Promise((e=>{setTimeout(e,1e3)}))}}(0,o.Z)(n,"TAGNAME_DOMAIN","domain"),(0,o.Z)(n,"TAGNAME_FLIGHT","flight"),(0,o.Z)(n,"TAGNAME_VIEW","view"),(0,o.Z)(n,"TAGNAME_CLIENTNAME","appinfoclientname"),(0,o.Z)(n,"TAGNAME_JSVERSION","jsversion"),(0,o.Z)(n,"TAGNAME_EDGEVERSION","edgeversion"),(0,o.Z)(n,"clarityKey","clarity"),(0,o.Z)(n,"instance",void 0),(0,o.Z)(n,"reportedClientContextInfo",!1);var s=n,c=class{constructor(e,t,i,a,r,n,c){(0,o.Z)(this,"AppInfoClientName",void 0),(0,o.Z)(this,"JSVersion",void 0),(0,o.Z)(this,"BuildVersion",void 0),(0,o.Z)(this,"EnabledServiceFlights",void 0),(0,o.Z)(this,"MUID",void 0),(0,o.Z)(this,"EnabledServiceFeaturesV2",void 0),(0,o.Z)(this,"Channel",void 0),(0,o.Z)(this,"Enabledfeatures",void 0),this.AppInfoClientName=e,this.JSVersion=t,this.BuildVersion=i,this.EnabledServiceFlights=a,this.EnabledServiceFeaturesV2=r,s.ReportClientInfo(e,t,i),this.Channel=n,this.Enabledfeatures=c}}},80090:function(e,t,i){var o=i(72370),a=i(58474);class r extends a.Z{constructor(e,t,i,a){super(),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"Data",void 0),(0,o.Z)(this,"ErrorType",void 0),(0,o.Z)(this,"StackTrace",void 0),this.Domain=e,this.StackTrace=a,this.Data=JSON.stringify(i),this.ErrorType=t}}t.Z=r},14732:function(e,t,i){i.d(t,{i:function(){return r}});var o=i(72370),a=i(5144);const r=new class{constructor(){(0,o.Z)(this,"appName",void 0),this.appName=a.BN.Edge}SetAppName(e){this.appName=e}GetAppName(){return this.appName}}},12953:function(e,t,i){var o=i(72370),a=i(58474);class r extends a.Z{constructor(e,t,i,a,r,n){super(),(0,o.Z)(this,"CouponCode",void 0),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"Scenario",void 0),(0,o.Z)(this,"PageUrl",void 0),(0,o.Z)(this,"data",void 0),(0,o.Z)(this,"description",void 0),this.CouponCode=e,this.Domain=t,this.Scenario=i,this.PageUrl=a,this.data=r??"",this.description=n}}t.Z=r},59645:function(e,t,i){var o=i(72370),a=i(58474);class r extends a.Z{constructor(e,t,i,a,r){super(),(0,o.Z)(this,"EdgeFlyoutStatus",void 0),(0,o.Z)(this,"ComparableOffersCount",void 0),(0,o.Z)(this,"SavingsAmount",void 0),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"Metadata",void 0),(0,o.Z)(this,"FlyoutId",void 0),this.EdgeFlyoutStatus=e,this.ComparableOffersCount=t,this.SavingsAmount=i,this.Domain=a,this.Metadata=r}}t.Z=r},58474:function(e,t){t.Z=class{ToString(){return JSON.stringify(this)}}},79308:function(e,t,i){var o=i(72370),a=i(58474);class r extends a.Z{constructor(...e){super(...e),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"Savings",void 0),(0,o.Z)(this,"InitialPrice",void 0),(0,o.Z)(this,"Currency",void 0),(0,o.Z)(this,"Result",void 0),(0,o.Z)(this,"PageCurrency",void 0)}SetResultData(e,t,i,o,a,r){this.Domain=e,this.Savings=t??0,this.InitialPrice=i??0,this.Currency=o,this.PageCurrency=a,this.Result=r}}t.Z=r},73765:function(e,t,i){var o=i(72370),a=i(58474);class r extends a.Z{constructor(e,t,i,a,r){super(),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"Scenario",void 0),(0,o.Z)(this,"PageUrl",void 0),(0,o.Z)(this,"event_metadata",void 0),(0,o.Z)(this,"event",void 0),this.Domain=e,this.Scenario=t,this.PageUrl=i,this.event_metadata=r??"",this.event=a}}t.Z=r},82960:function(e,t,i){i.d(t,{v:function(){return a}});var o=i(72370);class a{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,o.Z)(this,"Type",void 0),(0,o.Z)(this,"ID",void 0),this.Type=e,this.ID=""}toString(){return JSON.stringify(this)}}t.Z=a},17204:function(e,t,i){var o=i(72370),a=i(5144),r=i(82960);class n extends r.Z{constructor(e,t,i){super(a.Vm.ErrorResponse),(0,o.Z)(this,"ErrorMsg",void 0),(0,o.Z)(this,"ErrorName",void 0),(0,o.Z)(this,"ErrorPageType",void 0),this.ErrorMsg=e,this.ErrorName=t,this.ErrorPageType=i}}t.Z=n},15612:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"otherSellers",void 0),(0,o.Z)(this,"productImage",void 0),(0,o.Z)(this,"productPrice",void 0),(0,o.Z)(this,"currency",void 0),(0,o.Z)(this,"productUrl",void 0),(0,o.Z)(this,"dataCreationTime",void 0)}static Create(e){const t=new a;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=a},17675:function(e,t,i){i.d(t,{l:function(){return a}});var o=i(72370);class a{}(0,o.Z)(a,"ruleBasedTriggerDataKey","RuleBasedTriggerData"),(0,o.Z)(a,"defaultCouponExpectationWeight",2),(0,o.Z)(a,"positiveEngagementWeight",3),(0,o.Z)(a,"isSpiritedShopperWeight",1),(0,o.Z)(a,"mlWeight",3),(0,o.Z)(a,"defaultPriceDropWeight",2),(0,o.Z)(a,"defaultBestCompetingPriceWeight",2),(0,o.Z)(a,"scoreThreshold",.4),(0,o.Z)(a,"noPreviousUserDataAutoOpenRate",.6),(0,o.Z)(a,"noPreviousUserDataAlwaysOpenCouponExpectation",.5),(0,o.Z)(a,"noPreviousUserDataAlwaysOpenCouponExpectationV0",.2),(0,o.Z)(a,"noPreviousUserDataAlwaysOpenPriceDrop",.2),(0,o.Z)(a,"noPreviousUserDataAlwaysOpenBestCompetingPrice",.2),(0,o.Z)(a,"mlFirstHighConfidenceRange",.3),(0,o.Z)(a,"mlSecondHighConfidenceRange",.7),(0,o.Z)(a,"minEngagementCount",4),(0,o.Z)(a,"minEngagementCountV1",2),(0,o.Z)(a,"engagementScoreThreshold",.5),(0,o.Z)(a,"flyoutReintroduceDays",1)},13018:function(e,t,i){var o=i(72370),a=i(17675);t.Z=class{constructor(e,t,i){(0,o.Z)(this,"userEngagementResults",void 0),(0,o.Z)(this,"couponExpectationWeight",void 0),(0,o.Z)(this,"firstTimeAutoOpenDisabled",void 0),(0,o.Z)(this,"flyoutReintroduceDays",a.l.flyoutReintroduceDays),(0,o.Z)(this,"flyoutReintroduceIsForced",!1),(0,o.Z)(this,"notificationTracker",void 0),this.userEngagementResults=e,this.couponExpectationWeight=t??a.l.defaultCouponExpectationWeight,this.firstTimeAutoOpenDisabled=i}}},12710:function(e,t,i){},99182:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"domainSelector",void 0),(0,o.Z)(this,"productTitleSelector",void 0),(0,o.Z)(this,"productImageSelector",void 0),(0,o.Z)(this,"productLinkSelector",void 0)}static Create(e){const t=new a;return t.domainSelector=e.domainSelector,t.productTitleSelector=e.productTitleSelector,t.productImageSelector=e.productImageSelector,t.productLinkSelector=e.productLinkSelector,t}}t.Z=a},1583:function(e,t,i){i(27689)},81731:function(e,t,i){var o=i(72370);t.Z=class{constructor(e){(0,o.Z)(this,"Timestamp",void 0),(0,o.Z)(this,"ProductId",void 0),(0,o.Z)(this,"Title",void 0),(0,o.Z)(this,"CurrencySymbol",void 0),(0,o.Z)(this,"ProductUrl",void 0),(0,o.Z)(this,"ImageUrl",void 0),(0,o.Z)(this,"CurrentPrice",void 0),(0,o.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,i){var o=i(72370);t.Z=class{constructor(e,t,i){(0,o.Z)(this,"title",void 0),(0,o.Z)(this,"imageUrl",void 0),(0,o.Z)(this,"currency",void 0),(0,o.Z)(this,"extractedImage",void 0),(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"ProductUrl",void 0),(0,o.Z)(this,"base64ProductImage",void 0),(0,o.Z)(this,"triggerPriceHistoryIncreasedAlert",!1),(0,o.Z)(this,"triggerPriceHistoryMinorDropAlert",!1),(0,o.Z)(this,"triggerPriceHistoryStableAlert",!1),(0,o.Z)(this,"originalPrice",void 0),(0,o.Z)(this,"isPriceFromShoreline",!1),this.title=e,this.imageUrl=t,this.currency=i}}},40843:function(e,t,i){var o=i(72370),a=i(19384),r=i(17609);t.Z=class{constructor(e){if((0,o.Z)(this,"trackedProducts",[]),(0,o.Z)(this,"_anid",void 0),(0,o.Z)(this,"_muid",void 0),(0,o.Z)(this,"_currentProduct",void 0),(0,o.Z)(this,"_abandonedCartNotificationToggle",void 0),(0,o.Z)(this,"timestamp",void 0),(0,o.Z)(this,"isUnsupportedDomain",void 0),(0,o.Z)(this,"trackingPreferences",void 0),e){this.trackingPreferences=new r.Z(e.trackingPreferences),this.isUnsupportedDomain=e.isUnsupportedDomain;for(const t of e.trackedProducts){const e=new a.ZP(t);e.Title&&e.ProductUrl&&this.trackedProducts.push(e)}}}}},19384:function(e,t,i){i.d(t,{ZP:function(){return s}});var o=i(72370),a=i(81731);let r=function(e){return e.AbandonedCart="AbandonedCart",e.Explicit="Explicit",e.PostPurchase="PostPurchase",e}({});class n extends a.Z{constructor(e){super(e),(0,o.Z)(this,"basePrice",void 0),(0,o.Z)(this,"notificationEnabled",!1),(0,o.Z)(this,"notificationPercentageDrop",void 0),(0,o.Z)(this,"lastNotifiedAt",void 0),(0,o.Z)(this,"expirationDate",void 0),(0,o.Z)(this,"trackingType",void 0),(0,o.Z)(this,"metadata",void 0),(0,o.Z)(this,"imageUrl",void 0),(0,o.Z)(this,"durationInWeeks",void 0),(0,o.Z)(this,"trackingSource",r.Explicit),(0,o.Z)(this,"notifyForIdenticalProduct",!1),(0,o.Z)(this,"domain",void 0),(0,o.Z)(this,"identicalProductNotification",void 0),(0,o.Z)(this,"highSuccessRateCoupon",void 0),(0,o.Z)(this,"cashbackCommission",void 0),(0,o.Z)(this,"sellerName",void 0),(0,o.Z)(this,"lastPriceUpdateDate",void 0),(0,o.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),this.domain=e?.domain,this.highSuccessRateCoupon=e?.highSuccessRateCoupon?new class{constructor(e){(0,o.Z)(this,"couponCode",void 0),(0,o.Z)(this,"successRate",void 0),(0,o.Z)(this,"discountRate",void 0),(0,o.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,o.Z)(this,"domain",void 0),(0,o.Z)(this,"type",void 0),(0,o.Z)(this,"value",void 0),(0,o.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?.lastNotificationEnabledDate,this.notifyForIdenticalProduct=e?.notifyForIdenticalProduct??!1,this.identicalProductNotification=new class{constructor(e){(0,o.Z)(this,"url",void 0),(0,o.Z)(this,"productId",void 0),(0,o.Z)(this,"domain",void 0),(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"globalOfferId",void 0),(0,o.Z)(this,"trackingUrl",void 0),(0,o.Z)(this,"imageUrl",void 0),(0,o.Z)(this,"sellerName",void 0),(0,o.Z)(this,"type",void 0),(0,o.Z)(this,"currency",void 0),(0,o.Z)(this,"lastUpdatedAt",void 0),(0,o.Z)(this,"rebateValue",void 0),(0,o.Z)(this,"impressionToken",void 0),(0,o.Z)(this,"visibilityFeedbackUrl",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,this.imageUrl=e?.imageUrl,this.sellerName=e?.sellerName,this.type=e?.type,this.currency=e?.currency,this.lastUpdatedAt=e?.lastUpdatedAt,this.rebateValue=e?.rebateValue,this.impressionToken=e?.impressionToken,this.visibilityFeedbackUrl=e?.visibilityFeedbackUrl}}(e?.identicalProductNotification)}}var s=n},17609:function(e,t,i){var o=i(72370);t.Z=class{constructor(e){(0,o.Z)(this,"abandonedCartTrackingEnabled",void 0),(0,o.Z)(this,"lastUpdatedAt",void 0),(0,o.Z)(this,"IsAnidTrackingConsented",void 0),(0,o.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,i){i.d(t,{Z:function(){return n}});var o=i(72370),a=i(45822),r=i(5144);class n{constructor(e){(0,o.Z)(this,"fragmentCollection",void 0),(0,o.Z)(this,"piiExtraction",void 0),(0,o.Z)(this,"transactionIdSettings",void 0),(0,o.Z)(this,"isDisableProductNamesCollectionOnConfirmation",void 0),(0,o.Z)(this,"isDisablePurchaseTotalCollectionOnConfirmation",void 0),(0,o.Z)(this,"other",{}),(0,o.Z)(this,"selectorTimeouts",void 0),(0,o.Z)(this,"selectorTimeoutsConfirmation",void 0),e&&(this.other=e.other??{},this.fragmentCollection=e.fragmentCollection,this.piiExtraction=e.piiExtraction,this.transactionIdSettings=e.transactionIdSettings,this.selectorTimeouts=e.selectorTimeouts,this.selectorTimeoutsConfirmation=e.selectorTimeoutsConfirmation,this.isDisableProductNamesCollectionOnConfirmation=e.isDisableProductNamesCollectionOnConfirmation,this.isDisablePurchaseTotalCollectionOnConfirmation=e.isDisablePurchaseTotalCollectionOnConfirmation)}getSelectorTimeouts(e){return e===r.GV.ConfirmationPage?this.selectorTimeoutsConfirmation:this.selectorTimeouts}GetOtherFeatureFlag(e,t=!1){if(!this.other||!this.other[e])return t;const i=this.other[e];return"True"===i||"true"===i}IsAttibutionEnabled(){return this.GetOtherFeatureFlag("isEdgeAttributionEnabled")}GetFragmentCollectionTimeout(e){const t=this.fragmentCollection?.collectionRates;if(!t)return 0;const i=this.GetRatesForPageType(e,t);if(this.IsValidRate(i?.collectionTimeoutMs))return i?.collectionTimeoutMs??0;const o=t.allPages;return this.IsValidRate(o?.collectionTimeoutMs)?o?.collectionTimeoutMs??0:0}GetCollectionRate(e,t,i){const o=i?this.getDefaultExtractionIfBroken()??0:0;if(!this.fragmentCollection?.isEnabled)return o;const a=this.fragmentCollection?.collectionRates;if(!a)return o;if(this.IsDisableCollectionOnPage(a,e))return o;const r=this.GetRateFromObject(e,this.GetRatesForPageType(t,a),i);if(this.IsValidRate(r))return r??o;const n=this.GetRateFromObject(e,a.allPages,i);return this.IsValidRate(n)?n??o:o}IsDisableCollectionOnPage(e,t){return!!t&&!!(e.disableCollectionPages&&e.disableCollectionPages.length>0&&this.FindRegexMatch(t,e.disableCollectionPages))}getDefaultExtractionIfBroken(){return this.other?.defaultExtractionIfBroken?this.ToValidRate(this.other?.defaultExtractionIfBroken):void 0}GetRateFromObject(e,t,i){if(t){if(i)return this.IsValidRate(t.extractionIfBroken)?t.extractionIfBroken:this.getDefaultExtractionIfBroken();if(t.extractionForRegex&&e){const i=this.FindRateFromRegexMatch(e,t.extractionForRegex);if(this.IsValidRate(i))return i}return this.IsValidRate(t.defaultExtraction)?t.defaultExtraction:void 0}}FindRegexMatch(e,t){for(const i of t)if((0,a.io)(e,i).isMatch)return i}FindRateFromRegexMatch(e,t){for(const i of Object.keys(t))if((0,a.io)(e,i).isMatch)return t[i]??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 r.GV.ConfirmationPage:return t.confirmationPage;case r.GV.CheckoutPage:return t.checkoutPage;case r.GV.UnknownPage:return t.unknownPage;case r.GV.ProductPage:return t.productPage;case r.GV.SearchPage:return t.searchPage;case r.GV.HomePage:return t.homePage;default:return t.otherPages}}}},59352:function(e,t,i){i.d(t,{b:function(){return o}});let o=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,i){var o=i(72370);t.Z=class{constructor(e){(0,o.Z)(this,"EventInfoTime",void 0),(0,o.Z)(this,"EventInfoName",void 0),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"BestCoupon",void 0),(0,o.Z)(this,"CashbackCategory",void 0),(0,o.Z)(this,"StartingPrice",void 0),(0,o.Z)(this,"CashbackSavings",void 0),(0,o.Z)(this,"Discount",void 0),(0,o.Z)(this,"AutoApplyScenario",void 0),(0,o.Z)(this,"AutoApplyProcessTime",void 0),(0,o.Z)(this,"ImpressionId",void 0),(0,o.Z)(this,"JSVersion",void 0),(0,o.Z)(this,"BuildVersion",void 0),(0,o.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,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"descriptionSelector",void 0),(0,o.Z)(this,"profileImageSelector",void 0),(0,o.Z)(this,"influencerInfoSelector",void 0),(0,o.Z)(this,"influencerIdSelector",void 0),(0,o.Z)(this,"influencerFollowers",void 0)}static Create(e){const t=new a;return t.descriptionSelector=e.descriptionSelector,t.profileImageSelector=e.profileImageSelector,t.influencerInfoSelector=e.influencerInfoSelector,t.influencerIdSelector=e.influencerIdSelector,t.influencerFollowers=e.influencerFollowers,t}}t.Z=a},57176:function(e,t,i){i.d(t,{s3:function(){return r},x6:function(){return n}});var o=i(72370),a=i(605);let r=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 a.Z{constructor(...e){super(...e),(0,o.Z)(this,"source",void 0),(0,o.Z)(this,"extraction",void 0),(0,o.Z)(this,"timestamp",void 0),(0,o.Z)(this,"numberOfFails",void 0)}}t.ZP=s},71951:function(e,t,i){i.d(t,{M4:function(){return o},y$:function(){return a}});let o=function(e){return e.ActionDetected="Detected",e.ActionReported="Reported",e}({}),a=function(e){return e.autoApplyStorageKey="ICAutoApplyCoupons",e.completedPurchaseStorageKey="ICCompletedPurchase",e}({})},5144:function(e,t,i){i.d(t,{$S:function(){return n},$o:function(){return f},AM:function(){return U},BN:function(){return m},E_:function(){return w},G7:function(){return k},GV:function(){return l},HC:function(){return h},KE:function(){return A},Kg:function(){return d},M_:function(){return N},N9:function(){return D},PK:function(){return S},R:function(){return r},Sl:function(){return b},UA:function(){return g},Vm:function(){return p},X4:function(){return E},YQ:function(){return x},ZT:function(){return O},Zd:function(){return v},aK:function(){return I},in:function(){return a},k2:function(){return o},oN:function(){return _},og:function(){return C},ps:function(){return c},qR:function(){return y},sj:function(){return T},u3:function(){return u},xu:function(){return s},zS:function(){return P},zy:function(){return R}});let o=function(e){return e[e.Domains=0]="Domains",e[e.Deals=1]="Deals",e[e.Popup=2]="Popup",e[e.Overlay=3]="Overlay",e[e.BaseUXUrl=4]="BaseUXUrl",e[e.EventLogUrl=5]="EventLogUrl",e[e.PriceComparison=6]="PriceComparison",e[e.PriceNotification=7]="PriceNotification",e[e.ImageResize=8]="ImageResize",e[e.EdgeMobileOverlay=9]="EdgeMobileOverlay",e[e.ECOverlay=10]="ECOverlay",e[e.ProductInfo=12]="ProductInfo",e}({}),a=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.Reliability="Reliability",e.AggregatorProduct="AggregatorProduct",e}({}),n=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.SeeAllPrintableCoupons="SeeAllPrintableCoupons",e.SeeMoreItemizedCashback="SeeMoreItemizedCashback",e.SeeAllTrendingDeals="SeeAllTrendingDeals",e.SeeMoreOffers="SeeMoreOffers",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.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.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.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.UnifiedCashBackShorelineBtnClick="UnifiedCashBackShorelineBtnClick",e.UnifiedCashBackNotificationBtnClick="UnifiedCashBackNotificationBtnClick",e.ZeroStateExploreDeals="ZeroStateExploreDeals",e.OmniboxCashbackActivationClick="OmniboxCashbackActivationClick",e}({}),s=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.FlyoutDiscoverPriceHistoryTrigger="FlyoutDiscoverPriceHistoryTrigger",e.FlyoutDismissedPriceHistoryTrigger="FlyoutDismissedPriceHistoryTrigger",e.AutoOpenUsingUrlParam="AutoOpenUsingUrlParam",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.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.CashbackDataFetchError="CashbackDataFetchError",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.CashbackTabRendered="CashbackTabRendered",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.CouponClippingTitle="CouponClippingTitle",e.AutoOpenSuppressed="AutoOpenSuppressed",e.CouponClippingSelectorsAvailable="CouponClippingSelectorsAvailable",e.FlyoutDataRecieved="FlyoutDataRecieved",e.PersonalizedDataPresentButNotReferred="PersonalizedDataPresentButNotReferred",e.UnifiedCashBackShorelineModule="UnifiedCashBackShorelineModule",e.UnifiedCashBackNotificationModule="UnifiedCashBackNotificationModule",e.UnifiedCashBackShorelineBtnClick="UnifiedCashBackShorelineBtnClick",e.UnifiedCashBackNotificationBtnClick="UnifiedCashBackNotificationBtnClick",e.UnifiedCashBackNotificationLatency="UnifiedCashBackNotificationLatency",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.PDPUpdateDiscarded="PDPUpdateDiscarded",e.PriceMismatch="PriceMismatch",e.ShoppingRewardsFlyoutNoShow="ShoppingRewardsFlyoutNoShow",e.ShoppingRewardsFlyoutShow="ShoppingRewardsFlyoutShow",e.RefreshError="RefreshError",e.PaneAutoOpened="PaneAutoOpened",e.AOPUserEngagement="AOPUserEngagement",e.AOPUserDsat="AOPUserDsat",e.PaneLoadingStateRendered="PaneLoadingStateRendered",e.PaneLoadingStateRemoved="PaneLoadingStateRemoved",e.PaneLoadingSpinnerRendered="PaneLoadingSpinnerRendered",e.PaneLoadingSpinnerRemoved="PaneLoadingSpinnerRemoved",e.ReliabilityMetricError="ReliabilityMetricError",e.FlyoutOpened="FlyoutOpened",e.BundlesLoaded="BundlesLoaded",e}({}),c=function(e){return e.Error="Error",e.Negative="Negative",e.Positive="Positive",e.Cancelled="Cancelled",e.InProgress="InProgress",e}({}),l=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.NoInputCheckoutPage="NoInputCheckoutPage",e}({}),u=function(e){return e.Cart="Cart",e.Checkout="Checkout",e.PurchaseConfirmed="PurchaseConfirmed",e.CancellationRequest="CancellationRequest",e.CancellationConfirmed="CancellationConfirmed",e}({}),d=function(e){return e.Error="Error",e.Negative="Negative",e.Positive="Positive",e}({}),h=function(e){return e.Valid="Valid",e.NotApplicable="NotApplicable",e.LowSuccess="LowSuccess",e.MinPurchaseNotMet="MinPurchaseNotMet",e.CalculatedCutOffPriceNotMet="CalculatedCutOffPriceNotMet",e.WorseDiscountPercent="WorseDiscountPercent",e.WorseDiscountValue="WorseDiscountValue",e.SuggestedCouponSuccesfullyApplied="SuggestedCouponSuccesfullyApplied",e.BlockedByCart="BlockedByCart",e}({}),p=function(e){return e[e.ApplyCouponsMessage=1]="ApplyCouponsMessage",e[e.AutoApplyCompletedMessage=2]="AutoApplyCompletedMessage",e[e.CheckoutPageMessage=3]="CheckoutPageMessage",e[e.CloseOverlayMessage=4]="CloseOverlayMessage",e[e.ClosedPopupMessage=5]="ClosedPopupMessage",e[e.CountElementsResponse=6]="CountElementsResponse",e[e.CreateOverlayMessage=7]="CreateOverlayMessage",e[e.CreatePopupMessage=8]="CreatePopupMessage",e[e.CreatePriceComparisonMessage=9]="CreatePriceComparisonMessage",e[e.EdgeApplyCouponsMessage=10]="EdgeApplyCouponsMessage",e[e.EmptyResponse=11]="EmptyResponse",e[e.ErrorResponse=12]="ErrorResponse",e[e.GetCompetingPricesMessage=13]="GetCompetingPricesMessage",e[e.GetCompetingPricesResponse=14]="GetCompetingPricesResponse",e[e.GetTextValueResponse=15]="GetTextValueResponse",e[e.GetUIStateMessage=16]="GetUIStateMessage",e[e.GetUIStateResponse=17]="GetUIStateResponse",e[e.MoveProgressBarMessage=18]="MoveProgressBarMessage",e[e.ShowResultMessage=19]="ShowResultMessage",e[e.TelemetryMessage=20]="TelemetryMessage",e[e.UpdateCurrentCouponMessage=21]="UpdateCurrentCouponMessage",e[e.OpalMessage=22]="OpalMessage",e[e.ProductPageMessage=23]="ProductPageMessage",e[e.ProductPageResponse=24]="ProductPageResponse",e[e.EdgeCreateOverlayMessage=25]="EdgeCreateOverlayMessage",e[e.EdgeShowResultMessage=26]="EdgeShowResultMessage",e[e.VerifySelectorsMessage=27]="VerifySelectorsMessage",e[e.VerifySelectorsResponse=28]="VerifySelectorsResponse",e[e.AutoApplyCancelledMessage=29]="AutoApplyCancelledMessage",e[e.ContentInitMessage=30]="ContentInitMessage",e[e.ClearDataMessage=31]="ClearDataMessage",e[e.DOMMutationMessage=32]="DOMMutationMessage",e[e.UpdateCurrencyMessage=33]="UpdateCurrencyMessage",e[e.CheckoutProgressMessage=34]="CheckoutProgressMessage",e[e.ECCreateOverlayMessage=35]="ECCreateOverlayMessage",e[e.ECShowResultMessage=36]="ECShowResultMessage",e[e.ECFieldErrorMessage=37]="ECFieldErrorMessage",e[e.ECCreateUpdatePaymentOverlayMessage=38]="ECCreateUpdatePaymentOverlayMessage",e[e.PrintableGroceryCouponsMessage=39]="PrintableGroceryCouponsMessage",e[e.WalletDrawerCreateOverlayMessage=40]="WalletDrawerCreateOverlayMessage",e[e.WalletDrawerCloseMessage=41]="WalletDrawerCloseMessage",e[e.BackgroundAutoApplyCancelledMessage=42]="BackgroundAutoApplyCancelledMessage",e[e.GetCheckedValueResponse=43]="GetCheckedValueResponse",e[e.SelectorSuccessResponse=44]="SelectorSuccessResponse",e[e.SelectorExtractionMessage=45]="SelectorExtractionMessage",e[e.SelectorExtractionResponse=46]="SelectorExtractionResponse",e[e.GetFieldValueResponse=48]="GetFieldValueResponse",e[e.UserAgreementStatusMessage=50]="UserAgreementStatusMessage",e[e.GetTabDataFromBackgroundMessage=51]="GetTabDataFromBackgroundMessage",e[e.GetTabDataFromBackgroundResponse=52]="GetTabDataFromBackgroundResponse",e[e.GetFileContentFromResourcesMessage=53]="GetFileContentFromResourcesMessage",e[e.GetFileContentFromResourcesResponse=54]="GetFileContentFromResourcesResponse",e[e.AutoApplyNotificationSafariMessage=55]="AutoApplyNotificationSafariMessage",e[e.InstantAddToCartMessage=56]="InstantAddToCartMessage",e[e.SetStorageValueMessage=57]="SetStorageValueMessage",e[e.GetStorageValueMessage=58]="GetStorageValueMessage",e[e.GetStorageValueResponse=59]="GetStorageValueResponse",e[e.CouponsClippingNotificationSafariMessage=60]="CouponsClippingNotificationSafariMessage",e[e.RunQuerySelectorAllOnBodyMessage=61]="RunQuerySelectorAllOnBodyMessage",e[e.RunQuerySelectorAllOnBodyResponse=62]="RunQuerySelectorAllOnBodyResponse",e[e.BackgroundExecuteCouponsClippingMessage=63]="BackgroundExecuteCouponsClippingMessage",e[e.ContentExecuteCouponsClippingMessage=64]="ContentExecuteCouponsClippingMessage",e[e.ContentExecuteCouponsClippingResponse=65]="ContentExecuteCouponsClippingResponse",e[e.WalletDrawerSkipCouponMessage=66]="WalletDrawerSkipCouponMessage",e[e.GetSafariLatestVersion=67]="GetSafariLatestVersion",e[e.GetSafariLatestVersionResponse=68]="GetSafariLatestVersionResponse",e[e.SuccessInstantAddToCartMessage=69]="SuccessInstantAddToCartMessage",e[e.RenderSafariTagInDomMessage=70]="RenderSafariTagInDomMessage",e[e.DomFlyoutMessage=71]="DomFlyoutMessage",e[e.GetCouponStatusMessagesResponse=72]="GetCouponStatusMessagesResponse",e[e.UpdateRewardsData=73]="UpdateRewardsData",e}({}),g=function(e){return e[e.PlainString=0]="PlainString",e[e.JsonString=1]="JsonString",e}({}),C=function(e){return e[e.FromBackground=1]="FromBackground",e[e.FromContent=2]="FromContent",e}({}),S=function(e){return e.HandleBackgroundMessage="HandleBackgroundMessage",e.HandleContentMessage="HandleContentMessage",e}({}),m=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}({}),A=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}({}),f=function(e){return e.ProductPageBackgroundAutoApply="ProductPageBackgroundAutoApply",e.BackgroundAutoApply="BackgroundAutoApply",e.BackgroundAutoApplyBestCoupon="BackgroundAutoApplyBestCoupon",e.ForegroundAutoApply="ForegroundAutoApply",e}({});const v="autoApplyRuntime",E="handleBNPLResult",P="getExpressCheckoutPageGMV";let I=function(e){return e.VALIDATION_ERROR="VALIDATION_ERROR",e.SERVER_ERROR="SERVER_ERROR",e}({}),T=function(e){return e.AMEX="Amex",e.DISCOVER="Discover",e.MASTERCARD="Mastercard",e.VISA="Visa",e.ZIP="Zip",e}({}),O=function(e){return e.Ebay="ebay",e}({}),y=function(e){return e.ExpressCheckout="ExpressCheckout",e.ECWithBNPL="ECWithBNPL",e.ECWithoutPayment="ECWithoutPayment",e}({}),D=function(e){return e.Wallet="Wallet",e.Shopping="Shopping",e}({}),b=function(e){return e.AutoApplyTransactionsKey="ListOfAutoApplyTransactions",e.CouponClippingTransactionsKey="ListOfCouponClippingTransactions",e.CashbackTransactionsKey="ListOfCashbackTransactions",e}({}),N=function(e){return e.UserCouponFailed="UserCouponFailed",e.BetterInitialPrice="BetterInitialPrice",e.CouponNotInOurCorpus="CouponNotInOurCorpus",e.ManuallyAppliedCouponNotInOurCorpus="ManuallyAppliedCouponNotInOurCorpus",e.SuggestedCoupon="SuggestedCoupon",e.SuppressedSuggestedCoupons="SuppressedSuggestedCoupons",e}({}),R=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}({}),_=function(e){return e.AARewards="AARewards",e}({}),k=function(e){return e.Flyout="Flyout",e.Validator="Validator",e.Driver="Driver",e.Controller="Controller",e}({}),w=function(e){return e.Bing="Bing",e.Edge="Edge",e}({}),x=function(e){return e.LostUsers="Lost User Preference Override",e.LostUsersControl="Lost User Preference Override - Control Log",e}({}),U=function(e){return e.lostUsers="blocked but recovered",e.lostUsersRegular="Eligible for recovering",e}({})},56019:function(e,t,i){i.d(t,{x:function(){return o}});let o=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,i){i.d(t,{V:function(){return a}});var o=i(72370);class a{constructor(){(0,o.Z)(this,"discount",void 0),(0,o.Z)(this,"initialPrice",void 0)}}},93078:function(e,t,i){i.d(t,{v:function(){return o}});let o=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,i){i.d(t,{p:function(){return o}});let o=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.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,i){i.d(t,{Q:function(){return o},_:function(){return a}});let o=function(e){return e.UserId="userId",e.ActiveUrl="activeUrl",e.LocalizedStrings="LocalizedStrings",e.ClientName="ClientName",e.ImportOptions="ImportOptions",e.Icon="Icon",e.AppName="AppName",e.CashBackActive="CashBackActive",e.NudgeTips="NudgeTips",e.CheckoutUserData="CheckoutUserData",e.CheckoutElementsData="CheckoutElementsData",e.ExpressCheckoutState="ExpressCheckoutState",e.BackgroundAutoApply="BackgroundAutoApply",e.ForegroundAutoApply="ForegroundAutoApply",e.FallBackAutoApply="FallBackAutoApply",e.ProductPageBackgroundAutoApply="ProductPageBackgroundAutoApply",e.ApiResponse="ApiResponse",e.UseWalletDrawer="UseWalletDrawer",e.ExpressCheckoutGMVData="ExpressCheckoutGMVData",e.BackgroundAutoApplyState="BackgroundAutoApplyState",e.AutoOpenData="AutoOpenData",e.LastCleanedData="LastCleanedData",e.DynamicSelectors="DynamicSelectors",e.EstimatedCashback="EstimatedCashback",e.CashbackAmount="CashbackAmount",e.Experiments="Experiments",e.ImpressionId="ImpressionId",e.CashbackShouldStandDown="CashbackShouldStandDown",e.WalletDrawerShouldSkipCoupon="WalletDrawerShouldSkipCoupon",e.InboxCouponsHashedUserId="InboxCouponsHashedUserId",e.InboxCouponsUserHashedEmail="InboxCouponsUserHashedEmail",e.CashBackOfferDetailsVisible="CashBackOfferDetailsVisible",e.AAEarlyReturnVariant="AAEarlyReturnVariant",e.BestCouponBackgroundAutoApply="BestCouponBackgroundAutoApply",e.DelayedCashbackActivatedDomains="DelayedCashbackActivatedDomains",e.OtherSellersAddedToCartDataKey="OtherSellersAddedToCartData",e.HasVisitedCashbackTab="HasVisitedCashbackTab",e.LastRedeemableBalance="LastRedeemableBalance",e.OmniboxCooldownHistory="OmniboxCooldownHistory",e}({}),a=function(e){return e.StopRefreshTimeout="StopRefreshTimeout",e.InboxCouponsUpsellOpen="inboxCouponsUpsellOpen",e}({})},93608:function(e,t,i){i.d(t,{d:function(){return o}});let o=function(e){return e.NotSuggestedCoupon="NotSuggestedCoupon",e.NewSuggestedCoupon="NewSuggestedCoupon",e.ExistingSuggestedCoupon="ExistingSuggestedCoupon",e}({})},39088:function(e,t,i){i.d(t,{HQ:function(){return s},Kr:function(){return r},QY:function(){return o},W1:function(){return a},yJ:function(){return n}});const o="2.381",a="2.387",r="3.542",n="3.021",s="1.637"},21488:function(e,t,i){var o=i(72370),a=i(29247);class r{constructor(){(0,o.Z)(this,"isPersonalizationDataConsentEnabled",void 0),(0,o.Z)(this,"isPersonalizationDataConsentChanged",void 0),(0,o.Z)(this,"isAnonymousFlowEnabled",void 0),(0,o.Z)(this,"isBingSignedInUser",void 0),(0,o.Z)(this,"isMSASignedIn",void 0),(0,o.Z)(this,"isSSOEnabled",void 0),(0,o.Z)(this,"isRebatesUser",void 0),(0,o.Z)(this,"ageGroup",void 0),(0,o.Z)(this,"anonymousUserId",""),(0,o.Z)(this,"isAadEmailPresent",!1),(0,o.Z)(this,"isAADSignedIn",void 0),(0,o.Z)(this,"isMarketingCampaignEventEnrolled",void 0),(0,o.Z)(this,"isCashbackPlatformAcknowledged",void 0),(0,o.Z)(this,"isAADLinkedAccountValid",void 0),(0,o.Z)(this,"isLinkingPolicyEnabled",void 0),(0,o.Z)(this,"hanid",void 0)}static Create(e,t,i,o,n){const s=new r;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=!!i,s.isAADSignedIn=e?.userInfo?.isAADSignedIn??!1,s.isMarketingCampaignEventEnrolled=e?.promotionalCampaignDealsResponse?.isEnrolled,s.isCashbackPlatformAcknowledged=e?.promotionalCampaignDealsResponse?.isCashbackPlatformAcknowledged,s.isAADLinkedAccountValid=a.ZP.parseBool(o)||e?.userInfo?.isAADLinkedAccountValid||!1,s.isLinkingPolicyEnabled=a.ZP.parseBool(n),s.hanid=e?.userInfo?.hanid??"",s}}t.Z=r},3634:function(e,t,i){i.d(t,{$S:function(){return l},IS:function(){return r},LJ:function(){return h},P5:function(){return d},PK:function(){return m},RY:function(){return n},T2:function(){return g},Z3:function(){return s},eS:function(){return p},fU:function(){return C},jb:function(){return a},js:function(){return c},kH:function(){return A},m7:function(){return u},oL:function(){return f},uv:function(){return S}});var o=i(5144);const a=[o.BN.EdgeMobile,o.BN.EdgeAndroid,o.BN.EdgeiOS],r=[o.BN.Edge,...a],n=new Set(["amazon.com","amazon.ca","amazon.co.uk","amazon.co.jp","alibaba.com"]),s=new Map(Object.entries({"etsy.com":"receipt_id","target.com":"referenceId","tmall.com":"bizOrderId"})),c="GET_ORDER_ID_FROM_URL",l="GET_TRANSACTION_ID_FROM_URL",u="GET_TRANSACTION_ID_FROM_PATH_URL",d="<TRANSACTION_ID>",h=216e5,p="microsoft exclusive offer",g="lateAutoOpenEvent",C="spbCartResponseEvent",S="COMPONENT_TO_FOCUS_IN_SHORELINE",m={"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"}},A=Object.keys(m),f="consented"},21597:function(e,t,i){i.d(t,{$R:function(){return r},aE:function(){return a}});var o=i(72370);let a=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}({}),r=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,o.Z)(this,"blockedList",void 0),(0,o.Z)(this,"paths",void 0),this.blockedList=[],this.paths=new Map}}},87720:function(e,t,i){i.d(t,{Gr:function(){return r},Q5:function(){return a},Sk:function(){return s},Zs:function(){return u},cv:function(){return n},n1:function(){return c},z0:function(){return l}});var o=i(72370);const a="AutoOpenData",r="LastCleanedData",n="AutoOpenPrefData",s="AutoOpenDomainPrefData",c="LastShownData",l="StageAndCategoryLastShown",u=1728e5;t.ZP=class{constructor(){(0,o.Z)(this,"popupOrigination",void 0),(0,o.Z)(this,"timeLastAutoOpen",void 0),(0,o.Z)(this,"snoozeTime",void 0),(0,o.Z)(this,"blockedForSite",void 0),(0,o.Z)(this,"lostUserReblockedTime",void 0)}}},3141:function(e,t,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"blockedListPath",void 0)}}},35386:function(e,t,i){i.d(t,{v:function(){return o}});let o=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,i){i.d(t,{h:function(){return o}});let o=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,i){i.d(t,{FA:function(){return c},M$:function(){return l},ModuleNames:function(){return n},Te:function(){return a},iM:function(){return r},sM:function(){return s},zE:function(){return o}});let o=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}({}),a=function(e){return e.Mouse="mouse",e.Keyboard="keyboard",e.Auto="auto",e.Banner="banner",e.Hover="hover",e}({}),r=function(e){return e.currency="placeholderCurrency",e}({}),n=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.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.INFINITE_CATEGORY_FEED="INFINITE_CATEGORY_FEED",e.PRODUCT_COLLECTIONS="PRODUCT_COLLECTIONS",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.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.Zero_State="Zero_State",e.CONTEXTUAL_CASHBACK="CONTEXTUAL_CASHBACK",e}({}),s=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.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}({}),c=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}({}),l=function(e){return e.CARD="card",e.ZIP="zipPay",e.AFFIRM="affirm",e.KLARNA="klarna",e}({})},73557:function(e,t,i){i.d(t,{Ke:function(){return a},sR:function(){return o}});let o=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_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}({}),a=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,i){i.d(t,{VS:function(){return r},_N:function(){return s},fk:function(){return n},hB:function(){return o},qx:function(){return a}});let o=function(e){return e.Storewide="Storewide",e.PCBStorewide="PCBStorewide",e.SPBSearchCashback="SPBSearchCashback",e.SPBPDPCashback="SpbPdpCashback",e.StorewideCashbackPinterest="StorewideCashbackPinterest",e.SPBorPPCashback="SPBorPPCashback",e}({}),a=function(e){return e.NonRebateUser="NotRebateUser",e.LinkableAAD="LinkableAAD",e.LinkedAAD="LinkedAAD",e.NotEnrollledUser="NotEnrollledUser",e.Rebate="Rebate",e}({}),r=function(e){return e.Activated="Activated",e.Activating="Activating",e.Failed="Failed",e.FetchUserInfoFailed="FetchUserInfoFailed",e.NonActivated="NonActivated",e}({}),n=function(e){return e.productNames="productNames",e.purchaseTotal="purchaseTotal",e.transactionId="transactionId",e.orderSubTotal="orderSubTotal",e.productTitleFromImage="productTitleFromImage",e.productPrice="productPrice",e.productQuantity="productQuantity",e.productSkus="productSkus",e.productSellers="productSellers",e.productUrls="productUrls",e.productBrands="productBrands",e.productCategories="productCategories",e}({}),s=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[e.EXTRACTION_SUCCESSFULL_PAUSED=11]="EXTRACTION_SUCCESSFULL_PAUSED",e[e.INVALID_PAGE_URL=12]="INVALID_PAGE_URL",e}({})},55590:function(e,t,i){i.d(t,{Q:function(){return o}});let o=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.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.ProductTrackingBackInStockValidationData="ProductTracking/BackInStockValidationData",e.ProductTrackingPriceDropValidationData="ProductTracking/PriceDropValidationData",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.InboxCouponsAAFailureUpsellTriggeredV2="InboxCouponsAAFailureUpsellTriggeredV2",e.InboxCouponsAASuccessUpsellTriggeredV2="InboxCouponsAASuccessUpsellTriggeredV2",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.AggregatorPDPLastDetectedTime="AggregatorPDPLastDetectedTime",e.NotificationLatency="NotificationLatency",e.PendingOffers="PendingOffers",e}({})},18491:function(e,t,i){i.d(t,{x:function(){return o}});let o=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.Contextual="contextual",e}({})},56372:function(e,t,i){var o=i(72370),a=i(4872),r=i(31656),n=i(47594),s=i(5144),c=i(21597),l=i(87720),u=i(3141),d=i(73557),h=i(29247),p=i(33491),g=i(27689);t.Z=class{constructor(){(0,o.Z)(this,"autoOpenPrefData",void 0),(0,o.Z)(this,"autoOpenDomainPrefData",void 0),(0,o.Z)(this,"genericDataStore",new Map),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"currentPath",void 0),(0,o.Z)(this,"impressionId",void 0),(0,o.Z)(this,"autoOpenDataStr",void 0),(0,o.Z)(this,"lastCleanedDataStr",void 0),(0,o.Z)(this,"autoOpenPrefDataStr",void 0),(0,o.Z)(this,"autoOpenDomainPrefDataStr",void 0),(0,o.Z)(this,"lastShownDataStr",void 0),(0,o.Z)(this,"stageAndCategoryLastShownStr",void 0),(0,o.Z)(this,"totalPrice",void 0),(0,o.Z)(this,"sendErrorMessage",void 0),(0,o.Z)(this,"sendStorageMessage",void 0),(0,o.Z)(this,"domainData",void 0),(0,o.Z)(this,"autoOpenData",void 0),(0,o.Z)(this,"lastCleanedData",void 0),(0,o.Z)(this,"lastShownData",void 0),(0,o.Z)(this,"stageAndCategoryLastShown",void 0),(0,o.Z)(this,"caller",void 0)}initCommonInfo(e,t,i,o){this.impressionId=e,this.domainName=t,this.currentPath=i,this.caller=o}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 i=this.lastCleanedData.get(t);if(!i){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!==i&&Date.now()-i<l.Zs)return;let o=!1,a=!1;const r=e;if(r.blockedList&&r.blockedList.length>0){const e=r.blockedList,t=this.cleanList(e);t&&t.length>0?(o=!0,r.blockedList=t):r.blockedList=[]}if(r.paths&&r.paths.forEach(((e,t)=>{if(e){const i=e.blockedListPath,o=this.cleanList(i);o&&o.length>0?(a=!0,e.blockedListPath=o,r.paths.set(t,e)):r.paths.delete(t)}})),a||o){this.autoOpenData.set(t,r),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_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?r.R.isExperimentActive(a.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_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,i){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,i))}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,i){const o=t?.find((t=>t.popupOrigination===e));if(void 0===o)return!1;const a=new Date;return!(i.lostUserReblockedTime&&(a.getTime()-i.lostUserReblockedTime)/864e5<3)}writeToList(e,t,i){if(this.domainData){if(this.shouldBlockForDomain(t)||i){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 o=JSON.stringify({value:JSON.stringify(this.autoOpenData,h.ZP.StringifyMap)});this.sendStorageMessage(l.Q5,o)}}checkBlockedList(e,t){let i=-1;if(e&&(i=e?.findIndex((e=>e.popupOrigination===t))),-1!==i&&e){const o=e[i],a=Date.now();let s=this.getSnoozeTime(o,!1);if((t===d.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK&&r.R.isTestFlagActive(n.t.msShoppingTestExp10)||t===d.sR.AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION)&&(s=-1),-1===s&&!o.blockedForSite){const i=e.filter((e=>e.popupOrigination!==t));return this.writeToList(i,t,!1),!0}return a-o.timeLastAutoOpen>=s&&!o.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 i=[];e.forEach((e=>{Date.now()-e.timeLastAutoOpen>=this.getSnoozeTime(e,!0)&&i.push(e.popupOrigination)})),t=e.filter((e=>!i.includes(e.popupOrigination)))}return t}}},29247:function(e,t,i){i.d(t,{BX:function(){return s},IM:function(){return h},Nx:function(){return n},UE:function(){return u},V6:function(){return p},VJ:function(){return d},_R:function(){return r},dz:function(){return c},w:function(){return l}});var o=i(3634),a=i(33491);function r(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,i){const o=(new Date).getTime();for(;!await e()&&o+t>(new Date).getTime();)await r(i??100);return await e()}async function l(e,t){const i=(new Date).getTime();for(;i+t>(new Date).getTime();){if(e())return!0;await r(100)}return!1}function u(e){return null!=e&&e.length>0&&"null"!==e}function d(e,t,i,o){let a=!1;if(u(e)&&(a=function(e,t){if(u(e)&&t){const i=e.toLowerCase().replace(/\s+/g,"").split(","),o=t.toLowerCase();let a=!1;for(const e of i)if(o.indexOf(e)>=0){a=!0;break}return a}return!1}(e,i)),u(t))try{!o&&location.href?.toLocaleLowerCase()?.includes(i.toLocaleLowerCase())&&"chrome-untrusted://shopping/"!==location.href&&(o=location.href?.toLocaleLowerCase()),a=function(e,t){return!!u(e)&&new RegExp(e).test(t.toLowerCase())}(t,o??i)}catch{}return a}function h(e,t){const i=new MutationObserver((async()=>{e()&&(i.disconnect(),t())}));i.observe(document.body,{attributeFilter:["offsetWidth","offsetHeight"],childList:!0,subtree:!0})}function p(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}class g{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,i){const o=(new Date).getTime();for(;!await e()&&o+t>(new Date).getTime();)await g.Sleep(i??100);return await e()}static async WaitUntilCondition(e,t){const i=(new Date).getTime();for(;i+t>(new Date).getTime();){if(await e())return!0;await g.Sleep(100)}return!1}static async WaitForSyncCondition(e,t){const i=(new Date).getTime();for(;i+t>(new Date).getTime();){if(e())return!0;await g.Sleep(100)}return!1}static IsValidDataField(e){return null!=e&&e.length>0&&"null"!==e}static IsPageMatch(e,t,i,o){let a=!1;if(g.IsValidDataField(e)&&(a=g.IsOnPage(e,i)),g.IsValidDataField(t))try{!o&&location.href?.toLocaleLowerCase()?.includes(i.toLocaleLowerCase())&&"chrome-untrusted://shopping/"!==location.href&&(o=location.href?.toLocaleLowerCase()),a=g.IsPageRegexMatch(t,o??i)}catch{}return a}static IsPageRegexMatch(e,t){return!!g.IsValidDataField(e)&&new RegExp(e).test(t.toLowerCase())}static IsOnPage(e,t){if(g.IsValidDataField(e)&&t){const i=e.toLowerCase().replace(/\s+/g,"").split(","),o=t.toLowerCase();let a=!1;for(const e of i)if(o.indexOf(e)>=0){a=!0;break}return a}return!1}static ObserveUntil(e,t){const i=new MutationObserver((async()=>{e()&&(i.disconnect(),t())}));i.observe(document.body,{attributeFilter:["offsetWidth","offsetHeight"],childList:!0,subtree:!0})}static async MeasureExecutionTime(e,t){const i=performance.now();return await e(),performance.now()-i}static DeepAssign(e,t){return Object.keys(t).forEach((i=>{if("object"==typeof t[i])e[i]||Object.assign(e,{[i]:{}}),g.DeepAssign(e[i],t[i]);else{let o=t[i];"urlRegex"===i&&"string"==typeof o&&o.endsWith("/")&&(o=o.substring(0,o.length-1)),Object.assign(e,{[i]:o})}})),e}static scrollToModuleIfTargeted(e,t){(0,a.Mw)(o.uv)===t&&setTimeout((()=>{e?.scrollIntoView({behavior:"smooth",block:"start"}),localStorage.removeItem(o.uv)}),500)}}t.ZP=g},56854:function(e,t,i){i.d(t,{H:function(){return n},r:function(){return r}});var o=i(4872),a=i(31656);function r(){return a.R.isExperimentActive(o.H.bgaaUx)}function n(){return!1}},18435:function(e,t){t.Z=class{static IsOnCheckoutPage(e,t){return!(!t||!t.retailerData)&&t.retailerData.UpdateCurrentCheckoutPage(e)}static getQuantity(e,t){let i=t.querySelector(e);i||(i=t?.parentElement?.querySelector(e));const o=i?.innerText?.trim();let a=Number(o);try{if(isNaN(a)||0===a)if(["select","input"].includes(i?.nodeName.toLowerCase())){const i=t.querySelector(e);a=Number(i.value)}else{const e=/[-]{0,1}[\d]*[.]{0,1}[\d]+/g,t=i?.innerText?.trim().match(e);t&&t?.length>0&&(a=Number(t[0]))}}catch(e){a=-1}return isNaN(a)&&(a=-1),a}static isElementDisabled(e){return"disabled"===e.getAttribute("disabled")}}},50616:function(e,t,i){var o=i(72370),a=i(36493);class r{static getInitialPrice(e){if(e)return(0,a.K)(e)}static getAmazonClippingDiscount(e,t){let i;if(t&&e){const o=t.substring(t.search(/\d+/g)),r=o.search(/\s|%/);let n=o;-1!==r&&(n=o.substring(0,r)),i=(0,a.K)(n),t.search(/%/)>0&&(i=e*i/100)}return i}static getSimpleDomainName(e){let t;if(e?.length>0){const i=e.indexOf(".");i>0&&(t=e.charAt(0).toUpperCase()+e.substring(1,i))}return t}static getStringWithoutPrice(e){return e.split(/\$\d/).join("").replace("  "," ")}}(0,o.Z)(r,"expansionDomainsList",["walgreens.com","target.com","cvs.com","riteaid.com","instacart.com","walmart.com","officedepot.com","kroger.com","meijer.com","publix.com"]),t.Z=r},71544:function(e,t,i){var o=i(72370),a=i(4872),r=i(31656),n=i(14732),s=i(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 i=c.CompareBuildVersions(t,e);return void 0!==i&&i>=0}static CompareBuildVersions(e,t){if(e&&t){const i=e.split("."),o=t.split(".");if(4!==i.length||4!==o.length)return;for(let e=0;e<4;e++){const t=parseInt(i[e],10),a=parseInt(o[e],10);if(isNaN(t)||isNaN(a))return;if(t>a)return 1;if(a>t)return-1}return 0}}static IsOtherSellersExpActive(e){return"walmart.com"===e||r.R.isExperimentActive(a.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,o.Z)(c,"enabledServiceFlights",""),t.Z=c},45822:function(e,t,i){i.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 o=i(4872),a=i(31656),r=i(5144);const n=e=>!!a.R.isExperimentActive(o.H.purchaseExtractionRefactor)||!("True"!==e?.retailerData?.settings?.other?.isPurchaseRefactorExpEnabled);function s(){return a.R.isExperimentActive(o.H.fragmentPageTypeFiltering)}function c(){return a.R.isExperimentActive(o.H.collectAllFragments)}function l(){return a.R.isExperimentActive(o.H.disablePageTypeCollectionForFragments)}function u(e){return!e||function(e){return![r.GV.HomePage,r.GV.SearchPage,r.GV.ProductPage].includes(e)}(e)}const d=(e,t)=>{if(!e||!t)return{isMatch:!1,errorMessage:""};t=(t=(t="("+t+")").replace(/[,]+/g,"|")).replace(/[\\]+/g,"");try{return{isMatch:new RegExp(t.toLowerCase()).test(e.toLowerCase()),errorMessage:""}}catch(e){return{isMatch:!1,errorMessage:e.toString()}}},h=(e,t,i)=>p(e,t,i)?r.GV.HomePage:r.GV.UnknownPage,p=(e,t,i)=>{if(e&&t){const o=e.endsWith(t)||e.endsWith(`${t}/`);if(o)return o;if(i)return e.endsWith(`${t}/${i}`)||e.endsWith(`${t}/${i}/`)}return!1},g=(e,t)=>{try{if(e.length>0&&t)for(const i of e)if(i.urlRegex&&d(t,i.urlRegex).isMatch)return i.type===r.u3.PurchaseConfirmed?r.GV.ConfirmationPage:i.type===r.u3.Checkout?r.GV.CheckoutPage:r.GV.UnknownPage;return r.GV.UnknownPage}catch(e){return r.GV.UnknownPage}},C=(e,t)=>e?.orderConfirmationPageUrl&&d(t,e.orderConfirmationPageUrl).isMatch?r.GV.ConfirmationPage:e?.checkoutPageUrl&&d(t,e.checkoutPageUrl).isMatch?r.GV.CheckoutPage:e?.productPageUrlRegex&&d(t,e.productPageUrlRegex).isMatch||e?.productPageUrl&&d(t,e.productPageUrl).isMatch?r.GV.ProductPage:e?.searchQueryUrlRegex&&d(t,e.searchQueryUrlRegex).isMatch?r.GV.SearchPage:r.GV.UnknownPage},64641:function(e,t,i){i.d(t,{C9:function(){return n},kU:function(){return a},u3:function(){return s}});var o=i(27689);const a=(e,t)=>"amazon.com"===t?r(e,"purchaseId"):"walmart.com"===t?r(e,"pcid"):"target.com"===t?r(e,"orderId"):"",r=(e,t)=>{const i=e.split("?"),o=i.length>1?i[1].split("&"):[];let a="";return o.forEach((e=>{const i=e.split("=");2===i.length&&i[0]===t&&(a=i[1])})),a},n=(e,t)=>{const i=(0,o.BQ)(e)??void 0,a=i?i[t]:void 0;return a?.cartDataStorageInfo?a?.cartDataStorageInfo:void 0},s=()=>Math.round((new Date).getTime()/1e3)},12727:function(e,t,i){var o=i(72370),a=i(29247),r=i(5144),n=i(15267);class s{constructor(e){(0,o.Z)(this,"dao",void 0),this.dao=e}deleteSecretsInURL(e){if(!this.dao.getFeatureFlagEnabledByDefault(s.FeatureName))return e;if(!e||""===e)return"";const t=this.dao.getDataMaskRules();try{if(t&&t.length>0){const i=new URL(e),o=new URLSearchParams(i.search);let r=i.toString();for(const e of t)e.maskType===s.RemoverUrlParameter&&(o.delete(e.ruleValue),i.search=o.toString(),r=i.toString());return a.ZP.IsValidDataField(r)?r:e}}catch(t){return e}return e}getCurrentUrlValue(e,t){if(!e)return t;return this.deleteSecretsInURL(t)||""}maskDataInAString(e){if(!this.dao.getFeatureFlagEnabledByDefault(s.FeatureName))return e||"";if(!e||""===e)return"";const t=this.dao.getDataMaskRules();if(t){let i=e;for(const e of t)e.maskType===s.RegexMaskRule&&(i=i.replace(new RegExp(e.ruleValue),e.ruleName));return i}return e||""}maskDataInADocument(e){if(!this.dao.getFeatureFlagEnabledByDefault(s.FeatureName))return;if(!e)return;const t=this.dao.getDataMaskRules();if(t)for(const i of t)if(i.maskType===s.RemoveAllBySelector){const t=e.querySelectorAll(i.ruleValue);for(const e of t)e.innerHTML=i.ruleName}else if(i.maskType===s.RemoveFirstBySelector){const t=e.querySelector(i.ruleValue);t&&(t.innerHTML=i.ruleName)}}maskDataInADocumentBySelector(e,t){if(e&&t)try{const i=e.querySelectorAll(t);if(i&&i.length>0)for(const e of i){const t=e.textContent;t&&(e.textContent="*".repeat(t.length))}}catch(e){}}getPiiRemovalSelector(e,t,i){if(!e||!i||!t)return"";switch(t){case r.GV.ConfirmationPage:return e?.confirmationPageTelemetry?.piiRemovalSelector??"";case r.GV.CheckoutPage:const o=(0,n._B)(e?.allCheckoutPages,i,t);return o?.piiRemovalSelector??"";default:return""}}}(0,o.Z)(s,"RegexMaskRule","REGEX"),(0,o.Z)(s,"RemoverUrlParameter","REMOVE_URL_PARAMETER"),(0,o.Z)(s,"FeatureName","data_masking"),(0,o.Z)(s,"RemoveFirstBySelector","REMOVE_FIRST_BY_SELCTOR"),(0,o.Z)(s,"RemoveAllBySelector","REMOVE_ALL_BY_SELECTOR"),t.Z=s},57550:function(e,t,i){i.d(t,{Sq:function(){return a},rP:function(){return r},wu:function(){return n},xJ:function(){return l}});var o=i(75434);function a(e){let t=[];return e&&e.itemizedCashBackResponse&&e.itemizedCashBackResponse.offers&&e.itemizedCashBackResponse.offers.length>0&&(t=e.itemizedCashBackResponse.offers),t}function r(e,t){if(!t||!e)return e;const i=new Set,o=new Set,a=new Set;!function(e,t,i,o){const a=Date.now();o.adsCashback?.forEach((o=>{if(!(a>1e3*o.expireTimeEpoch)&&(o.globalOfferId&&i.add(o.globalOfferId),o.destinationUrl)){const i=s(c(o.destinationUrl));i&&(t.add(i.pathname),e.add(i))}}))}(i,a,o,t);const r=function(e,t,i,o){return e.filter((e=>{if(e.pathname)return!o.has(e.pathname);const t=s(c(e.adsOffer.destinationUrl));return!t||!o.has(t.pathname)}))}(e,0,0,a);return r}function n(e){return e?.itemizedCashBackResponse?.adsMetadata?.visibilityFeedbackUrl||""}function s(e){try{if(!e)return;return new URL(c(e))}catch(t){(0,o.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 i=e.split("&l1=");i.length>1&&(t=i[1])}else if(e.includes("dest_url=")){const i=e.split("dest_url=");i.length>1&&(t=i[1])}return t}function l(e,t){const i={isPdp:!1,productId:""};if(t&&t.PdpData){const o=function(e,t){for(const i of t){const t=u(e,i);if(t.isMatch)return t}return{isMatch:!1,matchKey:""}}(e,t.PdpData);i.isPdp=o.isMatch,i.productId=o.matchKey}return i}function u(e,t){let i={isMatch:!1,matchKey:""};return"PathAndParameter"===t.type?i=function(e,t,i){let o="";const a=e.searchParams.get(i),r=e.pathname.toLowerCase(),n=(r===(t=t.toLowerCase())||r===t+"/"||r.endsWith(t)||r.endsWith(t+"/"))&&null!=a;return n&&null!=a&&(o=a),{isMatch:n,matchKey:o}}(e,t.path,t.parameter):"PathRegexAndParameter"===t.type?i=function(e,t,i){let o="";const a=e.searchParams.get(i),r=new RegExp(t).test(e.pathname)&&null!=a;return r&&null!=a&&(o=a),{isMatch:r,matchKey:o}}(e,t.path,t.parameter):"QueryParam"===t.type?i=function(e,t){let i="";const o=e.searchParams.get(t),a=null!=o;return a&&null!=o&&(i=o),{isMatch:a,matchKey:i}}(e,t.parameter):"PathRegex"===t.type?i=function(e,t){let i="",o=!1;if(t){const a=e.pathname.match(t.regex),r=t.indices;for(const e of r)if(a&&a.length>e&&a[e]){i=a[e],o=!0;break}}return{isMatch:o,matchKey:i}}(e,t.regexData):"ParamRegex"===t.type&&(i=function(e,t,i){let o="",a=!1;const r=e.searchParams.get(t);if(i&&r){const e=r.match(i.regex),t=i.indices;for(const i of t)if(e&&e.length>i&&e[i]){o=e[i],a=!0;break}}return{isMatch:a,matchKey:o}}(e,t.parameter,t.regexData)),i}},18549:function(e,t,i){i(88767),i(73557)},36493:function(e,t,i){i.d(t,{$g:function(){return u},Cl:function(){return l},Jl:function(){return n},K:function(){return r},N6:function(){return s},So:function(){return p},UK:function(){return a},Vv:function(){return c},cU:function(){return h},qm:function(){return d}});var o=i(64865);function a(e,t){const i=e.split(" ").map((e=>r(e,t))).filter((e=>!isNaN(e)&&e>0));return i.length>0?i[0]:0}function r(e,t){if(!e)return 0;if(e.indexOf("-")>-1){const t=e.substring(0,e.indexOf("-")),i=e.substring(e.indexOf("-")+1),o=r(t),a=r(i),n=Math.min(o,a);if(isNaN(n))return 0;e=n.toString()}e=(e=(e=(e=e.replace(/\([^)]*\)/g,"")).replace(/[^0-9\.,]+/g,"")).replace(/[\.]+$/g,"")).replace(/^[\.]+/,"");try{!1===function(e,t){if("$"===t)return!0;const i=e.lastIndexOf(","),o=e.lastIndexOf(".");return!(o>-1&&i>-1&&i>o||o>-1&&e.length-o-1>2||i>-1&&e.length-i-1<=2||-1===i&&-1===o&&(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 n(e){return e&&!(0,o.TF)(e)&&u(e)?e:"$"}function s(e){return S.get(e)}function c(e){return A.get(e)}function l(e,t){return"$"===e&&"en-us"!==t||!u(e)?function(e){return e?s(e)??"$":"$"}(t):e}function u(e){return!(!e||!C)&&C.has(e)}function d(e){return m.has(e)??!1}function h(e,t){const i=e.replace(/[0-9,. ]/g,"").trim();for(const e of g)if(e===i)return e;for(const e of g)if(i.includes(e))return e;return t?function(e){return e&&!(0,o.TF)(e)&&u(e)?e:""}(i):n(i)}function p(e){return e.replace(/([^A-Za-z])/g,"\\$1")}const g=["₹","£","€","¥","¥","₽","元","₩","₱","đ","₫","฿","US$","CA$","CL$","AU$","MX$","MXN$","C$","A$","R$","NZ$","COL$","NT$","£E","SG$","zł","S$","AR$","$","£","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","円","Rs","HUF","HK$","руб","₪","JMD","lei","UAH","DOP","XAF","XOF","KWD","AWG","CFP","BGN","BAM","KZT","MAD","BOB","GEL","JOD","QAR","XCD","MNT","TND"],C=new Set(g),S=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"],["es-ar","AR$"]]),m=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","ARS"]),A=new Map([["$","USD"],["₹","INR"],["Rs","INR"],["£","GBP"],["€","EUR"],["NZ$","NZD"],["R$","BRL"],["CA$","CAD"],["C$","CAD"],["A$","AUD"],["AU$","AUD"],["¥","JPY"],["¥","JPY"],["円","JPY"],["元","CNY"],["MX$","MXN"],["MXN$","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"],["AR$","ARS"]]);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"],["ARS","AR$"]])},91495:function(e,t,i){i.d(t,{Q:function(){return r}});var o=i(72370),a=i(55590);const r=new class{constructor(){(0,o.Z)(this,"rawStorageObj",{}),(0,o.Z)(this,"storageObjStr",""),(0,o.Z)(this,"ICIsPendingTransactionPresent",void 0),(0,o.Z)(this,"ICCurrentPageInfo",void 0),(0,o.Z)(this,"OtherSellersNotificationData",void 0),(0,o.Z)(this,"OtherSellersAutoShowCount",void 0),(0,o.Z)(this,"OtherSellersLastAutoShowTime",void 0),(0,o.Z)(this,"CanSaveYoutubeCoupons",void 0),(0,o.Z)(this,"SocialCoupons",void 0),(0,o.Z)(this,"IsEntrolledInDealDaysNotifications",void 0),(0,o.Z)(this,"CartValues",void 0),(0,o.Z)(this,"CompletedPurchase",void 0),(0,o.Z)(this,"CompletedPurchaseConf",void 0),(0,o.Z)(this,"GiftCardData",void 0),(0,o.Z)(this,"GroceryCashbackItem",void 0),(0,o.Z)(this,"Anid",void 0),(0,o.Z)(this,"GroceryCashbackActivated",void 0),(0,o.Z)(this,"ICRelatedPDPOffer",void 0),(0,o.Z)(this,"ICAutoShownOffers",void 0),(0,o.Z)(this,"AutoOpenData",void 0),(0,o.Z)(this,"AutoOpenPrefData",void 0),(0,o.Z)(this,"AutoOpenDomainPrefData",void 0),(0,o.Z)(this,"LastCleanedData",void 0),(0,o.Z)(this,"LastShownData",void 0),(0,o.Z)(this,"StageAndCategoryLastShown",void 0),(0,o.Z)(this,"ICLastAutoShowTime",void 0),(0,o.Z)(this,"ICMetadata",void 0),(0,o.Z)(this,"PersistentWinCartData",void 0),(0,o.Z)(this,"ICActivatedPending",void 0),(0,o.Z)(this,"PrivacyBadgeViewCount",void 0),(0,o.Z)(this,"PersistentCartData",void 0),(0,o.Z)(this,"PersonalizedPromotionsCartData",void 0),(0,o.Z)(this,"PersistentTravelData",void 0),(0,o.Z)(this,"AutoClipData",void 0),(0,o.Z)(this,"RuleBasedTriggerData",void 0),(0,o.Z)(this,"ICPendingTransaction",void 0),(0,o.Z)(this,"BestCoupons",void 0),(0,o.Z)(this,"ICNotificationType",void 0),(0,o.Z)(this,"CashbackInfo",void 0),(0,o.Z)(this,"ICIsRelatedOffer",void 0),(0,o.Z)(this,"GroceryInstantAddToCart",void 0),(0,o.Z)(this,"GroceryInstantAddToCartSpb",void 0),(0,o.Z)(this,"GroceryMatchedCartSpbOffers",void 0),(0,o.Z)(this,"DynamicTransactionId",void 0),(0,o.Z)(this,"GroceryAutoShowData",void 0),(0,o.Z)(this,"GroceryCategoryAutoShowData",void 0),(0,o.Z)(this,"ProductTrackingOOSLastShown",void 0),(0,o.Z)(this,"PackageTrackingConfirmationNotifLastShown",void 0),(0,o.Z)(this,"PcbNotificationLastShownAdCount",void 0),(0,o.Z)(this,"TrackedProductsData",void 0),(0,o.Z)(this,"UrlToProductMap",void 0),(0,o.Z)(this,"SidepaneCashback",void 0),(0,o.Z)(this,"ProductBestCouponConsent",void 0),(0,o.Z)(this,"PackagesNotified",void 0),(0,o.Z)(this,"ValidPackage",void 0),(0,o.Z)(this,"DealsForTopDomainsTimestamp",void 0),(0,o.Z)(this,"ICSpbHomePageShownTimestamp",void 0),(0,o.Z)(this,"ICSpbExpiryNotificationShownTime",void 0),(0,o.Z)(this,"PCBStorewideAddressBar",void 0),(0,o.Z)(this,"PCBStorewideAddressBarLastRequested",void 0),(0,o.Z)(this,"ShippingFee",void 0),(0,o.Z)(this,"InboxCouponsUserConsent",void 0),(0,o.Z)(this,"CartPageCashbackNotification",void 0),(0,o.Z)(this,"PriceMatchConsent",void 0),(0,o.Z)(this,"UnsuccessfulAutoApplyCount",void 0),(0,o.Z)(this,"ProductTrackingBackInStockValidationData",void 0),(0,o.Z)(this,"ProductTrackingPriceDropValidationData",void 0),(0,o.Z)(this,"PostPurchasePendingProducts",void 0),(0,o.Z)(this,"PostPurchasePathnameProducts",void 0),(0,o.Z)(this,"InboxCouponsHashedUserId",void 0),(0,o.Z)(this,"InboxCouponsLogsMetadata",void 0),(0,o.Z)(this,"InboxCouponsPaneOpen",void 0),(0,o.Z)(this,"IsNavigatedFromAddressBarPersonalizedCashback",void 0),(0,o.Z)(this,"IsNavigatedFromAddressBarCashback",void 0),(0,o.Z)(this,"IsNavigatedFromAddressBarCoupons",void 0),(0,o.Z)(this,"anidTrackingData",void 0),(0,o.Z)(this,"articlesCashback",void 0),(0,o.Z)(this,"PriceMatchNotificationData",void 0),(0,o.Z)(this,"BGAAApplyButtonClicked",void 0),(0,o.Z)(this,"ExclusiveCouponConsent",void 0),(0,o.Z)(this,"BlossomCampaignUserStatus",void 0),(0,o.Z)(this,"PurchaseCart",void 0),(0,o.Z)(this,"AggregatorPDPLastDetectedTime",void 0)}Create(e){r.ICSpbExpiryNotificationShownTime=e[a.Q.ICSpbExpiryNotificationShownTime]??null,r.ICSpbHomePageShownTimestamp=e[a.Q.ICSpbHomePageShownTimestamp]??null,r.OtherSellersNotificationData=e.OtherSellersNotificationData,r.OtherSellersAutoShowCount=e.OtherSellersAutoShowCount,r.OtherSellersLastAutoShowTime=e.OtherSellersLastAutoShowTime,r.CanSaveYoutubeCoupons=e.CanSaveYoutubeCoupons??null,r.SocialCoupons=e.socialCoupons??null,r.IsEntrolledInDealDaysNotifications=e[a.Q.IsEntrolledInDealDaysNotifications]??null,r.CartValues=e.CartValues,r.CompletedPurchase=e.CompletedPurchase,r.CompletedPurchaseConf=e.CompletedPurchaseConf,r.GroceryCashbackItem=e[a.Q.GroceryCashbackItem],r.Anid=e[a.Q.UserAnid],r.GroceryInstantAddToCart=e[a.Q.GroceryInstantAddToCart],r.GroceryInstantAddToCartSpb=e[a.Q.GroceryInstantAddToCartSpb],r.GroceryMatchedCartSpbOffers=e[a.Q.GroceryMatchedCartSpbOffers],r.GroceryCashbackActivated=e[a.Q.GroceryCashbackActivated],r.ICAutoShownOffers=e[a.Q.ICAutoShownOffers],r.AutoOpenData=e.AutoOpenData??null,r.AutoOpenPrefData=e.AutoOpenPrefData??null,r.AutoOpenDomainPrefData=e.AutoOpenDomainPrefData??null,r.LastCleanedData=e.LastCleanedData??null,r.LastShownData=e.LastShownData??null,r.StageAndCategoryLastShown=e.StageAndCategoryLastShown??null,r.ICLastAutoShowTime=e.ICLastAutoShowTime,r.ICMetadata=e[a.Q.ICMetadata],r.ICActivatedPending=e[a.Q.ICActivatedPending],r.PrivacyBadgeViewCount=e.PrivacyBadgeViewCount,r.GiftCardData=e.GiftCardData??null,r.PersistentCartData=e.PersistentCartData??null,r.PersistentWinCartData=e.PersistentWinCartData??null,r.PersistentTravelData=e.PersistentTravelData??null,r.AutoClipData=e.AutoClipData??null,r.RuleBasedTriggerData=e.RuleBasedTriggerData??null,r.ICPendingTransaction=e.ICPendingTransaction??null,r.BestCoupons=e[a.Q.BestCoupons],r.CashbackInfo=e[a.Q.CashbackInfo],r.ICNotificationType=e[a.Q.ICNotificationType],r.ICIsRelatedOffer=e[a.Q.ICIsRelatedOffer],r.GroceryAutoShowData=e[a.Q.GroceryAutoShowData],r.GroceryCategoryAutoShowData=e[a.Q.GroceryCategoryAutoShowData],r.ProductTrackingOOSLastShown=e[a.Q.ProductTrackingOOSLastShown],r.PackageTrackingConfirmationNotifLastShown=e[a.Q.PackageTrackingConfirmationNotifLastShown],r.ICIsPendingTransactionPresent=e[a.Q.ICIsPendingTransactionPresent],r.ICCurrentPageInfo=e[a.Q.ICCurrentPageInfo],r.ICRelatedPDPOffer=e[a.Q.ICRelatedPDPOffer],r.PcbNotificationLastShownAdCount=e[a.Q.PcbNotificationLastShownAdCount],r.TrackedProductsData=e[a.Q.ProductTrackingTrackedProducts],r.UrlToProductMap=e[a.Q.ProductTrackingUrlProductCache],r.SidepaneCashback=e[a.Q.SidepaneCashback],r.ProductBestCouponConsent=e[a.Q.ProductBestCouponConsent],r.PackagesNotified=e[a.Q.PackagesNotified],r.ValidPackage=e[a.Q.ValidPackage],r.DealsForTopDomainsTimestamp=e[a.Q.DealsForTopDomainsTimestamp],r.PCBStorewideAddressBar=e[a.Q.PCBStorewideAddressBar],r.PCBStorewideAddressBarLastRequested=e[a.Q.PCBStorewideAddressBarLastRequested],r.ShippingFee=e[a.Q.ShippingFee],r.InboxCouponsUserConsent=e[a.Q.InboxCouponsUserConsented],r.CartPageCashbackNotification=e[a.Q.CartPageCashbackNotification],r.PriceMatchConsent=e[a.Q.PriceMatchConsent],r.UnsuccessfulAutoApplyCount=e[a.Q.UnsuccessfulAutoApplyCount],r.ProductTrackingBackInStockValidationData=e[a.Q.ProductTrackingBackInStockValidationData],r.ProductTrackingPriceDropValidationData=e[a.Q.ProductTrackingPriceDropValidationData],r.PostPurchasePendingProducts=e[a.Q.PostPurchasePendingProducts],r.PostPurchasePathnameProducts=e[a.Q.PostPurchasePathnameProducts],r.InboxCouponsHashedUserId=e[a.Q.InboxCouponsHashedUserId],r.InboxCouponsLogsMetadata=e[a.Q.InboxCouponsLogsMetadata],r.InboxCouponsPaneOpen=e[a.Q.InboxCouponsPaneOpen],r.IsNavigatedFromAddressBarPersonalizedCashback=e[a.Q.IsNavigatedFromAddressBarPersonalizedCashback],r.anidTrackingData=e[a.Q.ProductTrackingAnidData],r.PersonalizedPromotionsCartData=e[a.Q.PersonalizedPromotionsCartData],r.IsNavigatedFromAddressBarCashback=e[a.Q.IsNavigatedFromAddressBarCashback],r.IsNavigatedFromAddressBarCoupons=e[a.Q.IsNavigatedFromAddressBarCoupons],r.articlesCashback=e[a.Q.ArticlesCashback],r.PriceMatchNotificationData=e[a.Q.PriceMatchNotification],r.BGAAApplyButtonClicked=e[a.Q.BGAAApplyButtonClicked],r.ExclusiveCouponConsent=e[a.Q.ExclusiveCouponConsent],r.BlossomCampaignUserStatus=e[a.Q.BlossomCampaignUserStatus],r.DynamicTransactionId=e[a.Q.DynamicTransactionId],r.PurchaseCart=e[a.Q.PurchaseCart],r.AggregatorPDPLastDetectedTime=e[a.Q.AggregatorPDPLastDetectedTime]}setRawStorageObject(e){this.rawStorageObj=e}setStorageObjStr(e){this.storageObjStr=e}}},44092:function(e,t,i){function o(){try{const e="__storage__test";return window.sessionStorage.setItem(e,""),window.sessionStorage.removeItem(e),!0}catch(e){return!1}}function a(e){return o()?window.sessionStorage.getItem(e):null}function r(e,t){o()&&window.sessionStorage.setItem(e,t)}i.d(t,{Lt:function(){return a},i8:function(){return r}})},33491:function(e,t,i){i.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 r},Xo:function(){return l}});let o=null;const a="test-shopping-localstorage";function r(e){let t;const i=n(e);if(i)try{return t=JSON.parse(i),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!==o)return o;"undefined"!=typeof window&&window?.localStorage&&(window.localStorage.setItem(a,a),window.localStorage.getItem(a),window.localStorage.removeItem(a),o=!0)}catch(e){o=!1}return o}},91897:function(e,t,i){i.d(t,{nQ:function(){return a},r2:function(){return r}});var o=i(64865);const a=864e5;function r(e,t){if((0,o.TF)(e))return-1;const i=new Date(e),a=void 0===t?new Date:new Date(t),r=i?a.getTime()-i.getTime():0;return Math.floor(r/1e3/60/60)}},27689:function(e,t,i){i.d(t,{AL:function(){return v},Ad:function(){return y},B7:function(){return O},BE:function(){return h},BQ:function(){return g},Ek:function(){return A},Md:function(){return S},Mu:function(){return D},S8:function(){return d},SM:function(){return c},TR:function(){return m},Wf:function(){return b},cz:function(){return C},fZ:function(){return I},oO:function(){return p},og:function(){return f},p$:function(){return u},sT:function(){return l},sk:function(){return T},uE:function(){return E},uf:function(){return P}});var o=i(17204),a=i(5144),r=i(88767),n=i(29247),s=i(36493);function c(e,t,i){let o=e??"";return i&&(o+="\r\nDOM element path: '"+i+"'"),o+="\r\nFriendly name: '"+t+"'",o}function l(){return"BackgroundAutoApplyData_"+d()}function u(){const e=d(),t=e.split(".");return t.length>2?t[t.length-2]+"."+t[t.length-1]:e}function d(){return E(window.location.hostname)}function h(e,t,i){if(i&&(i===a.BN.Opal||i===a.BN.EdgeMobile||i===a.BN.Sapphire||i===a.BN.RBC)){if(t===a.UA.PlainString)return function(e){return e?e.replace(/"|'/g,'\\"'):e}(e);if(t===a.UA.JsonString)return p(e)}return e}function p(e){return e?e.replace(/\"|'/g,'\\"'):e}function g(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,n.BX);return t.value?JSON.parse(t.value,n.BX):t}const i=JSON.parse(e);return i.value?JSON.parse(i.value):i}return e}catch(e){return null}}function C(){try{return window.self!==window.top}catch(e){return!0}}function S(e,t){return new o.Z(h(e,a.UA.JsonString,t))}function m(e,t){const i=new Error(t);throw i.name=e,i}function A(){return window.location.toString()}function f(e,t){if(e&&t&&""!==t){const i=t.split("|");for(const t of i)if(e.match(t))return t}return""}function v(){return document.title}function E(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 P(e,t){return e||t||"en-us"}function I(e,t,...i){let o="",a=Array.prototype.slice.call(arguments);return a=a.slice(1),t?(o=t=t.replace(/\$(.|$|\n)/g,(e=>void 0!==a[e[1]]?"$$"===e?"$":a[e[1]]:"$2")),o):o}function T(e,t){const i=function(e){e||(e="en-us");let t=(0,s.N6)(e);return t||(t="$"),t}(t);return e.replace(r.iM.currency,i)}function O(e,t,...i){const o=t.split("*br*");if(o.length>1)!function(e,t,...i){const o=e.length;let a=0;for(let r=0;r<o;r++){if(e[r].includes("$"))if(0===r)a=O(t,e[r],...i);else if(2===e[r].trim()?.length)t.append([...i][a]),a+=1;else{const o=document.createElement("DIV");a+=O(o,e[r],...[...i].slice(a)),t.appendChild(o)}else{const i=document.createElement("p");i.style.margin="0px",i.style.display="inline-block",i.textContent=e[r],t.append(i)}if(r!==o-1){const e=document.createElement("br");e.setAttribute("aria-hidden","true"),t.appendChild(e)}}}(o,e,...i);else{if(window?.trustedTypes){const t=window.trustedTypes.emptyHTML;e.innerHTML=t}const o=t.split(/\$\d/),a=o.length,r=i.length;for(let t=0;t<a;t++){if(o[t]=T(o[t]),0===t)e.textContent=o[t];else if(t===r){const i=1===o.slice(t).length,a=document.createTextNode(N(o.slice(t),i));e.appendChild(a)}else{const i=document.createTextNode(o[t]);e.appendChild(i)}if(t===a-1||t===r)return t;e.appendChild(i[t])}}return 0}function y(e){try{return JSON.parse(e)}catch(e){return null}}function D(e,t){try{return new URL(e.offerUrl).hostname!==t&&e.attribution!==t}catch(e){return!1}}function b(e){if(e)try{const t=JSON.parse(e);for(const e of t)if(e.includes("bing.com"))return e}catch(e){}}function N(e,t){return 0===e.length?"":1===e.length?t?e[0]:"$1"+e[0]:e[0]+N(e.slice(1),!1)}},43315:function(e,t,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"productNames",null),(0,o.Z)(this,"productSellerNames",null),(0,o.Z)(this,"productIdSku",null),(0,o.Z)(this,"transactionId",null),(0,o.Z)(this,"purchaseTotal",null),(0,o.Z)(this,"numberOfItems",null),(0,o.Z)(this,"pricePerItem",null),(0,o.Z)(this,"quantityPerItem",null),(0,o.Z)(this,"orderConfirmationPageUrl",null),(0,o.Z)(this,"orderSubTotalPrice",null),(0,o.Z)(this,"orderDiscountPrice",null),(0,o.Z)(this,"orderDiscountCode",null),(0,o.Z)(this,"orderShippingPrice",null),(0,o.Z)(this,"orderTaxesPrice",null),(0,o.Z)(this,"currency",null),(0,o.Z)(this,"productUrls",null),(0,o.Z)(this,"personalizationDataConsent",null),(0,o.Z)(this,"productBrandNames",null),(0,o.Z)(this,"productCategories",null)}}},33408:function(e,t,i){i.d(t,{_p:function(){return Te}});var o=i(72370),a=i(64865),r=i(3634),n=i(95457),s=i(4872),c=i(31656),l=i(84830),u=i(82960),d=i(71951),h=i(5144),p=i(39088),g=i(21488),C=i(21597),S=i(88767),m=i(73557),A=i(55590),f=i(29247),v=i(71544),E=i(36493),P=i(33491),I=i(91495),T=i(27689),O=i(91221),y=i(90066),D=i(27900),b=i(60269),N=i(46261),R=i(1094),_=i(34802),k=i(50978),w=i(90650),x=i(87869),U=i(46557),M=i(52056),L=i(54869),B=i(43315),F=i(69315),Z=i(68813);let G=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=i(64641),V=i(11542),W=i(8018);class K{static GetItemizedCashbackService(){return this.itemizedCashbackService}static GetEdgeMessageService(){return this.edgeMessageService}}(0,o.Z)(K,"edgeMessageService",new class{SendPurchaseConfirmationMessage(){this.SendMessge(G.PurchaseCashbackConfirmation,[])}SendStorageMessage(e,t){this.SendMessge(G.SetStorageValue,[e,t])}ClearStorageValue(e){this.SendMessge(G.ClearStorageValue,[e])}SendUpdateLoadTimeMessge(e){this.SendMessge(G.UpdateLoadTimeData,[e])}TrySendAutoShowFeaturesAvailableMessage(e,t){return!!(0,Z.Oh)(e,(0,Z.tW)(),L.Z.GetLocalDataService().GetUserSettingsData())&&(this.SendMessge(G.AutoShowFeaturesAvailable,[e.toString(),t]),!0)}ReportRewardsActivity(e,t,i){this.SendMessge(G.ReportRewardsActivity,[e,t,i])}SendMessge(e,t){F.R.postMessageToHost(e,t)}}),(0,o.Z)(K,"itemizedCashbackService",new class{constructor(e){(0,o.Z)(this,"edgeMessageService",void 0),this.edgeMessageService=e}CheckGroceryCashBack(e,t,i,o){try{const a=(0,H.kU)(e,t);if(!a)return!1;const r=i.isRebatesUser,n=this.getPendingTransaction(a,t,r);if(n)return this.addTransactionToPersistentStorage(t,n),this.edgeMessageService.SendStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:W.c.Confirmation})),this.edgeMessageService.SendStorageMessage(A.Q.ICConfirmationPending,JSON.stringify({value:!0})),this.edgeMessageService.SendPurchaseConfirmationMessage(),this.edgeMessageService.SendUpdateLoadTimeMessge(o),!0}catch(e){}return!1}getPendingTransaction(e,t,i){const o=I.Q?.GroceryCashbackActivated,a=(o?(0,T.BQ)(o):{})[t]??void 0,r=a?.fullItems?Object.keys(a.fullItems):[],n=[],s=[];for(const e of r){const t=a.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=I.Q?.PersistentCartData||"",l=(0,H.C9)(c,t);if(n.length>0&&l?.Products)for(const o of l.Products)if(n.includes(o.productTitle)||this.isProductFromUrlActivated(`https://www.${t}${o.productUrl}`,s))return this.makePendingTransactionToStorage(l,a,i,e)}isProductFromUrlActivated(e,t){const i=V.Z.GetProductIdsFromUrl(e);return!!t&&t.some((e=>i.includes(e)))}makePendingTransactionToStorage(e,t,i,o){return{addedTimestamp:(0,H.u3)(),groceryActivatedData:t,groceryOrder:e,isSigninBeforePurchase:i,purchaseIdFromUrl:o,transactionId:o}}addTransactionToPersistentStorage(e,t){const i=(0,T.BQ)(I.Q.ICPendingTransaction)??{};i[e]=t,this.edgeMessageService.SendStorageMessage(A.Q.ICPendingTransaction,JSON.stringify({value:JSON.stringify(i)}))}}(K.GetEdgeMessageService()));var z=K,Q=i(56577),j=class{constructor(){(0,o.Z)(this,"productIdSelector",void 0),(0,o.Z)(this,"productIdSkuSelector",void 0),(0,o.Z)(this,"productPriceSelector",void 0),(0,o.Z)(this,"productQuantitySelector",void 0),(0,o.Z)(this,"productImageSelector",void 0)}},Y=class{constructor(){(0,o.Z)(this,"confirmationPageUrl",void 0),(0,o.Z)(this,"bookingIdSelector",void 0),(0,o.Z)(this,"totalPriceSelector",void 0),(0,o.Z)(this,"startDateSelector",void 0),(0,o.Z)(this,"endDateSelector",void 0),(0,o.Z)(this,"domainType",void 0),(0,o.Z)(this,"nameSelector",void 0),(0,o.Z)(this,"isRoundTripSelector",void 0),(0,o.Z)(this,"piiRemovalSelector",void 0),(0,o.Z)(this,"dateSeparationRegex",void 0),(0,o.Z)(this,"dateCleaningRegex",void 0)}};class J{constructor(){(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"orderConfirmationPageUrl",void 0),(0,o.Z)(this,"orderConfirmationRegex",void 0),(0,o.Z)(this,"confirmationPageTelemetry",void 0),(0,o.Z)(this,"orderDetailsPageUrl",void 0),(0,o.Z)(this,"productNameSelector",void 0),(0,o.Z)(this,"productPageUrl",void 0),(0,o.Z)(this,"cancellationPageTelemetry",void 0),(0,o.Z)(this,"travelConfirmationPageTelemetry",void 0),(0,o.Z)(this,"exactConfirmationPageUrl",void 0),(0,o.Z)(this,"allAutomatedSelectors",void 0),(0,o.Z)(this,"settings",void 0)}static Create(e){const t=new J;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,o.Z)(this,"cancellationPageUrlRegex",void 0),(0,o.Z)(this,"transactionIdSelector",void 0),(0,o.Z)(this,"cancellationTextSelector",void 0),(0,o.Z)(this,"productTitleSelector",void 0),(0,o.Z)(this,"productQuantitySelector",void 0),(0,o.Z)(this,"pricePerItemSelector",void 0),(0,o.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,o.Z)(this,"transactionIdSelector",void 0),(0,o.Z)(this,"purchaseTotalSelector",void 0),(0,o.Z)(this,"numItemsSelector",void 0),(0,o.Z)(this,"productDetailsData",void 0),(0,o.Z)(this,"orderIdSelectors",void 0),(0,o.Z)(this,"orderSubTotalPriceSelector",void 0),(0,o.Z)(this,"orderDiscountPriceSelector",void 0),(0,o.Z)(this,"orderDiscountCodeSelector",void 0),(0,o.Z)(this,"orderShippingPriceSelector",void 0),(0,o.Z)(this,"orderTaxesPriceSelector",void 0),(0,o.Z)(this,"isHtmlFragmentCollectionEnabled",void 0),(0,o.Z)(this,"isCartCachingEnabled",void 0),(0,o.Z)(this,"confirmationPageValidationSelector",void 0),(0,o.Z)(this,"piiRemovalSelector",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.piiRemovalSelector=e.piiRemovalSelector,t}static CreateProductDetailsData(e){const t=[];for(const i of e)if(i){const e=new j;e.productIdSelector=i.productIdSelector,e.productIdSkuSelector=i.productIdSkuSelector,e.productPriceSelector=i.productPriceSelector,e.productQuantitySelector=i.productQuantitySelector,e.productImageSelector=i.productImageSelector,t.push(e)}return t}static CreateTravelConfirmationPageTelemetryData(e){const t=[];for(const i of e)if(i){const e=new Y;e.bookingIdSelector=i.bookingIdSelector,e.confirmationPageUrl=i.confirmationPageUrl,e.domainType=i.domainType,e.startDateSelector=i.startDateSelector,e.endDateSelector=i.endDateSelector,e.totalPriceSelector=i.totalPriceSelector,e.nameSelector=i.nameSelector,e.piiRemovalSelector=i.piiRemovalSelector,e.dateCleaningRegex=i.dateCleaningRegex,e.dateSeparationRegex=i.dateSeparationRegex,t.push(e)}return t}static createAutomatedSelectorsPageList(e){const t=[];for(const i of e)t.push(f.ZP.DeepAssign(new Q.ZP,i));return t}}var X=J,q=class{constructor(){(0,o.Z)(this,"retailerData",void 0),(0,o.Z)(this,"impressionId",void 0),(0,o.Z)(this,"cashback",void 0),(0,o.Z)(this,"platform",void 0),(0,o.Z)(this,"orderConfirmationPageUrlRegex",void 0)}},$=class{constructor(){(0,o.Z)(this,"name",void 0),(0,o.Z)(this,"domainType",void 0),(0,o.Z)(this,"bookingId",void 0),(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"orderConfirmationPageUrl",void 0),(0,o.Z)(this,"startDate",void 0),(0,o.Z)(this,"endDate",void 0),(0,o.Z)(this,"currency",void 0),(0,o.Z)(this,"isRoundTrip",void 0),(0,o.Z)(this,"personalizationDataConsent",void 0)}},ee=i(41368),te=i(86743),ie=i(15267),oe=i(45822),ae=i(73765),re=i(82315),ne=i(59368);function se(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function ce(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?se(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):se(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}let le="",ue="";async function de(e,t){try{const i=e[0],o=JSON.parse(i),l=function(e){if(e){const t=new q;return e.retailerData&&(t.retailerData=X.Create(e.retailerData),t.platform=e.retailerData.platform,t.orderConfirmationPageUrlRegex=e.retailerData.orderConfirmationPageUrl),e.impressionId&&(t.impressionId=e.impressionId),t}return new q}(o),u=o.aFDMarket,p=o.personalizedAdsResponse?.personalizedCashback,E=o?.isPackageTrackingEnabled??!1,O=o?.cashback;ue=l.impressionId??"",n.Z.Create(o?.itemLevelCashBack?.domainData);const D=o?.userInfo?.isAADSignedIn??!1,_=o?.userInfo?.isMSASignedIn??!1,k=o?.userInfo?.isPersonalizationDataConsentEnabled??!1;if(!t)return le=e[1],!0;let B,F,Z=!1,G=!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),Z=c.R.isExperimentActive(s.H.sustainability),G=c.R.isExperimentActive(s.H.postPurchaseTracking)}catch(e){Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)()},"ConfirmationPageValidation","Unable to find experiments: "+e,h.in.Error)}let H,V="";if(e.length>3)try{if(V=e[3],!(0,a.TF)(V)){const e=JSON.parse(V);I.Q.Create(e),I.Q.setRawStorageObject(e)}}catch(e){Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)()},"ConfirmationPageValidation","Unable to find persistentStorageData"+e,h.in.Error)}e.length>5&&(H=e[5]),e.length>=8&&(v.Z.enabledServiceFlights=e[7]);let W=!1;e.length>=10&&(W="1"===e[9]);let K,Q=!1;e.length>=11&&(Q="1"===e[10]),e.length>=12&&(K=e[11]);let j="";e.length>=13&&(j=e[12]),L.Z.GetLocalDataService().SetUserSettingsData(e,C.$R.confirmation_user_cohort_data,c.R.isExperimentActive(s.H.shoppingCohorts));const Y=function(e,t,i,o,a){try{if((0,oe.hy)(e)){const r=re.Z.createNewApiResponse(JSON.stringify(e),i,t),n=L.Z.GetLocalDataService()?.GetSessionIds();if(ee.Z.initFactory(r,n,o,a),ee.Z.getFactory().getPurchaseExtractionService().isPurchaseExtractionEnabled())return!1}}catch(e){me("Failed to instantiate cashback injected factory")}return!0}(o,ue,le,H??"",j??""),J=function(e){const t=e.retailerData;try{if(t){const e=t.orderConfirmationRegex;if(e&&""!==e)return atob(e)}}catch(e){Se({Domain:(0,T.S8)(),PageUrl:(0,T.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}(J,l))(0,P.UZ)(N.Wi),(0,f.dz)((async()=>pe(J,l.retailerData)),5e3).then((async i=>{if(!i){if(("super.com"===l?.retailerData.domainName||"livesuper.com"===l?.retailerData.domainName)&&l?.retailerData.confirmationPageTelemetry?.transactionIdSelector){const e=l?.retailerData.confirmationPageTelemetry?.transactionIdSelector??"";await(0,f.dz)((async()=>void 0!==y.Z.GetFirstVisibleElement(e)),25e3,250).then((e=>{e&&(i=!0)}))}const r=function(e,t){const i=e?.retailerData?.allFinalCheckoutPages;if(!i)return"";if((0,a.TF)(t))return"";const o=i.find((e=>t.includes(e?.checkoutPageUrl))),r=o?.finalCheckoutButtonSelector;return r}(o,l.retailerData.orderConfirmationPageUrl);!function(e,t){if((0,a.TF)(e))return;y.Z.GetAllVisibleElements(e).forEach((e=>function(e,t){e.addEventListener("click",t)}(e,t)))}(r,(async()=>{(0,f.dz)((async()=>pe(J,l.retailerData)),2e4).then((i=>{i&&de(e,t)}))}))}let n=!1;const d=l?.retailerData?.domainName??"";if(i){const e=g.Z.Create(o);n=z.GetItemizedCashbackService().CheckGroceryCashBack(window.location.href,d,e,le)}i&&G&&function(e,t){const i=(0,T.S8)();if(r.kH.includes(i)&&t){const o=!0===(0,T.BQ)(I.Q.PriceMatchConsent),a=r.PK[i]?.hasCsrError,n={Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({isUserConsented:o,hasCsrError:a})};if(Se(n,"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Eligible confirmation page detected",h.in.Information),o&&!a)(async function(e,t,i){try{const i=Le(e,t,"Extension/Injected/ConfirmationPage"),o="https://www.bing.com/api/shopping/v1/savings/product-tracking/track-batch-products",a=await fetch(o,i);return await a.json()}catch(e){return Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({e:e})},"ConfirmationPageValidation","sendPostPurchaseRequest: Uncaught error",h.in.Error),{success:!1}}})(e,t).then((e=>{e.success?Se(n,"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Tracking successful",h.in.Information):Se(n,"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Tracking unsuccessful",h.in.Error)})).catch((e=>{Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({error:e})},"ConfirmationPageValidation","TryAndSendPostPurchaseRequest: Uncaught error",h.in.Error)}));else{const i=Le(e,t,"Extension/UX/PendingProducts");i&&z.GetEdgeMessageService().SendStorageMessage(A.Q.PostPurchasePendingProducts,JSON.stringify({value:{request:i,timestamp:Date.now()}}))}}}(L.Z.GetCartExtractionService().GetAvailableCartData(),K);const C=L.Z.GetCancellationPageDataExtractionService();C.isCancellationPageValid(l.retailerData)&&(C.GetAndSendCancellationPageData(l.retailerData,ue),i=!1),Ae(i,l,p,O,E,H,K,j,D,_,k,u,Y),c.R.isExperimentActive(s.H.sanConsent)&&c.R.isExperimentActive(s.H.sanConfirmationMessage)&&i&&!n&&!W&&Q&&(z.GetEdgeMessageService().TrySendAutoShowFeaturesAvailableMessage(m.sR.AUTO_SHOW_SAN_CONSENT_CONFIRMATION,S.sM.SAN_CONSENT_NOTIFICATION)||Ce({},m.sR.AUTO_SHOW_SAN_CONSENT_CONFIRMATION))})).catch((e=>{me(e?.message??"confirmationpage error.")}));else{const e=function(){try{const e=(0,P.Mw)(N.Wi);if(!e)return null;const t=JSON.parse(e);if(!t.CheckoutButtonClicked||Date.now()-t.CheckoutTime>N.LE){(0,P.UZ)(N.Wi);const e=t.CartValue;return ge("Expired checkout status data in confirmation page script","Error",t.CartId,e?.OrderTotal,e?.Currency),null}return(0,P.UZ)(N.Wi),t}catch(e){return null}}();if(!e)return Ae(!1,l,p,O,E,H,K,j,D,_,k,u,Y),ge("no checkout status","Failed",""),!1;const t=function(e){if(e){const t=new b.Z;return e.retailerData&&(t.retailerData=U.Z.Create(e.retailerData)),e.impressionId&&(t.impressionId=e.impressionId),t}return new b.Z}(o);let i=new x.L;(0,f.dz)((async()=>(i=function(e){e.retailerData.updateCurrentFinalCheckoutPage(R.Z.GetCurrentPathName());const t=e?.retailerData?.getCurrentFinalCheckoutPage();return function(e){const t=new x.L;if(t.indicators=[],t.purchaseFailed=!1,e&&y.Z.GetAllVisibleElements(e?.finalCheckoutButtonSelector).length>0)return t.purchaseFailed=!0,t.indicators.push(x.c.finalCheckoutButtonVisible),t;const i=y.Z.GetFirstVisibleElement("body");return w.ZP.PageIncludesPaymentKeyWords(i?.innerText.toLocaleLowerCase(),w.lD)?(t.purchaseFailed=!1,t.indicators.push(x.c.successfulPaymentKeywordsFound),t):(w.ZP.PageIncludesPaymentKeyWords(i?.innerText.toLocaleLowerCase(),w.si)&&(t.purchaseFailed=!0,t.indicators.push(x.c.failurePaymentKeywordsFound)),y.Z.GetAllVisibleElements("input").length>0&&(t.purchaseFailed=!0,t.indicators.push(x.c.inputFieldsFound)),t)}(t)}(t),i.indicators.length>0)),5e3).then((()=>{Ae(!!Z&&!i.purchaseFailed,l,p,O,E,H,K,j,D,_,k,u,Y),function(e,t,i,o){const a=e?"Failed":"Succeeded";e||(0,P.Mw)(d.y$.autoApplyStorageKey)===d.M4.ActionDetected&&(M.Z.SendStringStorageMessage(d.y$.completedPurchaseStorageKey,d.M4.ActionDetected),(0,P.Xo)(d.y$.completedPurchaseStorageKey,d.M4.ActionDetected)),ge(JSON.stringify(o),a,t,i.OrderTotal,i.Currency)}(i.purchaseFailed,e.CartId,e.CartValue,i.indicators)})).catch((t=>{Ae(!1,l,p,O,E,H,K,j,D,_,k,u,Y),ge(t?.message??"Error evaluating purchase status on confirmation page","Error",e.CartId,e.CartValue?.OrderTotal,e.CartValue?.Currency)}))}return!1}catch(e){return Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),Status:"Error"},"ConfirmationPageValidation","Confirmation page validation error: "+e,h.in.Error),!1}}function he(e){try{const t=ee.Z.getFactory()?.getDynamicTransactionId(),{isValidDynamicTransactionId:i}=t.getDynamicTransactionId(e?.settings);return i}catch{return!1}}function pe(e,t){if(t?.confirmationPageTelemetry?.confirmationPageValidationSelector){const e=M.Z.GetBoxValue(t.confirmationPageTelemetry.confirmationPageValidationSelector);return null!=e&&""!==e||(_e("validation selector invalid",{message:`validation selector: ${t.confirmationPageTelemetry.confirmationPageValidationSelector}`}),!1)}if(e&&""!==e){const t=document?.body?.getElementsByTagName("*"),i=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(i))return!0}if(t?.confirmationPageTelemetry?.transactionIdSelector||he(t)){if(he(t))return!0;if(t?.confirmationPageTelemetry?.transactionIdSelector){const e=t.confirmationPageTelemetry.transactionIdSelector;let i=M.Z.GetBoxValue(e);if(i||(i=(0,ie.ql)(e,(0,T.Ek)())),i)return!0;_e("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,T.Ek)();for(const i of e.allAutomatedSelectors)if(i.type===h.u3.PurchaseConfirmed&&i.urlRegex&&(0,oe.io)(t,i.urlRegex).isMatch)return!0}}catch(e){return _e("confirmation page detection Error",{message:"not a valid confirmation page"}),!1}return!1}(t)||(_e("confirmation page detection Error",{message:"not a valid confirmation page"}),!1)}function ge(e,t,i,o,a){Se({CartId:i,Currency:a,Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),StartingPrice:o??-1,Status:t},"PurchaseConfirmation","Confirmation page: "+e,"Information")}function Ce(e,t){const i={userSettingsData:L.Z.GetLocalDataService().GetUserSettingsData(),popupOrigination:m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION};Se(e,"ConfirmationPageValidation",`Blocked by User Cohort:${JSON.stringify(i)}`,h.in.Information)}function Se(e,t,i,o){const a={};a.JsonData=JSON.stringify(e),a.EventType=t,a.LogLevel=o,a.Message=i,a.ClientContext=new l.Z(v.Z.GetClientName(),p.yJ,v.Z.GetBuildVersion(),v.Z.enabledServiceFlights),ue&&(a.ImpressionId=ue);const r=[JSON.stringify(a)];F.R.postMessageToHost("LogScriptTelemetry",r)}function me(e){Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),Status:"error"},"ConfirmationPageValidation",e,h.in.Information),F.R.postMessageToHost("ConfirmationPageValidationError",["error",le])}function Ae(e,t,i,o,a,n,d,g,C,f,E,y,b){a&&(O.Z.hasNotificationBeenShownRecently(A.Q.PackageTrackingConfirmationNotifLastShown,r.LJ)||(async function(e,t){const i=e?.retailerData?.confirmationPageTelemetry?.transactionIdSelector,o=e?.retailerData?.confirmationPageTelemetry?.orderIdSelectors;if(!i&&!o)return;let a="",n="";try{const s=(0,T.Ek)();if(a=M.Z.GetBoxValue(i??""),a&&""!==a)n=a;else if(r.Z3.has(e?.retailerData?.domainName)){const t=r.Z3.get(e?.retailerData?.domainName);t&&s.includes(t)&&(n=(0,ie.Tb)(t,s))}else if(o?.startsWith(r.js)){const e=(0,ie.vU)(o,s);e&&(n=e)}else if(o?.startsWith(r.m7)){const e=(0,ie.AS)(o,s);e&&(n=e)}else n=await Re(o);if(n&&""!==n||r.RY.has(e?.retailerData?.domainName)){const i=/(?:#\s*)([^\s|]*)/gi;n=i.exec(n??"")?.at(1)??n??"";const o={email:null,isOrderConfirmationPage:t,orderNumber:n,phoneNumber:null,trackingUrl:e?.retailerData?.orderDetailsPageUrl},a=JSON.stringify(o);F.R.postMessageToHost("ConfirmationPageData",[a,le])}}catch(e){}}(t,e),M.Z.SendStorageMessage(A.Q.PackageTrackingConfirmationNotifLastShown,JSON.stringify({value:(new Date).toUTCString()})))),F.R.postMessageToHost("ConfirmationPageValidationStatus",[e?"true":"false",le]),e&&(function(e,t){const i="IS_ELIGIBLE_FOR_REWARDS_"+(0,T.S8)(),o=I.Q?.rawStorageObj[i];if("true"===o&&!Ue(t.personalizedCashback)){z.GetEdgeMessageService().ClearStorageValue(i);const e=JSON.stringify({offerid:"coupons_50points_202403"}),t="712",o="1";z.GetEdgeMessageService().ReportRewardsActivity(e,t,o);const a=JSON.stringify({attributes:e,type:t,amount:o});Se(new ae.Z((0,T.S8)(),h.oN.AARewards,location.pathname,h.zy.OrderPurchased,a),h.R.ShoppingRewards,"Order Purchased",h.in.Information)}}(0,o),Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),Status:"Success"},"ConfirmationPageValidation","Confirmation page detected",h.in.Information),async function(e,t,i,o,a,r,n,d,g,C,f){const E=L.Z.GetLocalDataService(),O=E.GetSessionIds()?.retailerSessionId??"",y=E.GetSessionIds()?.pageVisitId??"",b={Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),PageVisitId:y,RetailerSessionId:O};let N;try{if(e?.retailerData?.travelConfirmationPageTelemetry)N=await async function(e,t,i){if(null==e?.retailerData?.travelConfirmationPageTelemetry)return;let o,a=null;const r=e.retailerData.travelConfirmationPageTelemetry;for(const t of r)if(t.confirmationPageUrl&&new RegExp(t.confirmationPageUrl).test((0,T.Ek)())&&(o=await Ee(t,e.retailerData.domainName,e.platform,i),o?.travelConfirmationDetails)){a=o.travelConfirmationDetails;break}let n=u.Z.uuidv4();if(n&&""!==n||(n=Oe()),a){let e=!0;if(a.bookingId){const t=(0,P.Mw)(a.bookingId);t&&Date.now()-Date.parse(t)<12096e5?e=!1:(0,P.Xo)(a.bookingId,Date.now().toString())}if(e){let e="Travel confirmation page telemetry";o?.error&&(e+="; "+o.error);const i=function(e,t,i,o){const a={BookingId:t.bookingId,Currency:t.currency,Domain:(0,T.S8)(),DomainType:t.domainType,EndDate:t.endDate,EventId:i,Name:t.name,OrderConfirmationPageUrl:t.orderConfirmationPageUrl,Price:t.price,RGuid:o?.rGuid,StartDate:t.startDate,IsRoundTrip:t.isRoundTrip,PersonalizationDataConsent:t.personalizationDataConsent},r={};r.JsonData=JSON.stringify(a),r.EventType="TravelConfirmationPageDetails",r.LogLevel="Information",r.Message=e,r.ClientContext={AppInfoClientName:v.Z.GetClientName(),JSVersion:p.yJ},ue&&(r.ImpressionId=ue);const n=[JSON.stringify(r)];return F.R.postMessageToHost("LogScriptTelemetry",n),a}(e,a,n,t);return await ve(n,"TravelConfirmationPage"),i}}else Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)()},"ConfirmationPageValidation",(o?.error??" ")+"confirmationpage cart details extraction error.",h.in.Error)}(e,t,g);else if(e?.retailerData?.confirmationPageTelemetry){let d;const E=!!e?.retailerData?.settings?.other?.disableExpiredCartExtraction&&"true"===e.retailerData.settings.other.disableExpiredCartExtraction.toLowerCase(),O=!!e?.retailerData?.settings?.other?.disableNoProductTitleCheck&&"true"===e.retailerData.settings.other.disableNoProductTitleCheck.toLowerCase(),y=!!e?.retailerData?.settings?.other?.disableFallbackToFastCart&&"true"===e.retailerData.settings.other.disableFallbackToFastCart.toLowerCase(),_=await Te(e.retailerData.confirmationPageTelemetry,e.retailerData.domainName,e.platform,E,O,y);d=_?.confirmationDetails||null,d&&(d.personalizationDataConsent=g);let w=u.Z.uuidv4();w&&""!==w||(w=Oe());try{if(d&&!d.transactionId){const t=fe(e)??void 0,i=(0,ie.Im)(t),o=(0,ie.RT)(i,(0,T.Ek)());o&&(d.transactionId=o)}}catch(e){}if(d&&(d?.transactionId||d?.purchaseTotal||d?.numberOfItems||d?.productNames)){let u=!0,g="";if(0===e?.retailerData?.domainName.indexOf("amazon")&&(d.transactionId=(0,ie.Tb)("purchaseId",(0,T.Ek)())||""),d?.transactionId&&e?.retailerData?.confirmationPageTelemetry?.isCartCachingEnabled){const e=(0,P.Mw)(d.transactionId);e&&Date.now()-parseInt(e,10)<12096e5?(u=!1,g="do not send data. Expity not reached",(0,P.Xo)(d.transactionId,Date.now().toString())):(0,P.Xo)(d.transactionId,Date.now().toString())}if(u){let u="Confirmation page telemetry";if(e.retailerData.confirmationPageTelemetry.isCartCachingEnabled&&(!d.productNames||!d.purchaseTotal)){const e="no cart data cached";Se(b,"ConfirmationPageValidation",e,h.in.Error),u+=", "+e}if(_?.error&&(u+=", "+_.error),f&&(!d.productNames||!d.purchaseTotal||!d.transactionId)){const t=`${d.productNames?"":"Empty productNames;"}${d.purchaseTotal?"":"Empty purchaseTotal;"}${d.transactionId?"":"Empty transactionId;"}`;L.Z.GetHtmlFragmentCollectionService().CollectFragmentOnConfirmationPage(e,C||"",t)}N=function(e,t,i,o,a,r,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 A=t.productNames,f=t.transactionId??"",v="",E=!1,P=!1,I=t.orderConfirmationPageUrl;const O=ee.Z.getFactory()?.getPersonalDataRemover(),y=ee.Z.getFactory()?.getDynamicTransactionId();O&&(f=O.maskDataInAString(t?.transactionId),A=O.maskDataInAString(A),I=O.deleteSecretsInURL(I));try{E=y.isEnabledDynamicTransactionId(a?.retailerData?.settings)??!1,({dynamicTransactionId:v,isValidDynamicTransactionId:P}=y.getDynamicTransactionId(a?.retailerData?.settings)),P&&(f=v)}catch{}const D=L.Z.GetLocalDataService(),b=D.GetSessionIds()?.retailerSessionId??"",N=D.GetSessionIds()?.pageVisitId??"",R={Currency:t.currency??"",Domain:(0,T.S8)(),DriverEvaluate:d?JSON.stringify(d):"",EventId:i,IsChromeDriver:p??"",IsElectron:g,NavigatorWebdriver:navigator.webdriver??!1,NumberOfItems:t.numberOfItems??"",OrderConfirmationPageUrl:I??"",OrderConfirmationPageUrlRegex:(0,T.og)(I,a.orderConfirmationPageUrlRegex),OrderDiscountCode:t.orderDiscountCode??"",OrderDiscountPrice:t.orderDiscountPrice??"",OrderShippingPrice:t.orderShippingPrice??"",OrderSubTotalPrice:t.orderSubTotalPrice??"",OrderTaxesPrice:t.orderTaxesPrice??"",Platform:a.platform??"",PricePerItem:t.pricePerItem??"",ProductIdSku:t.productIdSku??"",ProductNames:A??"",ProductSellerNames:t.productSellerNames??"",PurchaseTotal:t.purchaseTotal??"",QuantityPerItem:t.quantityPerItem??"",ProductBrandNames:t.productBrandNames??"",PersonalizationDataConsent:t.personalizationDataConsent,Rguid:o?.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:a.retailerData?.domainName??"",ExactConfirmationPageUrl:a.retailerData?.orderConfirmationPageUrl??"",ESF:r,Anid:n??"",ActiveCashbackOffers:o?JSON.stringify(o):"",IsAADSignedIn:s??null,PageUrlFields:fe(a)??null,PageVisitId:N??"",RetailerSessionId:b??"",DynamicTransactionId:v??"",IsDynamicTransaction:E??null};return Se(c?R:function(e){try{return{Domain:e.Domain,PageType:"ConfirmationPage",Metadata:JSON.stringify(e),PageVisitId:e.PageVisitId,RetailerSessionId:e.RetailerSessionId,Message:"",PageUrl:e.OrderConfirmationPageUrl,CartData:"",IsError:!1,PageRegexUsed:"",IsBrokenSelectorDetected:!1,IsPartialBrokenSelectorDetected:!1,BrokenSelectors:"",FullSelectorUsed:"",PartialSelectorUsed:"",ExtractionResult:"",ErrorMessage:"",Currency:e.Currency,AFDMarket:"",IsSignedIn:!1,PersonalizationDataConsent:e.PersonalizationDataConsent??!1,ExtractionId:""}}catch(e){}return{}}(R),c?"ConfirmationPageDetails":"SelectorDataExtraction",c?e:"isNewExtraction: false; "+e,h.in.Information),c?R:void 0}(u,d,w,t,e,r,o,n,f),await async function(e,t,i,o,a,r){if(e&&i.transactionId&&""!==i.transactionId&&i.productNames&&""!==i.productNames){const n=i.transactionId,u=a.retailerData.domainName,d=i.currency,g=i.purchaseTotal?Number(i.purchaseTotal.replace(/[^0-9\.]+/g,"")):0,C=i.numberOfItems?Number(i.numberOfItems):0,S=i.productNames,m=i.pricePerItem?.replace(/[^0-9\,]+/g,"")??null;let A="",f="",E="";if(o?.adsCashback&&o?.adsCashback?.length>0?(A=u,f="BingPersonalization"):r&&r.merchantId&&""!==r.merchantId&&r.affiliateNetwork&&""!==r.affiliateNetwork&&(A=r.merchantId,f=r.affiliateNetwork),r&&r.merchantFullName&&""!==r.merchantFullName&&(E=r.merchantFullName),""!==A&&""!==f){const i=function(e,t,i,o,a,r,n,s,u,d,h,g){return{Anid:e,Muid:t,CashbackAmount:0,Currency:s,Domain:n,MerchantName:o,MerchantId:a,AffiliateName:r,PurchaseTotal:u,NumOfItems:d,ProductNames:h,PricePerItem:g,TransactionDate:(new Date).toISOString(),TransactionId:i,Country:"",ClientContext:new l.Z(v.Z.GetClientName(),p.yJ,v.Z.GetBuildVersion(),v.Z.enabledServiceFlights,c.R.GetServiceExperiments(),void 0,c.R.GetExpRawData())}}(e,t,n,E,A,f,u,d,g,C,S,m);if(c.R.isExperimentActive(s.H.sendNativePurchaseDetectionSignal))return void await xe(i);const o="https://www.bing.com/api/shopping/v1/savings/cashback/instant";try{const e={body:JSON.stringify(i),headers:{"Content-Type":"application/json"},method:"POST"},t=await fetch(o,e);await t.json(),200===t.status&&we()}catch(e){!async function(e,t,i){if(Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({error:e})},"ConfirmationPageValidation",`Instant cash back call failed. ${i?"Making call through client using FetchShoppingApi instead":"requestBody not defined"}.`,h.in.Information),i){const e=[t,JSON.stringify(i)];F.R.postMessageToHost("FetchShoppingApi",e),we()}}(e,o,i)}}}}(o,a,d,t,e,i);const g=new RegExp(e.retailerData.orderConfirmationPageUrl,"i").test((0,T.Ek)());if(!(0,te.XB)()&&(R=d)&&R.transactionId&&R.purchaseTotal&&R.productNames&&i?.userRebateResponse?.isRebatesUser&&g)if(Ue(t)){const i=ce(ce({},b),{},{DebugData:JSON.stringify({Source:"isInSessionClick",PersonalizedCashbackData:t,NotificationLastShownCount:I.Q?.PcbNotificationLastShownAdCount})});z.GetEdgeMessageService().TrySendAutoShowFeaturesAvailableMessage(m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION,S.sM.CASHBACKCONFIRMATION)?Se(i,"ConfirmationPageValidation","ConfirmationPageNotification PP cashback",h.in.Information):Ce(i,m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION);const o=I.Q?.PcbNotificationLastShownAdCount??{};o&&(o[e?.retailerData.domainName]=null,z.GetEdgeMessageService().SendStorageMessage(A.Q.PcbNotificationLastShownAdCount,JSON.stringify({value:o})))}else if(function(e,t){const i=e?.adsCashback?.length>0&&""!==e?.adsCashback[0].commissionValue&&""!==e?.adsCashback[0].commissionType,o=I.Q?.PcbNotificationLastShownAdCount;let a={};return(!o||(a=o,"1"!==o[t]))&&(a[t]="1",z.GetEdgeMessageService().SendStorageMessage(A.Q.PcbNotificationLastShownAdCount,JSON.stringify({value:a})),i)}(t,e?.retailerData.domainName)){const e=ce(ce({},b),{},{DebugData:JSON.stringify({Source:"wasNotificationAlreadyShown",PersonalizedCashbackData:t,NotificationLastShownCount:I.Q?.PcbNotificationLastShownAdCount})});z.GetEdgeMessageService().TrySendAutoShowFeaturesAvailableMessage(m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION,S.sM.CASHBACKCONFIRMATION)?Se(e,"ConfirmationPageValidation","ConfirmationPageNotification PP cashback",h.in.Information):Ce(e,m.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION)}else Se(ce(ce({},b),{},{DebugData:JSON.stringify({PersonalizedCashbackData:t,NotificationLastShownCount:I.Q?.PcbNotificationLastShownAdCount})}),"ConfirmationPageValidation","ConfirmationPageNotification already shown",h.in.Information);else(0,te.XB)()||Se(ce(ce({},b),{},{DebugData:JSON.stringify({UserRebatesResponse:JSON.stringify(i?.userRebateResponse??{}),TransactionId:d?.transactionId,PurchaseTotal:d?.purchaseTotal,ProductNames:d?.productNames,IsConfirmationPage:g})}),"ConfirmationPageValidation","Data not valid for confirmation autoshow",h.in.Information);if(await ve(w,"ConfirmationPage"),e?.retailerData?.confirmationPageTelemetry?.isCartCachingEnabled){const t=e?.retailerData?.exactConfirmationPageUrl;if(t)try{new RegExp(t,"i").test((0,T.Ek)())&&(_e("Deleting cart data. exactConfirmationPageUrl matched"),(0,P.UZ)(D.OY),ke(e.retailerData.domainName))}catch(t){_e("Deleting cart data. Error with regex"),(0,P.UZ)(D.OY),ke(e.retailerData.domainName)}else _e("Deleting cart data. No exactConfirmationPageUrl"),(0,P.UZ)(D.OY),ke(e.retailerData.domainName)}}else Se(ce(ce({},b),{},{DebugData:JSON.stringify({ConfirmationPageDetails:d})}),"ConfirmationPageValidation",g,h.in.Error)}else Se(ce(ce({},b),{},{DebugData:JSON.stringify({ConfirmationPageDetails:d,errorMsg:_?.error||""})}),"ConfirmationPageValidation","Confirmationpagedetails no data extracted",h.in.Error);try{await async function(e){try{if(null==e.retailerData?.allAutomatedSelectors)return void _e("PersonalizedPromotions Error",{message:"no automated selectors"});const t=e.retailerData.allAutomatedSelectors,i=(0,T.Ek)();for(const o of t)if(o?.type===h.u3.PurchaseConfirmed&&new RegExp(o.urlRegex?.toLowerCase()??"").test(i.toLowerCase())){if(null===o.details||0===Object.keys(o.details).length)continue;return void Pe(o,e.retailerData.domainName)}_e("PersonalizedPromotions Error",{message:"no PurchaseConfirmed selectors found"})}catch(e){_e("PersonalizedPromotions Error",{message:"catch error",error:e})}}(e),(0,P.UZ)(k.Vj),function(e){try{const t=I.Q?.PersonalizedPromotionsCartData??"",i=(0,T.BQ)(t)??{};i[e]={};const o=JSON.stringify({value:JSON.stringify(i)});z.GetEdgeMessageService().SendStorageMessage(A.Q.PersonalizedPromotionsCartData,o)}catch(e){Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)()},"ConfirmationPageValidation",(e?.message??" ")+"error deleting persistent cart data",h.in.Error)}}(e.retailerData.domainName)}catch(e){Se(b,"ConfirmationPageValidation","Error when extracting automated selectors: "+(e?.message??""),h.in.Error)}}}catch(e){Se(b,"ConfirmationPageValidation",(e?.message??" ")+"confirmationpage cart details extraction error.",h.in.Error)}var R}(t,i,o,n,d,g,C,0,E,y,b))}function fe(e){try{const t=e?.retailerData?.allAutomatedSelectors||[],i=(0,T.Ek)();for(const e of t)if(e?.type===h.u3.PurchaseConfirmed&&new RegExp(e.urlRegex).test(i.toLowerCase()))return e?.urlFields}catch(e){}return null}async function ve(e,t){let i="",o="";await(0,f._R)(1e3);const a=document.querySelectorAll('[id^="batBeacon"] > img');if(a)for(const e of a)if(e?.currentSrc){const t=new URL(e.currentSrc),a=t?.searchParams.get("mid"),r=t?.searchParams.get("ti");a&&r&&(i+=a+",",o+=r+",")}i=i.length>0?i.substring(0,i.length-1):"",o=o.length>0?o.substring(0,o.length-1):"",Se({Domain:(0,T.S8)(),EventId:e,ImpressionId:ue,Mid:i,PageType:t,TagId:o},"ConfirmationPageUetEvent","ConfirmationPage UET Event",h.in.Information)}async function Ee(e,t,i,o){if(!e)return null;const r=new $;let n,s,c,l,u,d=0,p="";r.personalizationDataConsent=o,r.orderConfirmationPageUrl=(0,T.Ek)(),r.domainType=r.domainType;try{let e=L.Z.GetCartExtractionService().GetLastTravelData();if(e)p+="cached:"+JSON.stringify(e??{})+"; ";else{const i=I.Q?.PersistentTravelData,o=((0,T.BQ)(i)??{})[t]??{},a=o?.travelDataStorageInfo??{};p+="persistent:"+JSON.stringify(a)+";",a&&Object.keys(a).length&&(e=a)}if(e){if(d+=e.Price,r.currency=e.Currency,r.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;r.name=u,r.startDate=c,r.endDate=l}}catch(e){p+="error getting travel data from checkout: "+e+";",Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)()},"ConfirmationPageValidation",p,h.in.Error)}if(e.bookingIdSelector&&""!==e.bookingIdSelector&&(s=M.Z.GetBoxValue(e.bookingIdSelector),s&&(r.bookingId=s)),e.nameSelector&&""!==e.nameSelector&&(u=M.Z.GetBoxValue(e.nameSelector),u&&(r.name=u)),e.totalPriceSelector&&""!==e.totalPriceSelector){const t=M.Z.GetOrderTotalString(e.totalPriceSelector),i=(0,E.cU)(t);n=String((0,E.K)(t,i)),n&&(r.price=n),(0,a.TF)(i)||(r.currency=i)}if(r.price&&""!==r.price||(r.price=d.toString()),e.startDateSelector&&""!==e.startDateSelector&&(c=M.Z.GetBoxValue(e.startDateSelector),c&&(r.startDate=c)),e.endDateSelector&&""!==e.endDateSelector&&(l=M.Z.GetBoxValue(e.endDateSelector),l&&(r.endDate=l)),(0,ne.kO)(r.startDate,r.endDate,e.dateSeparationRegex)&&([r.startDate,r.endDate]=(0,ne.Ox)(r.startDate,r.endDate,e.dateSeparationRegex)),r.startDate=(0,ne.Pf)(r.startDate,e.dateCleaningRegex),r.endDate=(0,ne.Pf)(r.endDate,e.dateCleaningRegex),e.isRoundTripSelector&&""!==e.isRoundTripSelector){const t=M.Z.GetBoxValue(e.isRoundTripSelector);t&&(r.isRoundTrip=t)}return r.bookingId&&""!==r.bookingId||(p+="no bookingId; "),r.domainType&&""!==r.domainType||(r.domainType=e.domainType),{travelConfirmationDetails:r,error:p}}async function Pe(e,t){try{if(!e)return void _e("PersonalizedPromotions Error",{message:"no automated selectors for personalized promotions pipeline found, aborting"});if(e?.type!==h.u3.PurchaseConfirmed)return void _e("PersonalizedPromotions Error",{message:"Not a confirmation page, pageType: "+e?.type});if(null===e.details)return void _e("PersonalizedPromotions Error",{message:"No selectors provided for page url"});const i=new _.Z;if(i.domain=t,i.pageType=e.type,i.pageUrl=(0,T.Ek)(),i.orderId=M.Z.GetBoxValue(e.details.orderId),i.orderTotal=Ie(e.details.orderTotalPrice),i.orderSubtotal=M.Z.GetBoxValue(e.details.orderSubTotalPrice),i.productName=await De(e.details.productName),i.productItemPrice=await De(e.details.productItemPrice),i.productTotalPrice=await De(e.details.productTotalPrice),i.productPrice=await De(e.details.productPrice),i.productQuantity=await De(e.details.productQuantity),i.productId=await De(e.details.productId),(0,a.TF)(i.productName)&&"true"===e.details.getProductNamesFromImg&&e.details.productImgSelector){const t=y.Z.RunQuerySelectorAll(e.details.productImgSelector);let o="";for(const e of t){const t=e?.getAttribute("alt");t&&(o+=t+"<SEP>")}i.productNameFromImg=o}i.pageUrlFields=e.urlFields;const o="Successfully extracted Personalized Promotions Purchase Confirmation Information";Se(i,h.R.ShoppingPersonalizedPromotionsRawTable,o,h.in.Information)}catch(e){_e("PersonalizedPromotions Error",{message:"catch error",error:e})}}function Ie(e){let t="";if(e&&e.includes(",")){const o=e.split(",").reverse();let a=!1;for(const e of o){const o=M.Z.GetBoxValue(e);if(o&&(i=o,new RegExp("/[0-9]/").test(i))){a=!0,t=o;break}}a||(t=M.Z.GetBoxValue(e))}else t=M.Z.GetBoxValue(e);var i;return t?t.trim():""}async function Te(e,t,i,o=!1,r=!1,n=!1){const s=L.Z.GetLocalDataService(),c=s.GetSessionIds()?.retailerSessionId??"",l=s.GetSessionIds()?.pageVisitId??"",d={Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),PageVisitId:l,RetailerSessionId:c};if(!e)return Se(d,"ConfirmationPageValidation","ConfirmationTelemetry selectors not found",h.in.Information),null;Se(d,"ConfirmationPageValidation","Data extraction started",h.in.Information);const p=new B.Z;let g,C,S,m,A,v,P,O,b;const N=e.orderIdSelectors??"";let R="";p.orderConfirmationPageUrl=(0,T.Ek)(),A="";try{if(e.isCartCachingEnabled){const e=L.Z.GetCartExtractionService();let i=e.GetLastCartData();const a=e.GetFastCart(),s=!r&&void 0!==i?.Products?.find((e=>!e.productTitle||""===e.productTitle));if(i||(R+="Cart data from local storage is empty;"),a&&(R+="fastCart:"+JSON.stringify(a??{})+";",i||n||(i=a)),!i||null==i.Products||i.Products?.length<=0||s){const e=I.Q?.PersistentCartData,o=((0,T.BQ)(e)??{})[t]??{},a=o?.cartDataStorageInfo??{};R+="persistent:"+JSON.stringify(a)+"; ";const n=!!r&&void 0!==a?.Products?.find((e=>!e.productTitle||""===e.productTitle));Object.keys(a).length&&!n&&(i=a)}else R+="cached:"+JSON.stringify(i??{})+"; ";const c=Boolean(i&&Date.now()-i.CartDataCreationTime<=D.l$);if(!i||!c&&o)R+=`No cached cart data found; isCardDataPresent: ${!!i}; isNotExpiredCart: ${c}; Time: ${Date.now().toString()};`,Se(d,"ConfirmationPageValidation",R,h.in.Error);else{R+="Using cached cart data; ";const e="<SEP>";let t=0;S="",m="",v="",P="",b="";const o=void 0!==i?.Products?.find((e=>!0===e.buyNowItem));let a=0;if(i.Products){for(const r of i.Products)o&&!0!==r.buyNowItem||(a++,r.productTitle&&(S+=r.productTitle+e),r.productPrice&&(t+=r.productPrice,v+=i.Currency+r.productPrice?.toString()+e),r.productQuantity&&(P+=r.productQuantity?.toString()+e),r.productSeller&&(m+=(r.productSeller?.replace("Sold by:","")||"")+e),b+=(r.productBrand??"")+e);p.numberOfItems=a>0?a.toString():""}if(S=S?S.trim():S,S&&(p.productNames=S),null!==v&&""!==v&&(p.pricePerItem=v),null!==P&&""!==P&&(p.quantityPerItem=P),i&&i.ProductIds&&""!==i.ProductIds&&(p.productIdSku=i.ProductIds),i&&i.ProductUrls&&""!==i.ProductUrls&&(p.productUrls=i.ProductUrls),m&&(p.productSellerNames=m),b&&(p.productBrandNames=b),void 0!==i.Currency){let e=0;null!=i.OrderSubTotal&&!isNaN(i.OrderSubTotal)&&i.OrderSubTotal>=0&&(p.orderSubTotalPrice=i.Currency+i.OrderSubTotal.toString(),e=i.OrderSubTotal);let o=i.OrderTotal??0;o=isNaN(o)?0:o,o>0?p.purchaseTotal=i.Currency+i.OrderTotal.toString():e>0?p.purchaseTotal=p.orderSubTotalPrice:t>0&&(p.purchaseTotal=i.Currency+t.toString()),p.currency=i.Currency}}}else R+="cart caching not enabled;"}catch(e){R+="error during cart extraction from cache: "+e+"; ",Se(d,"ConfirmationPageValidation",R,h.in.Error)}if(e?.productDetailsData?.length&&e?.productDetailsData?.length>0){S="",v="",P="",O="";let i=0;for(const o of e?.productDetailsData){if("microsoft.com"===t){const e="div[class*='lineItemRow']",t="div[class*='bundleItems']";await(0,f.dz)((async()=>void 0!==y.Z.GetFirstVisibleElement(e)),5e3);const a=y.Z.RunQuerySelectorAll(e);if(a&&a.length>0)for(const e of a)if(null==y.Z.GetFirstVisibleElement(t,e)){await(0,f.dz)((async()=>void 0!==y.Z.GetFirstVisibleElement(o?.productIdSelector??"",e)),5e3);let t=y.Z.GetFirstVisibleElement(o?.productPriceSelector??"",e);t&&t.textContent&&(v+=t.textContent?.trim()+"<SEP>"),t=y.Z.GetFirstVisibleElement(o?.productIdSelector??"",e),t&&t.textContent&&(S+=t.textContent?.trim()+"<SEP>",i++),t=y.Z.GetFirstVisibleElement(o?.productQuantitySelector??"",e),t&&t.textContent&&(P+=t.textContent?.trim()+"<SEP>")}i>0&&(A=i.toString())}if("microsoft.com"!==t||""===S){const e="wayfair.com"===t?1e4:5e3;if(o?.productIdSelector&&""!==o?.productIdSelector){let t;await(0,f.dz)((async()=>(t=y.Z.GetFirstVisibleElement(o?.productIdSelector??""),void 0!==t)),e);let a=y.Z.RunQuerySelectorAll(o?.productIdSelector??"");if(a.length>0)for(const e of a)e&&e.textContent&&(S+=e.textContent?.trim()+"<SEP>",i++);else{a=Ne(o?.productIdSelector??"");for(const e of a)e&&e.textContent&&(S+=e.textContent?.trim()+"<SEP>",i++)}}v=await ye(o,t),P=await De(o?.productQuantitySelector,0),O=await De(o?.productIdSkuSelector,0),i>0&&(A=i.toString())}}if(S=S?S.trim():S,S&&(p.productNames=S),null!==v&&""!==v)p.pricePerItem=v;else if("jossandmain.com"===t&&null!==S){R+="no price per item but there are product names;";for(const i of e?.productDetailsData)v=await ye(i,t);R+=v+";",p.pricePerItem=v}null!==P&&""!==P&&(p.quantityPerItem=P),null!==O&&""!==O&&(p.productIdSku=O)}const _=await async function(e){try{if(!e)return"";const t=(0,ie.ql)(e,(0,T.Ek)());if(t)return t;const i=await async function(e){const t=(e?.split(",")??[]).filter((e=>!(0,ie.Ae)(e))).join(",");let i=await(0,f.dz)((async()=>y.Z.HasVisibleElement(t)),5e3).then((()=>M.Z.GetBoxValue(t))).catch((e=>M.Z.GetBoxValue(t)));return i=M.Z.GetBoxValue(t),i}(e);return i}catch(t){_e("Error getting transaction id",{message:t.message,transactionIdSelector:e??""})}return""}(e?.transactionIdSelector);if(p.transactionId=_,"replacements.com"===t||"us.puma.com"===t&&!p.transactionId){let e=u.Z.uuidv4();e&&""!==e||(e=Oe());const t=Date.now()+"_"+e;p.transactionId=t}try{!N||""===N||p.transactionId&&""!==p.transactionId||(C=await Re(N),p.transactionId=C)}catch(e){}null!==A&&""!==A?p.numberOfItems=A:e?.transactionIdSelector&&""!==e?.transactionIdSelector&&(A=M.Z.GetBoxValue(e?.numItemsSelector??""),null!=A&&""!==A&&(p.numberOfItems=A)),p.orderDiscountCode=be(e?.orderDiscountCodeSelector),p.orderDiscountPrice=be(e?.orderDiscountPriceSelector),p.orderShippingPrice=be(e?.orderShippingPriceSelector),p.orderTaxesPrice=be(e?.orderTaxesPriceSelector);const k=be(e?.orderSubTotalPriceSelector);if(k&&(p.orderSubTotalPrice=k),e?.purchaseTotalSelector&&""!==e?.purchaseTotalSelector){if("petsmart.com"===t||"jlobeauty.com"===t||"homedepot.com"===t||"shopify"===i){const t=e?.purchaseTotalSelector;g=await(0,f.dz)((async()=>y.Z.HasVisibleElement(t)),5e3).then((()=>M.Z.GetBoxValue(t))).catch((e=>M.Z.GetBoxValue(t)))}else g=Ie(e.purchaseTotalSelector);try{if(g){const e=(0,E.K)(g);!isNaN(e)&&e>0&&(p.purchaseTotal=g);const t=(0,E.cU)(g,!0);(0,a.TF)(t)||(p.currency=t)}else if(p.pricePerItem&&""!==p.pricePerItem){const e=(0,E.cU)(p.pricePerItem,!0);(0,a.TF)(e)||(p.currency=e)}}catch(e){_e("Error extracting currency",{message:"Could not extract currency: "+e})}}const w=function(e){try{const t=I.Q?.CartValues,i=((0,T.BQ)(t)??{})[e]??{};if(i?.cartValue)return i.cartValue}catch(e){}}(t);if(w&&(R+="CartValue: "+JSON.stringify(w)+"; "),("wayfair.com"===t||e.isCartCachingEnabled||"jossandmain.com"===t)&&!p.purchaseTotal)try{w&&w.OrderTotal&&w.OrderTotal>=0&&(p.purchaseTotal=w.Currency+w.OrderTotal.toString(),p.currency=w.Currency),R+="got purchaseTotal from CartValue "+p.purchaseTotal+"; "}catch(e){R+="error getting purchaseTotal from cart: "+e}if(!("walmart.com"!==t&&0!==t.indexOf("amazon")||null!=p.productNames&&""!==p.productNames)&&e?.productDetailsData){if(S="",e.productDetailsData.length>0){const t=e.productDetailsData[0].productImageSelector;if(null!=t){const e=y.Z.RunQuerySelectorAll(t);for(const t of e){const e=t.getAttribute("alt");S+=e?.trim()+"<SEP>"}}}S=S?S.trim():S,S&&(p.productNames=S,R+="got productNames from productImage: "+S+";")}return Se(d,"ConfirmationPageValidation","Data extraction complete",h.in.Information),{confirmationDetails:p,error:R}}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 ye(e,t){let i="";if(e?.productPriceSelector&&""!==e?.productPriceSelector){let o,a=[],r=5e3;"wayfair.com"===t&&(r=1e4),await(0,f.dz)((async()=>(o=y.Z.GetFirstVisibleElement(e?.productPriceSelector??""),void 0!==o)),r),a=y.Z.RunQuerySelectorAll(e?.productPriceSelector);for(const e of a)e&&e.textContent&&(i+=e.textContent?.trim()+"<SEP>");if((!a||0===a.length)&&(a=Ne(e?.productPriceSelector??""),a.length>0))for(const e of a)e&&e.textContent&&(i+=e.textContent?.trim()+"<SEP>")}return i}async function De(e,t=5e3){let i="";if(e&&""!==e){let o,a=[];await(0,f.dz)((async()=>(o=y.Z.GetFirstVisibleElement(e??""),void 0!==o)),t),a=y.Z.RunQuerySelectorAll(e);for(const e of a)e&&e.textContent&&(i+=e.textContent?.trim()+"<SEP>");if((!a||0===a.length)&&(a=Ne(e??""),a.length>0))for(const e of a)e&&e.textContent&&(i+=e.textContent?.trim()+"<SEP>")}return i}function be(e){if(e&&""!==e){const t=M.Z.GetBoxValue(e);if(null!=t&&""!==t)return t}return null}function Ne(e){return e&&""!==e?document.getElementsByClassName(e):[]}async function Re(e){if(!e)return"";try{return await(0,f.dz)((async()=>y.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 _e(e,t=void 0){Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:t?JSON.stringify(t):""},"ConfirmationPageValidation",e,h.in.Information)}function ke(e){try{const t=I.Q?.PersistentCartData??"",i=(0,T.BQ)(t)??{};i[e]={};const o=JSON.stringify({value:JSON.stringify(i)});z.GetEdgeMessageService().SendStorageMessage(A.Q.PersistentCartData,o);const a=I.Q?.CartValues??"",r=(0,T.BQ)(a)??{};r[e]={};const n=JSON.stringify({value:JSON.stringify(r)});z.GetEdgeMessageService().SendStorageMessage(A.Q.CartValues,n)}catch(e){Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)()},"ConfirmationPageValidation",(e?.message??" ")+"error deleting persistent cart data",h.in.Error)}}function we(){"EligibleUser"===I.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()})))}const xe=async e=>{const t=L.Z.GetClientRequestsService(),i=await t.SendRequest("PurchaseDetection","InstantCashback",e);"OK"===i?.response.status?we():(e.Anid="",Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({request:e,response:i?.response})},"ConfirmationPageValidation","native client request failed for instant cashback",h.in.Information))};function Ue(e){return e&&e.isAdClick&&e.commissionType&&e.commissionValue}function Me(e){return e&&""!==e?["https://","http://","www."].some((t=>e.startsWith(t)))?e:location.origin+e:""}function Le(e,t,i){try{const o=function(e,t){if(!t||!t.Products?.length)return void Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)()},"ConfirmationPageValidation","createPostPurchaseProducts: CartData not found.",h.in.Information);const i=[],o=[];for(const a of t.Products){const r=a.productTitle?a.productTitle:a.foundInWebAssist&&a.webAssistTitle?a.webAssistTitle:"",n=a.productImg?a.productImg:a.foundInWebAssist&&a.webAssistImg?a.webAssistImg:"",s=a.productPrice?a.productPrice:a.foundInWebAssist&&a.webAssistPrice?a.webAssistPrice:0,c=t?.Currency??"",l=Me(a.productUrl),u=!!r.length&&0!==s&&!!l.length,d={Title:r,ImageUrl:n,Price:s,Currency:c,Muid:e,Url:l,isValid:u};u?i.push(d):o.push(d)}if(o?.length){const e=I.Q?.PostPurchasePathnameProducts,a=[];if(e){for(const t of o)if(t.Title.length)for(const i of e)t.Title===i.productTitle&&(t.ImageUrl=i.productImg,t.Price=i.productPrice,t.Url=Me(i.productUrl),t.isValid=!!t.Title.length&&0!==t.Price&&!!t.Url.length,t.isValid&&a.push(t));const r={Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({cartProducts:t?.Products,validProducts:i,invalidProducts:o,fixedProducts:a,pathnameProducts:e})};i.push(...a);let n="createPostPurchaseProducts: Invalid product(s) were ";a.length===o.length?n+="all fixed":a.length?n+="partially fixed":n+="not fixed",Se(r,"ConfirmationPageValidation",n,h.in.Information),z.GetEdgeMessageService().SendStorageMessage(A.Q.PostPurchasePathnameProducts,JSON.stringify([]))}else Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({cartProducts:t?.Products,validProducts:i,invalidProducts:o,fixedProducts:a,pathnameProducts:e})},"ConfirmationPageValidation","createPostPurchaseProducts: Invalid product(s) were found with no pathname products",h.in.Information)}return i}(t,e);if(void 0===o)return;return o&&o.length?{headers:{"Content-Type":"application/json",Source:"ProductTracking",Service:i},method:"POST",body:JSON.stringify({Muid:t,Products:o,TrackingSource:2})}:void Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({CartProducts:e?.Products,products:o,service:i})},"ConfirmationPageValidation","createPostPurchaseRequest: No request body",h.in.Error)}catch(e){Se({Domain:(0,T.S8)(),PageUrl:(0,T.Ek)(),DebugData:JSON.stringify({e:e})},"ConfirmationPageValidation","createPostPurchaseRequest: Uncaught error",h.in.Error)}}window.CheckAndIsConfirmationPageValid=function(e,t){(0,T.cz)()||de(e,t)},window.IsConfirmationPageValid=de,window.confirmationPageValidatorRuntime=F.R},69315:function(e,t,i){i.d(t,{R:function(){return r}});var o=i(89366);class a extends o.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 r=new a},9448:function(e,t,i){i.d(t,{H:function(){return o}});let o=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,i){var o=i(72370),a=i(23727),r=i(57021);class n extends r.Z{constructor(...e){super(...e),(0,o.Z)(this,"StartTime",void 0),(0,o.Z)(this,"CouponsApplied",void 0),(0,o.Z)(this,"ContextID",void 0),(0,o.Z)(this,"InitialPrice",void 0),(0,o.Z)(this,"TrueInitialPrice",void 0),(0,o.Z)(this,"UnremovedDiscountSum",void 0),(0,o.Z)(this,"BestCoupon",void 0),(0,o.Z)(this,"MaxDiscount",void 0),(0,o.Z)(this,"CouponResults",void 0),(0,o.Z)(this,"ImpressionId",void 0),(0,o.Z)(this,"StringifiedMap",void 0),(0,o.Z)(this,"ImportOptions",void 0),(0,o.Z)(this,"Currency",void 0),(0,o.Z)(this,"PageCurrency",void 0),(0,o.Z)(this,"CashBackActive",void 0),(0,o.Z)(this,"AppliedCoupon",void 0),(0,o.Z)(this,"BackgroundAACancelled",void 0),(0,o.Z)(this,"BackgroundAAStatus",void 0),(0,o.Z)(this,"SuggestedCoupons",void 0),(0,o.Z)(this,"ExtractedInputBox",void 0),(0,o.Z)(this,"ExtractedApplyButton",void 0),(0,o.Z)(this,"ExtractedOrderTotalElement",void 0),(0,o.Z)(this,"CartBlockedCoupons",void 0),(0,o.Z)(this,"HideProgressOverlay",void 0),(0,o.Z)(this,"Metadata",void 0)}static CreateNew(e,t){const i=new n(n.fourMinutesExpiryInSeconds);return i.ContextID=e,i.StartTime=Date.now(),i.CouponsApplied=new Map,i.UnremovedDiscountSum=0,i.MaxDiscount=0,i.CouponResults=[],i.BackgroundAAStatus=new a.Z,t&&(i.ImpressionId=t),i}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 i=e[0],o=e[1];t.CouponsApplied.set(i,o)})),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,o.Z)(n,"fourMinutesExpiryInSeconds",480),t.Z=n},8018:function(e,t,i){i.d(t,{c:function(){return o}});let o=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,i){i.d(t,{a:function(){return n}});var o=i(89366),a=function(e){return e.StartAutoApply="StartAutoApply",e.GetZipUrlStatus="GetZipUrlStatus",e.UpdatePaymentDetails="UpdatePaymentDetails",e.WalletMessageFromHost="WalletMessageFromHost",e.BgaaMessageFromHost="BgaaMessageFromHost",e.RewardsPromotionsAvailable="RewardsPromotionsAvailable",e}(a||{});class r extends o.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(a[t]){case a.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 a.GetZipUrlStatus:window.handleBNPLResult(e[0]);break;case a.UpdatePaymentDetails:window.ExecuteUpdatePaymentDetails(e);break;case a.WalletMessageFromHost:window.HandleWalletMessageFromHost(e[0],e[1]);break;case a.BgaaMessageFromHost:const i=e[0];"RestartBgaa"===i?window.RestartBackgroundAutoApply():"CancelBgaa"===i&&window.CancelBackgroundAutoApply();break;case a.RewardsPromotionsAvailable:window.UpdateRewardsData(e);break;default:throw new Error("Unknown message type: "+t)}}getNativeHandler(){return autoApplyNativeHandler}}const n=new r},23727:function(e,t,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"BgAutoApplyInProgress",void 0),(0,o.Z)(this,"ForegroundApplyingBestCoupon",void 0),(0,o.Z)(this,"progressBarStartPos",void 0),(0,o.Z)(this,"progressBarEndPos",void 0),(0,o.Z)(this,"currentCoupon",void 0),(0,o.Z)(this,"currentCouponIndex",void 0),(0,o.Z)(this,"couponsTotal",void 0),(0,o.Z)(this,"result",void 0),(0,o.Z)(this,"expiredState",void 0),(0,o.Z)(this,"pageUrl",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"isBgaaFinished",void 0),(0,o.Z)(this,"hasNotifiedUser",void 0)}}},28219:function(e,t,i){var o=i(29247),a=i(90066);class r{static GetCouponStatusMessages(e,t,i){return{statusMessage:r.GetErrorMessage(e)||"",successMessages:t?.map((e=>a.Z.GetTextValue(e)))||[],failureMessages:i?.map((e=>a.Z.GetTextValue(e)))||[]}}static GetErrorMessage(e){if(e&&(0,o.UE)(e)&&a.Z.CountVisibleElements(e)>0)return a.Z.GetTextValue(e)}}t.Z=r},77776:function(e,t,i){var o=i(35062),a=i(29247),r=i(36493),n=i(27689),s=i(9448),c=i(82315),l=i(1094),u=i(11849),d=i(52056),h=i(90066);class p{static IsECPage(e){if(e&&e.checkoutData){const t=new o.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=[],i=e?.AllcheckoutCompletionPages?.get("ShippingAddress");if(i){const e=i.CheckoutElements.get("address1"),o=i.CheckoutElements.get("clickBefore");e&&e.Value&&t.push(e),o&&o.Value&&t.push(o)}const o=e?.AllcheckoutCompletionPages?.get("ContactInfo");if(o){const e=o.CheckoutElements.get("email"),i=o.CheckoutElements.get("clickBefore");e&&e.Value&&t.push(e),i&&i.Value&&t.push(i)}return t}static IsECURLMatch(e,t){let i=!1;return e&&e.CheckoutPageUrl&&e.CheckoutPageUrl.split(",").forEach((e=>{i=i||a.ZP.IsOnPage(e,t)})),i}static GetExpressCheckoutGMVSelector(e){const t=e?.retailerData?.allFinalCheckoutPages??[],i=t?.filter((e=>"none"!==e?.enabledTips&&a.ZP.IsOnPage(e?.checkoutPageUrl,location.pathname)));let r;if(i?.length>0&&(r=i[0]?.orderTotalDataElementSelector),e.checkoutData){const t=new o.Z(e.checkoutData),i=t?.AllcheckoutCompletionPages?.get("OrderInfo");r=i?.CheckoutElements?.get("orderTotal")?.Value??r}return r}static async GetExpressCheckoutGMV(e,t,i){let o={OrderTotal:-1,Currency:"$",PageCurrency:""};if(e&&a.ZP.IsValidDataField(e)){await a.ZP.WaitForCondition((async()=>h.Z.HasVisibleElement(e)),i??5e3);const r=l.Z.CreateCheckoutPageData(t),s=(0,n.uf)(r?.market,r.retailerData?.exclusiveMarket);o=u.Z.GetCartValue(e,s)}return o}static async GetAndSendExpressCheckoutPageGMV(e){const t=c.Z.getApiResponse();try{const i=p.GetExpressCheckoutGMVSelector(e);if(i){const o=await p.GetExpressCheckoutGMV(i,e),{OrderTotal:a,Currency:r}=o;if(a&&a>0)return this.SendExpressCheckoutGMVMessage(a,r,e.traceId),void d.Z.SendLogEvent(t.impressionId,"Complete GetAndSendExpressCheckoutPageGMV","true",a);throw new Error(`Shopping cart value is invalid - ${a}`)}}catch(e){d.Z.SendLogEvent(t.impressionId,`GetAndSendExpressCheckoutPageGMV error. ${e?.message}`,"error")}}static SendExpressCheckoutGMVMessage(e,t,i){const o=(0,r.qm)(t)?t:(0,r.Vv)(t)??"USD";d.Z.SendMessage(s.H.ExpressCheckoutPageGMV,[i,e.toString(),o])}}t.Z=p},41310:function(e,t,i){var o=i(72370),a=i(59645),r=i(5144),n=i(75434),s=i(52056);function c(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}t.Z=class{static LogSPBTelemetry(e,t,i,n,l,u={}){const d=new a.Z(e);d.Metadata=JSON.stringify(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?c(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({userInfo:n,responseData:i},u)),s.Z.SendLogEvent(l,t,"",void 0,void 0,r.R.EdgeFlyoutStatus,d)}static IsSearchPage(e,t){const i={isSerp:!1,searchKey:""};if(t&&t.SearchData){const o=this.IsUrlMatchAll(e,t.SearchData);i.isSerp=o.isMatch,i.searchKey=o.matchKey}return i}static IsUrlMatchAll(e,t){for(const i of t){const t=this.IsUrlMatch(e,i);if(t.isMatch)return t}return{isMatch:!1,matchKey:""}}static GetSPBCashbackOffersPdp(e){const t=e?.offer?e.offer:void 0,i=e?.relatedOffers;return{exactMatch:t,relatedOffers:i||[],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,i){const o=e.GetData("variations"),a=(o?(0,n.rm)(o):{})[t];return!(!a||a!==i)}static IsUrlMatch(e,t){let i={isMatch:!1,matchKey:""};return"PathAndParameter"===t.type?i=this.UrlPathParameterMatch(e,t.path,t.parameter):"PathRegexAndParameter"===t.type?i=this.UrlPathRegexParameterMatch(e,t.path,t.parameter):"QueryParam"===t.type?i=this.UrlQueryParameterMatch(e,t.parameter):"PathRegex"===t.type?i=this.UrlPathRegextMatch(e,t.regexData):"ParamRegex"===t.type&&(i=this.UrlParamRegex(e,t.parameter,t.regexData)),i}static UrlParamRegex(e,t,i){let o="",a=!1;const r=e.searchParams.get(t);if(i&&r){const e=r.match(i.regex),t=i.indices;for(const i of t)if(e&&e.length>i&&e[i]){o=e[i],a=!0;break}}return{isMatch:a,matchKey:o}}static UrlPathParameterMatch(e,t,i){let o="";const a=e.searchParams.get(i),r=e.pathname.toLowerCase(),n=(r===(t=t.toLowerCase())||r===t+"/"||r.endsWith(t)||r.endsWith(t+"/"))&&null!=a;return n&&null!=a&&(o=a),{isMatch:n,matchKey:o}}static UrlPathRegexParameterMatch(e,t,i){let o="";const a=e.searchParams.get(i),r=new RegExp(t).test(e.pathname)&&null!=a;return r&&null!=a&&(o=a),{isMatch:r,matchKey:o}}static UrlQueryParameterMatch(e,t){let i="";const o=e.searchParams.get(t),a=null!=o;return a&&null!=o&&(i=o),{isMatch:a,matchKey:i}}static UrlPathRegextMatch(e,t){let i="",o=!1;if(t){const a=e.pathname.match(t.regex),r=t.indices;for(const e of r)if(a&&a.length>e&&a[e]){i=a[e],o=!0;break}}return{isMatch:o,matchKey:i}}}},90066:function(e,t,i){var o=i(29247);class a{static HasVisibleElement(e){return a.CountVisibleElements(e)>0}static CountVisibleElements(e){if(!o.ZP.IsValidDataField(e))return 0;const t=e.split(";");for(const e of t){const t=a.CountVisibleElementsSingleSel(e);if(t>0)return t}return 0}static RunQuerySelectorAll(e,t){if(!o.ZP.IsValidDataField(e))return[];const i=(e=e.replace(/;/g,",")).split("<");let a;a=t?t.querySelectorAll(i[0]):document.querySelectorAll(i[0]);for(const e of i.slice(1)){const t=a[0]?.shadowRoot;if(!t)return[];a=t.querySelectorAll(e)}return a}static IsElementVisible(e){return e&&e.offsetWidth>0&&e.offsetHeight>0}static GetFirstVisibleElement(e,t){if(!o.ZP.IsValidDataField(e))return;const i=e.split(";");for(const e of i)try{const i=a.RunQuerySelectorAll(e,t);for(const e of i)if(a.IsElementVisible(e))return e}catch(e){}}static GetAllVisibleElements(e){if(!o.ZP.IsValidDataField(e))return[];const t=e.split(";"),i=[];for(const e of t){const t=a.RunQuerySelectorAll(e);for(const e of t)a.IsElementVisible(e)&&i.push(e)}return i}static GetTextValue(e,t){if(!e||!o.ZP.IsValidDataField(e))return"";const i=e.split(";"),r=i[0],n=a.GetFirstVisibleElement(r,t);if(!n)return"";let s=n,c=s.innerText;if(1===i.length)s=a.NormalizeIfSuperscripted(n),c=s.innerText;else{const e=s.cloneNode(!0);let o=i[1];const n=a.GetFirstVisibleElement(o,s)??a.GetFirstVisibleElement(o,t);let l="";if(n&&n.innerText){if(l="."+n.innerText,s.contains(n)){const t=a.GetFirstMatchingElement(o,e);if(t?.innerText)e.removeChild(t);else{o.startsWith(r)&&(o=o.slice(r.length));const t=this.GetFirstMatchingElement(o,e);t?.innerText&&e.removeChild(t)}c=e?.innerText?e.innerText:c}c+=l}if(i.length>2){for(const t of i.slice(2)){const i=this.GetFirstMatchingElement(t,e);i?.innerText&&e.removeChild(i)}c=e?.innerText?e.innerText:c}c+=l}return a.StripInvalidJSONCharacters(c)}static GetItemizedData(e,t,i){let o="";if(e&&""!==e){const r=a.RunQuerySelectorAll(e,i);for(const e of r)e&&e.textContent&&(o+=e.textContent?.trim()+t)}return o}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),i=t.childNodes.length;for(let e=0;e<i;e++){const i=t.childNodes[e];if("SUP"===i.tagName){let e=i.innerText;const o=/[0-9\.]+/g.exec(e);if(null!==o)return e="."+o[0],i.innerText=e,t}}}catch(t){return e}return e}static GetFirstMatchingElement(e,t){if(!o.ZP.IsValidDataField(e))return;const i=e.split(";");for(const e of i){const i=a.RunQuerySelectorAll(e,t);for(const e of i)if(e)return e}}static GetAllMatchingElements(e){if(!o.ZP.IsValidDataField(e))return[];const t=e.split(";"),i=[];for(const e of t)try{const t=a.RunQuerySelectorAll(e);for(const e of t)e&&i.push(e)}catch(e){}return i}static CountVisibleElementsSingleSel(e){if(!o.ZP.IsValidDataField(e))return 0;const t=a.RunQuerySelectorAll(e);let i=0;for(const e of t)a.IsElementVisible(e)&&i++;return i}}t.Z=a},41290:function(e,t,i){i.d(t,{Z:function(){return A}});var o=i(72370),a=i(36818),r=i(80090),n=i(58474);class s extends n.Z{constructor(e,t,i,a){super(),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"PreClippingVisibleSelectors",void 0),(0,o.Z)(this,"PostClippingVisibleSelectors",void 0),(0,o.Z)(this,"WasClippingSuccessful",void 0),this.Domain=e,this.PreClippingVisibleSelectors=t,this.PostClippingVisibleSelectors=i,this.WasClippingSuccessful=a}}var c=s,l=i(54774),u=i(5144),d=i(56019),h=i(29247),p=i(50616),g=i(36493),C=i(90066),S=i(31656),m=i(4872),A=class{constructor(e,t){(0,o.Z)(this,"logService",void 0),(0,o.Z)(this,"scenario",void 0),(0,o.Z)(this,"isClippingExpansion",S.R.isExperimentActive(m.H.couponClippingExpansion)),this.logService=e,this.scenario=t}async TryClipCoupons(e,t,i,o){if(!1===this.isClippingExpansion&&p.Z.expansionDomainsList.includes(t))return!1;const a=Date.now();return e.clipCouponSelector?await this.ClipCouponsAndLogResult(a,e,t,i,o).catch((e=>(this.LogError(a,e.message,t,i,o),!1))):(this.LogError(a,"ClipCoupon selector not found",t,i,o),!1)}async ClipCouponsAndLogResult(e,t,i,o,a){const r=this.GetPriceData(t,o);if(!await h.ZP.WaitForCondition((async()=>C.Z.HasVisibleElement(t.clipCouponSelector)),3e3)&&t.clickBeforeClipSelector){const o=C.Z.GetAllMatchingElements(t.clickBeforeClipSelector);for(const e of o)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,i,r,a),!1}}))}const n=C.Z.GetAllMatchingElements(t.clipCouponSelector),s=this.GetFirstVisibleIndices(t);if(0===n.length){let o="Clip button not found, no AlreadyClipped selector";return t.alreadyClippedSelector&&(o=C.Z.GetFirstVisibleElement(t.alreadyClippedSelector)?"Coupon Already Clipped":"Clip Button and Already Clipped not found"),this.LogError(e,o,i,r,a),this.LogVisibleSelectors(i,s,[],!1,a),!1}let c=!1;for(const e of n)e.click(),c=!0;return this.GetPostClippingSelectorsAndLog(i,t,s,c,a),c?this.LogClippingResult(e,u.ps.Positive,i,r,"Finished Clipping Coupon",a):this.LogError(e,"Coupon Clipping Failed",i,r,a),c}GetPriceData(e,t){let i=t.initialPrice??0,o=t.discount;try{if(!i&&e.orderTotalDataElementSelector){const t=C.Z.GetFirstVisibleElement(e.orderTotalDataElementSelector)?.innerText;t&&(i=(0,g.K)(t))}if(!o&&e.discountSelector){const t=C.Z.GetFirstVisibleElement(e.discountSelector)?.innerText;o=p.Z.getAmazonClippingDiscount(i,t)}}catch(e){}return{discount:o,initialPrice:i}}async GetPostClippingSelectorsAndLog(e,t,i,o,a){await h.ZP.Sleep(1e3);const r=this.GetFirstVisibleIndices(t);this.LogVisibleSelectors(e,i,r,o,a)}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 i=t[e];try{const t=document.querySelectorAll(i);for(const i of t)if(C.Z.IsElementVisible(i))return e}catch(e){}}return-1}LogVisibleSelectors(e,t,i,o,a){const r=u.R.VisibleClippingSelectors,n=u.in.Information,s=new c(e,t,i,o);this.logService.SendLogMessage(n,r,"",s,a)}LogClippingResult(e,t,i,o,r,n){const s=o.initialPrice??0,c=o.discount??0,d=Date.now()-e,h=new a.Z(i),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,r,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=i,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,i,o,a){const n=d.x.CouponClippingFailed,s=new r.Z(i,n,{FunctionName:"ClipCoupons"},void 0);this.logService.SendLogMessage(u.in.Error,u.R.ClientError,t??"",s,a),this.logService.SendEdgeAAErrorMessage(n),this.LogClippingResult(e,u.ps.Error,i,o,t,a)}}},23825:function(e,t,i){var o=i(72370),a=i(5144),r=i(57176),n=i(82315),s=i(29247),c=i(12953),l=i(4872),u=i(90066),d=i(36493),h=i(27689),p=i(52056),g=i(31656),C=i(64865),S=i(91495);t.Z=class{constructor(e,t=!1){(0,o.Z)(this,"EXPIRY_PERIOD",432e6),(0,o.Z)(this,"PAGE_WAIT_TIME",5e3),(0,o.Z)(this,"MAX_SUGGESTED_COUPONS_COUNT_FOR_AA",3),(0,o.Z)(this,"MAX_SUGGESTED_COUPONS_COUNT_TO_STORE",10),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"key",void 0),(0,o.Z)(this,"AllSuggestedCoupons",void 0),(0,o.Z)(this,"suggestedCoupons",void 0),(0,o.Z)(this,"fromPlatformDetection",void 0),(0,o.Z)(this,"suggestedCouponEnhancementExp",void 0),(0,o.Z)(this,"sendStorageMessage",void 0),(0,o.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,i,o,a,n,c){let d=this.PAGE_WAIT_TIME;n&&(d=0,i&&await s.ZP.WaitForCondition((async()=>u.Z.HasVisibleElement(i)),this.PAGE_WAIT_TIME)),await s.ZP.Sleep(d).then((()=>{if(i){const n=u.Z.GetFirstVisibleElement(i);let s;if(void 0===o||(0,C.TF)(o))s=n?.textContent;else{const e=n?.textContent?.match(o);s=e&&e[1]?e[1]:""}(0,C.TF)(s)||this.AddCoupons([s],t,e,r.x6.Selector,a)}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,r.x6.Automated,a),g.R.isExperimentActive(l.H.suppressedCoupons)&&this.RemoveSuppressedCoupons(c,a),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,i,o,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,o),void 0===l.numberOfFails&&(l.numberOfFails=0),i<l.source&&(l.source=i,l.title=`Coupon suggested by ${this.domainName}`);else{const t=new r.ZP;if(t.attribution=this.domainName,t.title=`Coupon suggested by ${this.domainName}`,t.couponCode=e,t.extraction=o,t.numberOfFails=0,t.providerId="SuggestedCoupon",t.source=i,t.timestamp=Date.now(),this.suggestedCoupons.push(t),!s){const i=new c.Z(e,this.domainName,a.M_.SuggestedCoupon,location.pathname,JSON.stringify(t)),o=this.fromPlatformDetection?"Site suggested a coupon we didn't have from platform detection":"Site suggested a coupon we didn't have";p.Z.SendLogEventMessage(i,a.R.CollectedCoupons,n??"",o,a.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 i=[];if(e.forEach((e=>{const t=this.suggestedCoupons.findIndex((t=>t.couponCode.toLowerCase()===e.toLowerCase()));-1!==t&&(i.push(this.suggestedCoupons[t]),this.suggestedCoupons.splice(t,1))})),0===i.length)return;const o=new c.Z("",this.domainName,a.M_.SuppressedSuggestedCoupons,location.pathname,JSON.stringify(i)),r="Site suggested some coupons which are suppressed coupons";p.Z.SendLogEventMessage(o,a.R.CollectedCoupons,t??"",r,a.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,i){i.d(t,{Z:function(){return E}});var o=i(4872),a=i(31656),r=i(73557),n=i(82315),s=i(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=i(17675),p=i(31714),g=i(13018),C=i(29247),S=class{constructor(e,t,i,o,a,r,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=i,this.impressionId=o,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="",r)try{this.ruleBasedTriggerMap=JSON.parse(JSON.parse(r),C.ZP.ParseMap)}catch(e){this.sendErrorMessage(this.impressionId,`Cannot parse Rule Based Trigger Map: ${e}. ruleBasedTriggerMapStr = ${r}`)}this.isSpiritedShopper=a?.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 i=JSON.stringify({value:JSON.stringify(JSON.stringify(this.ruleBasedTriggerMap,C.ZP.StringifyMap))});this.sendStorageMessage(h.l.ruleBasedTriggerDataKey,i),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,i=e?.totalEngagementsCount??0,o=void 0!==this.variant?h.l.minEngagementCountV1:h.l.minEngagementCount;return-1===t||i<o}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(),i=`Random: ${t}  Open probability: ${e}`;return this.personalizationAutoOpenTelemetryData.message+=` - ${i}`,t<e}getNormalizedScore(e){let t=0,i=0;const o=[];e.forEach((e=>{void 0!==e.feature&&(t+=e.feature*e.weight,i+=e.weight,o.push(`${e.name}(${e.feature}) * ${e.weight}`))}));const a=t/i,r=`score = ${o.join(" + ")} = ${t} => normalizedScore: ${a} [scoreThreshold: ${h.l.scoreThreshold}]`;return this.personalizationAutoOpenTelemetryData.message+=` - ${r}`,this.personalizationAutoOpenTelemetryData.normalizedScore=a,this.personalizationAutoOpenTelemetryData.scoreThreshold=h.l.scoreThreshold,a}canAutoOpenWithPersonalization(){const e=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString())?.userEngagementResults,t=e?.positiveEngagementScore,i=this.noPreviousEngagements(e);if(this.personalizationAutoOpenTelemetryData.noPreviousEngagements=i,this.personalizationAutoOpenTelemetryData.positiveEngagementScore=t??null,this.personalizationAutoOpenTelemetryData.totalEngagementsCount=e?.totalEngagementsCount??0,this.personalizationAutoOpenTelemetryData.message+=`PopupOrigination: ${this.popupOrigination} - No previous client-side engagements: ${i}`,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(i,t)}storeFirstTimeAutoOpenDisabled(e){let t=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString()),i=t?.firstTimeAutoOpenDisabled;e&&(i=void 0),e||void 0!==i||(i=new Date),t||(t=new g.Z),t.firstTimeAutoOpenDisabled=i,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)}shouldReintroduceFlyout(){const e=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString()),t=e?.firstTimeAutoOpenDisabled,i=e?.flyoutReintroduceDays??h.l.flyoutReintroduceDays;if(t){return((new Date).getTime()-new Date(t).getTime())/864e5>=i}return!1}},m=class extends S{constructor(e,t,i,o,a,r,n){super(e,t,i,o,a,r,n),(0,s.Z)(this,"couponExpectation",void 0),this.mlPopUpProbability=a?.userPersonalizationInfo?.mlCouponAutoApplyPopUpProbability,this.personalizationAutoOpenTelemetryData.mlCouponAutoApplyPopUpProbability=this.mlPopUpProbability??null,this.couponExpectation=this.calculateCouponExpectation(a.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,i,o,a,r,n){super(e,t,i,o,a,r,n),this.mlPopUpProbability=a?.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(),i=this.getMaxNotificationCountPerHour(),o=this.getMaxNotificationCountPerDay(),a=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString());if(!a)return!0;const r=a?.notificationTracker;if(!r)return!0;const n=new Date;return(n.getTime()-new Date(r.perMinFirstTriggered).getTime())/6e4<1&&r.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(r.perHourFirstTriggered).getTime())/36e5<1&&r.perHourCount>=i?(e=`Cashback ML Limit: can't open normal notification because ML probability <= 0.6 and notification count exceeds the limit ${i} per hour`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1):!((n.getTime()-new Date(r.perDayFirstTriggered).getTime())/864e5<1&&r.perDayCount>=o&&(e=`Cashback ML Limit: can't open normal notification because ML probability <= 0.6 and notification count exceeds the limit ${o} 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}},f=class extends S{constructor(e,t,i,o,a,r,n){super(e,t,i,o,a,r,n),(0,s.Z)(this,"bestCompetingPrice",void 0),(0,s.Z)(this,"price",void 0),this.bestCompetingPrice=this.getBestCompetingPrice(a),this.price=a.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}]}},v=class extends S{constructor(e,t,i,o,a,r,n){super(e,t,i,o,a,r,n),(0,s.Z)(this,"priceDrop",void 0),this.mlPopUpProbability=a?.userPersonalizationInfo?.mlPhProbability,this.personalizationAutoOpenTelemetryData.mlPhProbability=this.mlPopUpProbability??null,this.priceDrop=this.getPriceDrop(a),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(),i=this.getMaxNotificationCountPerHour(),o=this.getMaxNotificationCountPerDay(),a=this.ruleBasedTriggerMap?.get(this.popupOrigination.toString());if(!a)return!0;const r=a?.notificationTracker;if(!r)return!0;const n=new Date;return(n.getTime()-new Date(r.perMinFirstTriggered).getTime())/6e4<1&&r.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(r.perHourFirstTriggered).getTime())/36e5<1&&r.perHourCount>=i?(e=`PH ML Limit: can't open normal notification because ml probability <= 0.5 and notification count exceeds the limit ${i} per hour`,this.personalizationAutoOpenTelemetryData.message+=` - ${e}`,!1):!((n.getTime()-new Date(r.perDayFirstTriggered).getTime())/864e5<1&&r.perDayCount>=o&&(e=`PH ML Limit: can't open normal notification because ml probability <= 0.5 and notification count exceeds the limit ${o} 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,i,s,h){let p,g;const C=n.Z.getApiResponse();switch(e){case r.sR.AUTO_SHOW_COUPONS_CHECKOUT:g=new l(C),p=new m(e,t,i,s,g,h,a.R.getServiceExperimentValue(o.H.CouponsPersonalization));break;case r.sR.AUTO_SHOW_PRICE_HISTORY:g=new d(C),p=new v(e,t,i,s,g,h,a.R.getServiceExperimentValue(o.H.PhPersonalization));break;case r.sR.AUTO_SHOW_REBATES_ORGANIC:g=new c(C),p=new A(e,t,i,s,g,h,a.R.getServiceExperimentValue(o.H.CashbackPersonalization));break;case r.sR.AUTO_SHOW_LOWER_PRICE_FOUND:g=new u(C),p=new f(e,t,i,s,g,h,void 0);break;default:g=new c(C),p=new S(e,t,i,s,g,h,void 0)}return p}}},89366:function(e,t,i){i.d(t,{Z:function(){return o}});class o{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,i){var o=i(27689),a=i(9448),r=i(52056);t.Z=class{static GetBackgroundAAKeyName(){return(0,o.sT)()}static CanCurrentPageDeleteBgaaState(e){return e===(0,o.Ek)()}static CanCurrentDomainDeleteBgaaState(e){return e===(0,o.S8)()}static ValidateBgAAState(e,t,i){return e.InitialPrice===t||e.TrueInitialPrice===t||this.AreEqualOrNear(e.InitialPrice-e.MaxDiscount,t)||e.InitialPrice===i||e.TrueInitialPrice===i||this.AreEqualOrNear(e.InitialPrice-e.MaxDiscount,i)}static AreEqualOrNear(e,t){return Math.abs(e-t)<.05}static SendBackgroundAAStateValidationMessage(e){r.Z.SendMessage(a.H.BackgroundAutoApplyStateValid,[e])}static ResetBackgroundAAStateValidationMessage(){r.Z.SendMessage(a.H.BackgroundAutoApplyStateValid,[""])}}},57459:function(e,t,i){var o=i(93608);class a{static GetCartModelRequestCoupons(e,t){if(!e.length)return[];const i=a.FilterBlockedAutoApplyCoupons(e);return a.AddSuggestedCoupons(i,t)}static GetAutoApplyCoupons(e,t,i){return e.length?(e=a.AddSuggestedCoupons(e,t),e=a.HandleCartModelBlockedCoupons(e,i)):[]}static FilterUnblockedCoupons(e,t,i){return a.FilterBlockedAutoApplyCoupons(a.GetAutoApplyCoupons(e,t,i))}static AddSuggestedCoupons(e,t){if(t.length>0){const i=[...e];for(const e of[...t].reverse()){let t=e;const a=i.findIndex((t=>t.couponCode.toLowerCase()===e.couponCode.toLowerCase()));let r=o.d.NewSuggestedCoupon;-1!==a&&(t=i.splice(a,1)[0],r=o.d.ExistingSuggestedCoupon),t.suggestedCouponType=r,i.unshift(t)}return i}return e}static HandleCartModelBlockedCoupons(e,t){if(!e.length)return[];const i=[...e];if(t)for(const e of t){const t=i.findIndex((t=>t.couponCode.toLowerCase()===e.toLowerCase()));-1!==t&&(i[t].isBlockedByCart=!0)}return i}static FilterBlockedAutoApplyCoupons(e){return e.filter((e=>!e.isLowSuccessRateCoupon&&!e.isBlockedByCart))}}t.Z=a},82315:function(e,t,i){var o=i(72370),a=i(21488),r=i(46557);class n{constructor(){(0,o.Z)(this,"retailerData",void 0),(0,o.Z)(this,"userInfo",void 0),(0,o.Z)(this,"traceId",void 0),(0,o.Z)(this,"disabledNotifications",void 0),(0,o.Z)(this,"impressionId",void 0),(0,o.Z)(this,"coupons",void 0),(0,o.Z)(this,"suppressedCoupons",void 0),(0,o.Z)(this,"cashback",void 0),(0,o.Z)(this,"market",void 0),(0,o.Z)(this,"page_locale",void 0),(0,o.Z)(this,"aFDMarket",void 0),(0,o.Z)(this,"userPersonalizationInfo",void 0),(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"base64ProductImage",void 0),(0,o.Z)(this,"ranking",void 0),(0,o.Z)(this,"extracted_entity",void 0),(0,o.Z)(this,"comparableOffers",void 0),(0,o.Z)(this,"priceHistory",void 0),(0,o.Z)(this,"url",void 0),(0,o.Z)(this,"isAwarenessExpansionEnabled",void 0),(0,o.Z)(this,"personalizedAdsResponse",void 0),(0,o.Z)(this,"isCashbackEstimationSupportedForDomain",void 0),(0,o.Z)(this,"youtubeTemplates",void 0),(0,o.Z)(this,"youtubeData",void 0),(0,o.Z)(this,"trendingCoupons",void 0),(0,o.Z)(this,"productTracking",void 0),(0,o.Z)(this,"recommendations",void 0),(0,o.Z)(this,"isSSOEnabled",void 0),(0,o.Z)(this,"uHId",void 0),(0,o.Z)(this,"itemLevelCashBack",void 0),(0,o.Z)(this,"productItemizedCashBack",void 0),(0,o.Z)(this,"shoppingDataContainer",void 0),(0,o.Z)(this,"checkoutData",void 0),(0,o.Z)(this,"dealDaysRetailerData",void 0),(0,o.Z)(this,"dealDaysPDP",void 0),(0,o.Z)(this,"isUserEnrolledInDealDays",void 0),(0,o.Z)(this,"completeExtractedEntity",void 0),(0,o.Z)(this,"isAmazonGiftCardEnabled",void 0),(0,o.Z)(this,"productBestCoupon",void 0),(0,o.Z)(this,"isPackageTrackingEnabled",void 0),(0,o.Z)(this,"inboxPriceMatchNotification",void 0),(0,o.Z)(this,"aggregatorPDPSelectors",void 0)}static getApiResponse(){return this.apiResponse}static setApiResponse(e,t){this.apiResponse=JSON.parse(e),this.apiResponse?.retailerData&&(this.apiResponse.retailerData=r.Z.Create(this.apiResponse.retailerData),this.apiResponse.userInfo=a.Z.Create(this.apiResponse)),this.apiResponse.traceId=t}static createNewApiResponse(e,t,i){const o=JSON.parse(e);return o?.retailerData&&(o.retailerData=r.Z.Create(o.retailerData),o.userInfo=a.Z.Create(o)),o.traceId=t,o.impressionId=i,o}}(0,o.Z)(n,"apiResponse",new n),t.Z=n},49206:function(e,t,i){i.d(t,{f:function(){return h}});var o=i(72370),a=i(31656),r=i(21597),n=i(89366),s=i(86743),c=i(3274),l=i(52056),u=i(60782);class d extends n.Z{constructor(...e){super(...e),(0,o.Z)(this,"initializeStartTime",performance.now()),(0,o.Z)(this,"scriptRunNum",0)}initializeRuntime(e){let t,i;u.M.handleInitializeRuntime(e),window.AutoOpenScriptInjected=!0,0!==this.scriptRunNum&&(this.initializeStartTime=performance.now()),e&&(e.length>r.aE.enabled_features&&(t=e[r.aE.enabled_features]),i=this.GetEnabledServiceFeatures(e)),a.R.Create(t,i);const o=(0,s.XB)();window.isAOCActive=o,l.Z.SetFullAOCActive(o),(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>r.aE.enabled_service_features&&e[r.aE.enabled_service_features].length>0?t=e[r.aE.enabled_service_features]:e.length>r.aE.enabled_service_features_v2&&e[r.aE.enabled_service_features_v2].length>0&&(t=e[r.aE.enabled_service_features_v2]),t}}const h=new d},23498:function(e,t,i){var o=i(93209),a=i(5144),r=i(27689),n=i(2388),s=i(9448),c=i(52056),l=i(93970),u=i(9839);class d{static executeUrlParamActions(e,t){const i=(0,r.Wf)(t)??window.location.search,o=new URLSearchParams(i),a=d.getParamActionMap();o.forEach(((t,i)=>{const o=a.get(`${i}:${t}`);o&&o.forEach((t=>{t(e)}))}))}static fireAffiliateUrl(e){const t=e.retailerData?.domainName??(0,r.S8)(),i=e?.coupons?.find((e=>(0,r.Mu)(e,t)))?.offerUrl;i&&c.Z.SendNavigateToUrlMessage(i)}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,r.S8)();u.Q.sendMessage(s.H.RecordShoppingUserAction,[l.J6.BellIconNotifClick]),u.Q.sendMessage(s.H.RecordShoppingUserEngagement,[l.OE.BellIconNotifClick]);const i=new o.Z(a.$S.BellIconNotification,n.r.BELL_ICON,t);u.Q.sendLogEventMessage(i,a.R.ButtonClick,e.impressionId,"Bell Icon Notification Click",a.in.Information)}}t.Z=d},9839:function(e,t,i){i.d(t,{Q:function(){return U}});var o=i(72370),a=i(4872),r=i(31656),n=i(84830),s=i(59645),c=i(58474);class l extends c.Z{constructor(e,t){super(),(0,o.Z)(this,"JourneyStage",void 0),(0,o.Z)(this,"PageVisitId",void 0),this.JourneyStage=e,this.PageVisitId=t}}var u=l,d=i(5144),h=i(39088),p=i(21597),g=i(87720),C=i(35386),S=i(73557),m=i(56372),A=i(29247),f=i(71544),v=i(91495),E=i(27689),P=i(33105),I=i(65302),T=i(9448),O=i(43916),y=i(82315),D=i(86743),b=i(93970),N=i(54869),R=i(49206),_=i(68813),k=i(92800),w=i(86161);class x extends m.Z{constructor(...e){super(...e),(0,o.Z)(this,"traceId",void 0),(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"journeyStage",C.v.UNDEFINED),(0,o.Z)(this,"sentSnoozeTelemetry",!1),(0,o.Z)(this,"snoozedPopupOriginationList",[]),(0,o.Z)(this,"bgaaComplete",void 0)}init(e){this.apiResponse=y.Z.getApiResponse(),this.initCommonInfo(this.apiResponse.impressionId,this.apiResponse.retailerData?.domainName??(0,E.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&&A.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 i=this.apiResponse.retailerData?.getCurrentCheckoutPage()?.catalogSelectors;return!!i&&b.ZP.ValidateProductOutOfStock(e,i,this.apiResponse?.impressionId,this.apiResponse?.productTracking)}getCurrentJourneyStage(){return this.journeyStage}resetCurrentJourneyStage(){this.journeyStage=C.v.UNDEFINED}computeCurrentJourneyStage(e){let t=C.v.UNDEFINED;if(r.R.isExperimentActive(a.H.disableJourneyStageComputation)){const e=r.R.getMultipleVariants(a.H.disableJourneyStageComputation),t=r.R.getVariantValue(e,"journeyStage",C.v.UNDEFINED);return void(this.journeyStage=t)}if(!(r.R.isExperimentActive(a.H.shoppingOnDiscover)&&r.R.isExperimentActive(a.H.temporalShoppingOnDiscover)||r.R.isExperimentActive(a.H.computeJourneyStage)))return;const i=r.R.getMultipleVariants(a.H.shoppingOnDiscover),o=r.R.getVariantValue(i,"maxCountThreshold",1),n=r.R.getVariantValue(i,"researchTotalCount",1),s=r.R.getVariantValue(i,"discoverTotalCount",1),c=r.R.getVariantValue(i,"decisionTotalCount",1),l=r.R.getVariantValue(i,"historyThresholdInMinutes",-1),h=y.Z.getApiResponse().shoppingDataContainer,g=h?.baseShoppingDataList;if(g){let e=0,i=0;for(const t of g)if(t?.contentDataType===P.q.PreviouslyViewedSimilar){const o=t;if(o)for(const[t,a]of Object.entries(o.urlTimestamps)){let t=0;for(const e of a)";"===e&&(t+=1);if(-1===l)e+=t,i=Math.max(i,t);else{let t=0;for(const e of a.split(";")){const i=Date.parse(e+" Z");Date.now()-i<1e3*l*60&&(t+=1)}e+=t,i=Math.max(i,t)}}}e>c?t=C.v.DECISION:i>o||e>n?t=C.v.RESEARCH:e>s&&(t=C.v.DISCOVER)}if(this.journeyStage=t,r.R.isExperimentActive(a.H.journeyStageTelemetry)){const i=this.getStringParameter(e,p.aE.session_ids),o=JSON.parse(i),a=new u(t,o?.pageVisitId);this.sendLogEventMessage(a,d.R.JourneyStage,this.impressionId,"",d.in.Information)}}getCurrentCategoryName(){const e=y.Z.getApiResponse().comparableOffers?.attributedatabag?.responseLevelSignals?.queryleafcategoryid;if(e&&"string"==typeof e)return e;const t=y.Z.getApiResponse().shoppingDataContainer;if(t){const e=t.baseShoppingDataList;for(const t of e)if(t?.contentDataType===P.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=[],i=Object.keys(S.sR).filter((e=>!isNaN(Number(e))));for(const o of i){const i=parseInt(o,10),a=(0,I.H6)(i),r=this.getNumberParameter(e,p.aE.disabled_scenarios);if(null!=r&&r<117424127&&a&&(r&a)===a){const e=new g.ZP;e.popupOrigination=i,e.timeLastAutoOpen=Date.now(),t.push(e)}if(e.length>p.aE.snoozed_values){const o=JSON.parse(e[p.aE.snoozed_values]);if(o&&o.length>0&&o.includes(a.toString())){const e=new g.ZP;e.popupOrigination=i,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 i=new Map,o=[];if(t){const a=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 a){const i=parseInt(e,10),a=(0,I.H6)(i);(this.doesGroupHaveEnum(t[0],a)||this.doesGroupHaveEnum(t[1],a))&&o.push(i)}}i.set(t,o);const r=JSON.stringify({value:JSON.stringify(i,A.ZP.StringifyMap)});this.autoOpenDomainPrefData=i,this.sendStorageMessage(g.Sk,r)}}}isPopupOriginationUnblockedByMinCooldown(e){const t=this.lastShownData.get(e);if(t){const i=this.GetMinCooldownForPopupOrigination(e);if(i){return Date.now()-t>=i}}return!0}isPopupOriginationUnblockedByStageAndCategory(e){if(!r.R.isExperimentActive(a.H.shoppingOnDiscover)||!r.R.isExperimentActive(a.H.temporalShoppingOnDiscover))return!0;const t=r.R.getMultipleVariants(a.H.shoppingOnDiscover),i=r.R.getVariantValue(t,"journeyStageCooldownInMinutes",60),o=r.R.getVariantValue(t,"categoryCooldownInMinutes",1440),n=this.stageAndCategoryLastShown.get(e);let s=!0;if(n){const e=this.getCurrentJourneyStage(),t=this.getCurrentCategoryName(),a=n.categoriesBlocked.get(e);if(a&&a.length>0){Date.now()-a[a.length-1].timeLastAutoOpen<1e3*i*60&&(s=!1);for(const e of a)if(Date.now()-e.timeLastAutoOpen<1e3*o*60&&e.categoryName===t){s=!1;break}}}return s}sendControllerStorageMessage(e,t){this.sendMessage(b.EI.SetStorageValue,[e,t])}sendUpdateAddressBarMessage(e){this.sendMessage(b.EI.UpdateAddressBar,[e])}async checkIfCanUpdateOmniboxByCashbackActivationMessage(e){if(r.R.isExperimentActive(a.H.cashbackActivationOmnibar))try{await(this.apiResponse.retailerData?.getIsCheckoutPageSelectorsPresent())?e():(0,k.W)(this.apiResponse).setCashbackOmniboxCallback(e)}catch(e){this.sendErrorMessage(this.apiResponse.impressionId,e?.message??":::AOC - error checkIfCanUpdateOmniboxByCashbackActivationMessage")}}isPopupOriginationUnblockedByUserPref(e,t,i,o,n=!1){if(this.autoOpenPrefData&&r.R?.isExperimentActive(a.H.autoOpenControllerScript)){const a={PrefSize:this.autoOpenPrefData?.length,Reason:"",TelemetryData:i,Status:""},r=this.autoOpenPrefData.findIndex((e=>e.popupOrigination===t));if(-1!==r){const o=Date.now(),s=this.autoOpenPrefData[r].timeLastAutoOpen,c=this.autoOpenPrefData[r].snoozeTime;if(!c){if(this.reEnabledPopupOriginationForLostUser(t,i,this.autoOpenPrefData[r]))return this.sendLostUsersLogEvent(t,a,d.AM.lostUsers,d.YQ.LostUsers),!0;a.Reason="blocked";const o=this.autoOpenPrefData.filter((e=>!e.snoozeTime));return a.PrefSize=o?.length,o?.length>=29&&(this.autoOpenPrefData=this.autoOpenPrefData.filter((e=>e.snoozeTime)),this.setAutoOpenPref(this.autoOpenPrefData),a.Status="prefReset",a.Reason="maxedOut"),this.sendLogEventMessage(a,d.R.UserPref,this.impressionId,"",d.in.Information),this.sendAutoShowPreventedMessage(t,e),!1}if(o-s<c)return n&&this.snoozedPopupOriginationList.push(t),this.sendAutoShowPreventedMessage(t,e),!1}if(this.autoOpenDomainPrefData&&o&&this.autoOpenDomainPrefData.get(o)){const i=this.autoOpenDomainPrefData.get(o);if(i?.includes(t))return a.Reason="blocked for domain",this.sendLogEventMessage(a,d.R.UserPref,this.impressionId,"",d.in.Information),this.sendAutoShowPreventedMessage(t,e),!1}else{const i=(0,I.H6)(t);if(e?.length>p.aE.disable_popup_originations_for_current_domain){const o=JSON.parse(e[p.aE.disable_popup_originations_for_current_domain]);if(o&&2===o.length&&(this.doesGroupHaveEnum(o[0],i)||this.doesGroupHaveEnum(o[1],i)))return a.Reason="blocked for domain using params",this.sendLogEventMessage(a,d.R.UserPref,this.impressionId,"",d.in.Information),this.sendAutoShowPreventedMessage(t,e),!1}}return!0}if(e){const i=(0,I.H6)(t),o=this.getNumberParameter(e,p.aE.disabled_scenarios);if(null!=o&&i&&(o&i)===i)return this.sendAutoShowPreventedMessage(t,e),!1;if(e?.length>p.aE.disable_popup_originations_for_current_domain){const o=JSON.parse(e[p.aE.disable_popup_originations_for_current_domain]);if(o&&2===o.length&&(this.doesGroupHaveEnum(o[0],i)||this.doesGroupHaveEnum(o[1],i)))return this.sendAutoShowPreventedMessage(t,e),!1}if(e?.length>p.aE.snoozed_values){const o=JSON.parse(e[p.aE.snoozed_values]);if(o&&o.length>0&&o.includes(i.toString()))return this.sendAutoShowPreventedMessage(t,e),!1}}return!0}sendLogEventMessage(e,t,i,o,a){const r={};r.JsonData=JSON.stringify(e),r.EventType=t,r.LogLevel=a,r.Message=o,r.ClientContext=new n.Z(f.Z.GetClientName(),h.HQ,f.Z.GetBuildVersion(),f.Z.enabledServiceFlights),i&&(r.ImpressionId=i);const s=[JSON.stringify(r)];this.sendMessage(b.EI.LogScriptTelemetry,s)}sendLogEventMessageV2(e,t,i,o,a){const r={};r.JsonData=JSON.stringify(e),r.EventType=t,r.LogLevel=a,r.Message=o,r.ClientContext=new n.Z(f.Z.GetClientName(),h.HQ,f.Z.GetBuildVersion(),f.Z.enabledServiceFlights),i&&(r.ImpressionId=i);const s=[JSON.stringify(r)];try{this.sendMessage(b.EI.LogScriptTelemetryV2,s)}catch(e){}}sendThrottledLogEventMessage(e){r.R.getServiceExperimentValue(a.H.loggingThrottle)&&e()}isPopupOriginationUnblockedByServer(e){try{if(r.R.isExperimentActive(a.H.shoppingR)||r.R.isExperimentActive(a.H.shoppingRClient))return!1;const t=this.apiResponse.retailerData?.disabledPopupOriginationList,i=t?.find((t=>t.popupOrigination===e));if(i){if(!i.jSVersionThreshold&&!i.serverExps)return!1;if(i.jSVersionThreshold&&Number(h.HQ)<Number(i.jSVersionThreshold))return!1;if(i.serverExps){const e=i.serverExps;for(const t of e){const e=`edgeServerUX.shopping.${t}`;if(r.R.isExperimentActive(e))return!1}}}}catch(e){this.sendLogEvent(this.apiResponse.impressionId,`popupOrgination unblocked by server ${e}`,"error")}return!0}isLowPerformingNotificationBlockedByExperiment(e){return r.R.isExperimentActive(a.H.blockLowPerformanceNotifications)&&x.lowPerformingNotificationsExp.includes(e)}CheckIfCanOpenForPopupOrigination(e,t,i,o,a){let r,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(r=(0,D.Kv)(e),n=r.status,n&&(s=!this.shouldStandDown(t,e),n=s),n&&(n=!o),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,i,!0),n=d),n&&(h=(0,_.Oh)(e,(0,_.tW)(),N.Z.GetLocalDataService().GetUserSettingsData()),n=h),n&&(n=!this.isLowPerformingNotificationBlockedByExperiment(e)),!n){let t="Popup origination blocked";r.status?s?o?(t="Popup origination blocked due to already auto opened",g={featuresAlreadyOpened:JSON.stringify(a)}):c?l?u?d?h||(t="Popup origination blocked due to user cohort (e.g. vulnerable cohort)",g={userSettingsData:N.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: ${r.reason}`,this.sendLogEvent(this.apiResponse.impressionId,"BLOCKED POPUPORIGINATION",t,e.toString(),g)}return!!n}updateCommonAutoOpenData(e){w.m.apiData.retailerAPIResponse=this.getStringParameter(e,p.aE.api_response);let t=[];try{const e=r.R.GetRawEnabledFeatures();t=JSON.parse(e)}catch(e){}w.m.clientContext=new n.Z(f.Z.GetClientName(),h.HQ,f.Z.GetBuildVersion()||"",f.Z.enabledServiceFlights,r.R.GetServiceExperiments(),void 0,t);const i=N.Z.GetLocalDataService();w.m.localData.isRebatesEnabled=i.IsrebatesEnabled(),w.m.localData.isP13nEnabled=i.IsP13nEnabled(),w.m.localData.isEdgeProfileRebatesUser=i.IsEdgeProfileRebatesUser(),w.m.localData.consentCanPrompt=i.ConsentCanPrompt(),w.m.localData.shouldStandDown=this.getNumberParameter(e,p.aE.should_stand_down),w.m.localData.lastShownData=this.lastShownDataStr,w.m.localData.domainLevelCooldownData=this.domainData?.blockedList,w.m.localData.pathLevelCooldownData=this.domainData?.paths?.get(this.currentPath)?.blockedListPath,w.m.localData.currentUrl=window.location.href,w.m.localData.currentTitle=document.title,w.m.localData.isCheckoutPageUsingUrlMatch=this.getNumberParameter(e,p.aE.is_checkout_page_using_url_match),w.m.localData.autoOpenPrefData=this.autoOpenPrefData;const o=this.apiResponse.retailerData?.domainName;o&&(w.m.localData.autoOpenDomainPrefData=this.autoOpenDomainPrefData?.get(o)),w.m.apiData.userCohortData=this.getStringParameter(e,p.aE.user_cohort_data),w.m.localData.isOffTheRecord=this.getNumberParameter(e,p.aE.is_off_the_record),w.m.localData.paneState=this.getStringParameter(e,p.aE.pane_state),w.m.localData.discoverState=this.getStringParameter(e,p.aE.discover_state),w.m.localData.traceId=this.getStringParameter(e,p.aE.nagivation_guid);try{const t=this.getStringParameter(e,p.aE.cjk_params),i=t?JSON.parse(t):void 0;w.m.apiData.isCJKPDP=i?.is_cjk_pdp}catch(e){}}sendMessage(e,t){R.f.postMessageToHost(e,t)}sendCheckoutValidationStatus(e){const t=N.Z.GetLocalDataService(),i=[`${t.GetAutoApplyStatus()}`,t.GetTraceId(),`${e}`];U.sendMessage(T.H.CheckoutPageValidationStatus,i)}triggerExperiment(e){this.sendMessage(b.EI.TriggerExperiment,[e])}sendLogEvent(e,t,i,o,a,r){const n={Domain:(0,E.S8)(),PageUrl:(0,E.Ek)(),Status:i,PopupOrigination:o,Metadata:a?JSON.stringify(a):void 0};this.sendLogEventMessage(n,r??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,E.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,i){return i.get(e)===t}setIsClientBgaaComplete(e){this.bgaaComplete=e}getIsClientBgaaComplete(){return this.bgaaComplete}sendLostUsersLogEvent(e,t,i,o){t.Reason=i,this.sendLogEvent(this.apiResponse.impressionId,o,"blockedByPref",e.toString(),t,d.R.EdgeFlyoutStatus)}sendAggregatorProductLogEvent(e,t,i){const o={Domain:(0,E.S8)(),PageUrl:e,Title:t,IsAggregator:i};this.sendLogEventMessage(o,d.R.AggregatorProduct,this.apiResponse.impressionId,"",d.in.Information)}executeAnimatingOmniboxFeatures(e){for(const t of e)try{t&&t.AnimateOmniboxFeatures()}catch(e){this.sendControllerErrorMessage(this.apiResponse?.impressionId,`:::AOC - error executeAnimatingOmniboxFeatures ${e}`)}}shouldCheckIfCanOpenWithPersonalization(e){return!!(e===S.sR.AUTO_SHOW_COUPONS_CHECKOUT&&r.R.isExperimentActive(a.H.CouponsPersonalization)||e===S.sR.AUTO_SHOW_PRICE_HISTORY&&r.R.isExperimentActive(a.H.PhPersonalization)||e===S.sR.AUTO_SHOW_REBATES_ORGANIC&&r.R.isExperimentActive(a.H.CashbackPersonalization))}checkIfCanOpenWithPersonalization(e){if(!1===this.shouldCheckIfCanOpenWithPersonalization(e))return!0;try{const t=O.Z.getRuleBasedTriggerController(e,this.sendErrorMessage,this.sendStorageMessage,this.apiResponse.impressionId,v.Q?.RuleBasedTriggerData),i=t.canAutoOpen();if(i);else{const i=new s.Z(d.xu.PersonalizedAutoTriggerOff);i.Metadata=JSON.stringify({personalizationAutoOpenTelemetryData:t.getPersonalizationAutoOpenTelemetryData(),popupOriginationEnum:e}),this.sendLogEventMessage(i,d.R.EdgeFlyoutStatus,this.apiResponse.impressionId,"RuleBased Trigger Controller decides to not auto open the flyout",d.in.Information)}return i}catch(e){return this.sendErrorMessage(this.apiResponse.impressionId,`checkIfCanOpenWithPersonalization error ${(0,I.YU)(e)}`),!0}}shouldStandDown(e,t){return!(!U.getNumberParameter(e,p.aE.should_stand_down)||x.shouldNotStandDown.includes(t)||(U.isCheckoutPageUsingUrlMatch(e)&&(this.sendMessage(T.H.PageStatus,[this.traceId,""]),this.sendMessage(T.H.CheckoutPageValidationStatus,["false",this.traceId,"false"])),0))}initialize(){this.autoOpenDataStr=v.Q?.AutoOpenData,this.lastCleanedDataStr=v.Q?.LastCleanedData,this.autoOpenPrefDataStr=v.Q?.AutoOpenPrefData,this.autoOpenDomainPrefDataStr=v.Q?.AutoOpenDomainPrefData,this.lastShownDataStr=v.Q?.LastShownData,this.stageAndCategoryLastShownStr=v.Q?.StageAndCategoryLastShown,this.initializeData()}sendControllerErrorMessage(e,t){try{const i="error";this.sendLogEvent(e,t,i),this.sendMessage(b.EI.AutoOpenError,[i,this.traceId])}catch(e){}}sendAutoShowPreventedMessage(e,t){e?.toString()&&this.sendMessage(b.EI.RecordAutoShowPrevented,[t[p.aE.nagivation_guid],e.toString()])}}(0,o.Z)(x,"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,o.Z)(x,"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 U=new x},60782:function(e,t,i){i.d(t,{M:function(){return r}});var o=i(72370),a=i(21597);class r{static createListener(e,t,i,o){const a=o||window;let n=this.listeners.get(e);if(i&&i&&void 0!==n){for(const t of n)t.listenerContext.removeEventListener(e,t.callback);for(;n.length>0;)n.pop()}a.addEventListener(e,t),n||(n=[],r.listeners.set(e,n)),n.push({callback:t,listenerContext:o||window})}static handleInitializeRuntime(e){const t=e.length>a.aE.nagivation_guid?e[a.aE.nagivation_guid]:void 0;r.previousInitNavigationGuid&&t!==r.previousInitNavigationGuid&&r.removeListeners(),r.previousInitNavigationGuid=t}static removeListeners(){for(const[e,t]of r.listeners)for(const i of t)i.listenerContext.removeEventListener(e,i.callback);r.listeners.clear()}}(0,o.Z)(r,"listeners",new Map),(0,o.Z)(r,"previousInitNavigationGuid",void 0)},56577:function(e,t,i){i.d(t,{Fw:function(){return a}});var o=i(72370);let a=function(e){return e.OrderId="orderId",e}({});t.ZP=class{constructor(){(0,o.Z)(this,"type",void 0),(0,o.Z)(this,"urlRegex",void 0),(0,o.Z)(this,"validationSelector",void 0),(0,o.Z)(this,"details",void 0),(0,o.Z)(this,"urlFields",void 0)}}},27900:function(e,t,i){i.d(t,{D8:function(){return a},OY:function(){return n},Vr:function(){return l},hm:function(){return s},l$:function(){return c},xD:function(){return r}});var o=i(72370);const a="CartProductBrandCollection",r=50,n="CartDataStorageInfo",s="CartDataFastCollection",c=432e5;class l{constructor(){(0,o.Z)(this,"OrderTotal",void 0),(0,o.Z)(this,"OrderSubTotal",void 0),(0,o.Z)(this,"CartDataCreationTime",void 0),(0,o.Z)(this,"CartId",void 0),(0,o.Z)(this,"CartPreTax",void 0),(0,o.Z)(this,"CartEstimatedTax",void 0),(0,o.Z)(this,"ShipmentDate",void 0),(0,o.Z)(this,"Currency",void 0),(0,o.Z)(this,"Products",void 0),(0,o.Z)(this,"ProductIds",void 0),(0,o.Z)(this,"ProductUrls",void 0),(0,o.Z)(this,"ExtractionId",void 0),(0,o.Z)(this,"BlockedCouponsData",void 0),(0,o.Z)(this,"url",void 0)}}},43686:function(e,t,i){var o=i(72370),a=i(14440);class r{constructor(){(0,o.Z)(this,"domain",void 0),(0,o.Z)(this,"cartValue",void 0),(0,o.Z)(this,"subTotal",void 0),(0,o.Z)(this,"currency",void 0),(0,o.Z)(this,"cartUrl",void 0),(0,o.Z)(this,"products",void 0),(0,o.Z)(this,"cartId",void 0),(0,o.Z)(this,"productIds",void 0)}static Create(e){const t=new r;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(a.Z.Create(e))})),t}}t.Z=r},41368:function(e,t,i){i.d(t,{Z:function(){return Z}});var o=i(72370),a=i(12727),r=i(9839),n=i(91495),s=i(27689),c=i(5144),l=i(15267),u=i(11501),d=i(29247),h=i(4238),p=i(46557);function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function C(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var S=i(43315),m=i(82960),A=i(12265),f=i(55590),v=i(36493),E=i(27900),P=i(33491),I=i(64865);function T(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function O(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?T(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):T(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}const y="PurchaseCart",D="ProductCollection",b="TransactionIds";class N{constructor(e,t,i,a,r){(0,o.Z)(this,"logger",void 0),(0,o.Z)(this,"cashbackDao",void 0),(0,o.Z)(this,"scraperService",void 0),(0,o.Z)(this,"personalDataRemover",void 0),(0,o.Z)(this,"dynamicTransactionUtils",void 0),(0,o.Z)(this,"DEFAULT_EXTRACTION_TIMEOUT",5e3),(0,o.Z)(this,"DEFAULT_EXTRACTION_TIMEOUT_NOT_REQUIRED",0),(0,o.Z)(this,"selectorTimeouts",void 0),(0,o.Z)(this,"extractionId",""),(0,o.Z)(this,"MAX_TRANSACTIONS_IN_LOCALSTORAGE",50),(0,o.Z)(this,"requiredValuesKeyNames",{productNames:!0,productTitleFromImage:!0,purchaseTotal:!0,orderSubTotal:!0,transactionId:!0,productQuantity:!1,productPrice:!1,productSkus:!1,productSellers:!1,productUrls:!1,productBrands:!1,productCategories:!1}),this.logger=e,this.scraperService=t,this.cashbackDao=i,this.personalDataRemover=a,this.extractionId=(new Date).getTime().toString(),this.dynamicTransactionUtils=r}isPurchaseExtractionEnabled(){return!this.cashbackDao.isTraveldomain()&&this.cashbackDao.getFeatureFlag("isNewCollectionEnabled",!1)}isPurchaseExtractionEnabledLogOnly(){return!this.cashbackDao.isTraveldomain()&&this.cashbackDao.getFeatureFlag("isNewCollectionEnabledLog",!0)}async runExtraction(e=!1){let t=c.GV.UnknownPage;try{this.extractionId=(new Date).getTime().toString();let i={status:A._N.NOT_ENABLED,shouldLogFragment:!1,extractionTime:0};if(!this.isPurchaseExtractionEnabled()){if(!this.isPurchaseExtractionEnabledLogOnly())return this.logDebuggMesageToConsole("Purchase extraction not enabled"),i;i.status=A._N.LOG_ONLY}if(!this.isValidPageUrl())return this.logDebuggMesageToConsole("Invalid page url"),i.status=A._N.INVALID_PAGE_URL,i;const o=[];if(t=this.cashbackDao.getPageType(),this.selectorTimeouts=this.cashbackDao.getRetailerSettings()?.getSelectorTimeouts(t),t===c.GV.CheckoutPage){const e=this.cashbackDao.getSelectorsDataForPageType(t,this.shouldMergeAllAndFinalCheckout()),a=this.cashbackDao.getAutomatedSelectorsDataForPage(t),{response:r,latency:n}=await this.runFunctionWithLatencyMeasure((()=>this.extractDataFromCheckoutPage(e,a,t,!1,!1,!1)));i=r,i.extractionTime=n;const s=this.getPageRegexData(e,a);this.logExtractionStartOrEnd(!1,t,s,i);const c=this.runFunctionWithCatchAsync("Error in addCartMonitor",t,"",(()=>this.addCartMonitor(e,a,t))),l=this.runFunctionWithCatchAsync("Error in addBuyNowButtonListener",t,"",(()=>this.addBuyNowButtonListener(e,a,t))),u=this.runFunctionWithCatchAsync("Error in addFinalCheckoutOrderButtonListener",t,"",(()=>this.addFinalCheckoutOrderButtonListener(e,a,t)));o.push(c,l,u)}else if(t===c.GV.ConfirmationPage){const{response:e,latency:o}=await this.runFunctionWithLatencyMeasure((()=>this.extractConfirmationPageData(t)));i=e,i.extractionTime=o,this.logExtractionStartOrEnd(!1,t,"",i)}else if(t===c.GV.ProductPage){const e=this.cashbackDao.getSelectorsDataForPageType(t,this.shouldMergeAllAndFinalCheckout()),a=this.cashbackDao.getAutomatedSelectorsDataForPage(t),r=this.runFunctionWithCatchAsync("Error in addBuyNowButtonListener",t,"",(()=>this.addBuyNowButtonListener(e,a,t)));o.push(r);const{response:n,latency:s}=await this.runFunctionWithLatencyMeasure((()=>this.extractDataFromProductPage(e,a,t)));i=n,i.extractionTime=s;const c=this.getPageRegexData(e,a);this.logExtractionStartOrEnd(!1,t,c,i)}else{this.logDebuggMesageToConsole("No extraction on this page",t,"",void 0,!1);const e=this.runFunctionWithCatchAsync("Error in addBuyNowButtonListener",t,"",(()=>this.addBuyNowButtonListener(void 0,void 0,t)));o.push(e),i={status:A._N.NON_PURCHASE_OR_CHECKOUT_PAGE,shouldLogFragment:!1}}return e&&await Promise.all(o),i}catch(e){return this.logDebuggMesageToConsole(e),this.logDebugOrErrorEvent("Error in extraction",!0,t,"",void 0,!0,{error:e.toString()}),{status:A._N.UNKNOWN_ERROR,shouldLogFragment:!1}}}async runFunctionWithLatencyMeasure(e){const t=performance.now();return{response:await e(),latency:performance.now()-t}}async runFunctionWithCatchAsync(e,t,i,o){try{return await o()}catch(o){this.logDebugOrErrorEvent(e,!0,t,i,void 0,!0,{error:o})}}runFunctionWithCatch(e,t,i,o){try{return o()}catch(o){this.logDebugOrErrorEvent(e,!0,t,i,void 0,!0,{error:o})}}async extractDataFromProductPage(e=void 0,t=void 0,i=void 0){const o=i??c.GV.ProductPage,a=t??this.cashbackDao.getAutomatedSelectorsDataForPage(o),r=e??this.cashbackDao.getSelectorsDataForPageType(o,this.shouldMergeAllAndFinalCheckout());this.logDebuggMesageToConsole("productPageUrlData",r);const n=this.getPageRegexData(r,a),s=r?.catalogSelectors;this.logExtractionStartOrEnd(!0,o,n);const l=this.getExtractionSelectors(r,void 0,s,o),u=this.getExtractionSelectorsAutomated(a,o),{extractedValuesMerged:d}=await this.extractData(l,u,!1,a,o,n,void 0,"",!1),h={ProductName:d.productNames||d.productTitleFromImage,ProductBrand:this.applyRegexSelectorToString(s?.productBrandRegex,d.productBrands),ProductCategory:this.applyRegexSelectorToString(s?.productCategoryRegex,d.productCategories)};return this.logDebuggMesageToConsole("newProductInfo",h),this.addOrUpdateProductInfoInCollection(h,o),{status:A._N.EXTRACTION_SUCCESSFULL,shouldLogFragment:!1}}applyRegexSelectorToString(e,t){if(!e||!t)return t;const i=e?.split(","),o=i?.map((e=>new RegExp(e,"g")));let a=t;return o&&o.forEach((e=>{const i=new RegExp(e,"g");let o;for(;null!==(o=i.exec(t))&&o?.length>1;)a=o[1]})),a}async extractConfirmationPageData(e=c.GV.ConfirmationPage){if(!this.canLogConfirmationPageData())return{status:A._N.CONFIRMATION_LOG_NOT_ENABLED,shouldLogFragment:!0};const t=this.cashbackDao.getAutomatedSelectorsDataForPage(e),i=this.getPageRegexData(void 0,t,!0),o=this.cashbackDao.isCartCachingEnabled(),a=o?this.readCartData():void 0;this.logExtractionStartOrEnd(!0,e,i,void 0,a),this.selectorTimeouts=this.cashbackDao.getRetailerSettings()?.getSelectorTimeouts(e);const r=this.getExtractionSelectorsForPurchasePage(e),n=this.getExtractionSelectorsAutomated(t,e),s=this.getCurrentUrlValue(!1),l=this.cashbackDao.getRetailerSettings(),u=this.cashbackDao.getConfirmationPageTelemetryData(),{extractionResultFromAutomated:d,extractionResult:h,extractedValuesMerged:p}=await this.extractData(r,n,!0,t,e,i,a,u?.transactionIdSelector??"",!1),g=l?.isDisablePurchaseTotalCollectionOnConfirmation??!1,C=l?.isDisableProductNamesCollectionOnConfirmation??!1,S=[],m=this.mergeConfirmationDataWithCartCahing(p,a,g,C,s,S),f=this.getOrderTotalPromProductPrices(m.pricePerItem??"");f>0&&!m.purchaseTotal&&(m.purchaseTotal=`${m.currency}${f}`);const v=this.IsAtLeaseOneRequiredFieldPresent(m),E=this.GetMissingRequiredFieldsMessage(m);this.logExtractionResults(h,d,p,a,void 0,r,n,E,v,e,i,void 0,!1);const P={isCartCachingEnabled:o,selectorsUsed:r,emptyRequiredFieldsMessage:E,pageType:e,pageRegexData:i,orderTotalFromProducts:f,logMessages:S};if(!v)return{status:A._N.FAILED_TO_EXTRACT_DATA,shouldLogFragment:!0,dataToLog:P};if(this.isTransactionIdSaved(m.transactionId)){const t=this.personalDataRemover.maskDataInAString(m.transactionId);return this.logDebugOrErrorEvent("Purchase already recorded",!1,e,i,a,!1,{transactionId:t}),{status:A._N.PURCHASE_ALREADY_RECORDED,shouldLogFragment:!1}}const I=this.cashbackDao.getAnid(),T=this.createLogData(m,I??"",t?.urlFields??null,S,a),O=this.adjustLogForPausedDomainAndCurrency(T,S),y=this.getOldCarts();return this.isPurchaseExtractionEnabled()?this.logPurchasePageData(T,a,y,S):this.logPurchasePageDataToDebug(T,a,e,i,y,S),this.clearDynamicTransactionId(),this.runFunctionWithCatch("Error saving transaction id to local storage",e,i,(()=>this.saveTransactionIdToLocalStorage(m.transactionId))),this.markAsUsedCartData(e),O?{status:A._N.EXTRACTION_SUCCESSFULL_PAUSED,shouldLogFragment:!1,dataToLog:P}:E?{status:A._N.EXTRACTION_SUCCESSFULL_BUT_MISSING_FIELDS,shouldLogFragment:!0,dataToLog:P}:{status:A._N.EXTRACTION_SUCCESSFULL,shouldLogFragment:!1}}async extractDataFromCheckoutPage(e=void 0,t=void 0,i=void 0,o,a,r){const n=i??c.GV.CheckoutPage,s=t??this.cashbackDao.getAutomatedSelectorsDataForPage(n),l=e??this.cashbackDao.getSelectorsDataForPageType(n,this.shouldMergeAllAndFinalCheckout()),u=this.getPageRegexData(l,s),d=this.readCartData();this.logExtractionStartOrEnd(!0,n,u,void 0,d,{isFromBuyNowButton:o,isFromCartMonitor:a}),this.logDebuggMesageToConsole("checkoutPageUrlData",l);const h=l?.cartSelectors;this.selectorTimeouts=this.cashbackDao.getRetailerSettings()?.getSelectorTimeouts(n);const p=this.getExtractionSelectors(l,h,void 0,n),g=this.getExtractionSelectorsAutomated(s,n),{extractionResultFromAutomated:C,extractionResult:S,extractedValuesMerged:f}=await this.extractData(p,g,!1,s,n,u,d,"",o),v={OrderTotal:this.getPriceFromString(f.purchaseTotal),ProductNames:f.productNames||f.productTitleFromImage,PricePerItem:f.productPrice,QuantityPerItem:f.productQuantity,Currency:this.getCurrency(f.purchaseTotal),ProductUrls:f.productUrls,ProductIds:f.productSkus,OrderSubTotal:this.getPriceFromString(f.orderSubTotal),ExtractionId:this.extractionId,CartDataCreationTime:Date.now(),CartId:m.v.uuidv4(),ExtractionPageRegex:u,ProductSelllers:f.productSellers,IsFromBuyNowButton:o,IsMerged:!1};if(this.logDebuggMesageToConsole("newCartDataStorageInfo",v),!this.IsNewCart(v,d))return this.logDebugOrErrorEvent("Cached cart not sent, not new cart",!1,n,u,v,!1,{isFromCartMonitor:a,isFromBuyNowButton:o}),{status:A._N.CACHED_CART_DATA_NOT_SENT,shouldLogFragment:!1};const E=r||d?.IsAlreadySent?v:this.mergeCartData(d,v);return this.logExtractionResults(S,C,f,d,v,p,g,"",!0,n,u,E,o),this.saveCartData(E,n),this.logCheckoutPageData(E,n,u,a),{status:A._N.EXTRACTION_SUCCESSFULL,shouldLogFragment:!1}}logExtractionErrors(e,t,i){if(0===e.length)return;const o=e[0],a={errors:e,isFromBuyNowButton:i},r=this.createEventForSelectorLogger(o.pageType??c.GV.UnknownPage,o.pageRegexData??"",a,"Error in ScrapperService flow",t,!0);this.logSelectorDataEvent(r)}logExtractionError(e){const t=e.metadata||e.errorMessage?O({errorMessage:e.errorMessage??""},e.metadata||{}):void 0,i=this.createEventForSelectorLogger(e.pageType??c.GV.UnknownPage,e.pageRegexData??"",t,"Error in ScrapperService flow",e.msg,!0);i.IsBrokenSelectorDetected=e.isBrokenSelectorDetected??!1,i.IsPartialBrokenSelectorDetected=e.isPartialBrokenSelectorDetected??!1,i.FullSelectorUsed=e.fullSelectorUsed??"",i.PartialSelectorUsed=e.brokenSelectorPart??"",this.logSelectorDataEvent(i)}async extractData(e,t,i,o,a,r,n,s,c){const u=[],d=[],h=(e,t)=>{e.pageType=a,e.pageRegexData=r,e.cartCachingData=n,"automated"===t?d.push(e):u.push(e)},p=this.scraperService.extractFrom(document,e,(e=>h(e,"regular")),!1),g=this.shouldDisableFallbackToAutomatedSelectors()?Promise.resolve(void 0):this.scraperService.extractFrom(document,t,(e=>h(e,"automated")),!0),[C,S]=await Promise.all([g,p]);this.logExtractionErrors(u,"regular",c),this.logExtractionErrors(d,"automated",c);let m="",A="";if(i){const e=this.getCurrentUrlValue(!1);if(o){const t=(0,l.sB)(o);m=(0,l.RT)(t,e)}s&&(A=(0,l.ql)(s,e))}const f=this.cashbackDao.getFeatureFlag("shouldPreferAutomatedSelectors",!1)?this.mergeExtractedData(C,S):this.mergeExtractedData(S,C),v=this.shouldPreferTransactionFromPage(),E=A||m,P=f.transactionId;return f.transactionId=P&&E?v?P:E:P||E,{extractionResultFromAutomated:C,extractionResult:S,extractedValuesMerged:f}}adjustLogForPausedDomainAndCurrency(e,t){const i=this.cashbackDao.getRetailerSettings()?.other,o=e.Currency;if(!i||!o)return!1;if(i.transactionIdPausedCurrencies){if("all"===i.transactionIdPausedCurrencies)return e.TransactionId="",t.push("TransactionId paused for all currencies"),!0;if(new Set(i.transactionIdPausedCurrencies.split(",")).has(o))return e.TransactionId="",t.push(`TransactionId paused for ${o}`),!0}if(i.purchaseTotalPausedCurrencies){if("all"===i.purchaseTotalPausedCurrencies)return e.PurchaseTotal="",t.push("PurchaseTotal paused for all currencies"),!0;if(new Set(i.purchaseTotalPausedCurrencies.split(",")).has(o))return e.PurchaseTotal="",t.push(`PurchaseTotal paused for ${o}`),!0}if(i.productNamesPausedCurrencies){if("all"===i.productNamesPausedCurrencies)return e.ProductNames="",t.push("ProductNames paused for all currencies"),!0;if(new Set(i.productNamesPausedCurrencies.split(",")).has(o))return e.ProductNames="",t.push(`ProductNames paused for ${o}`),!0}return!1}getOldCarts(){return{fastCart:this.GetFastCart(),oldCachedCart:this.GetLastCartData(),oldCachedCartPersistent:this.getOldCartFromPersistent()}}getOldCartFromPersistent(){try{const e=this.cashbackDao.getCurrentDomain(),t=this.cashbackDao.readFromLocalCachePersistent(f.Q.PersistentCartData),i=t?t[e]??void 0:void 0,o=i?.cartDataStorageInfo??void 0;if(o)return o}catch(e){this.logDebuggMesageToConsole("Error getting old cart from persistent",e)}}GetLastCartData(){try{const e=(0,P.Mw)(E.OY);return e&&!(0,I.TF)(e)?JSON.parse(e):null}catch(e){this.logDebuggMesageToConsole("Error getting old cart",e)}return null}GetFastCart(){try{const e=(0,P.Mw)(E.hm);if(e&&!(0,I.TF)(e))return JSON.parse(e)}catch(e){this.logDebuggMesageToConsole("Error getting fast cart",e)}return null}shouldDisableFallbackToAutomatedSelectors(){return this.cashbackDao.getFeatureFlag("isFallbackToAutomatedSelectorsDisabled",!0)}shouldPreferTransactionFromPage(){return this.cashbackDao.getFeatureFlag("preferTransactionFromPage",!1)}shouldMergeAllAndFinalCheckout(){return this.cashbackDao.getFeatureFlag("shouldMergeAllAndFinalCheckout",!0)}shouldEnableMutationObserverAttribute(){return this.cashbackDao.getFeatureFlag("shouldEnableAttribute",!1)}shouldUsePlainWait(){return this.cashbackDao.getFeatureFlag("shouldUsePlainWait",!1)}canLogConfirmationPageData(){return this.cashbackDao.getRetailerSettings()?.IsAttibutionEnabled()??!1}canLogPersonalDebugData(){return this.cashbackDao.getRetailerSettings()?.IsAttibutionEnabled()??!1}async addFinalCheckoutOrderButtonListener(e,t,i){const o=e??this.cashbackDao.getSelectorsDataForPageType(i,this.shouldMergeAllAndFinalCheckout()),a=o?.finalCheckoutButtonSelector??"";if(!a)return;const r=this.createSelectorSetting(a,"finalCheckoutButton","","",!0),n=this.getPageRegexData(o,t),s=await this.scraperService.getAllElementsForSelector(document,r,(e=>{e.pageType=i,e.pageRegexData=n,e.cartCachingData=void 0,this.logExtractionError(e)}).bind(this)),c=async()=>{this.dynamicTransactionUtils.setDynamicTransactionId(),this.logDebuggMesageToConsole("finalCheckoutButton Clicked")};if(s){this.logDebuggMesageToConsole("Adding click listener to finalCheckoutButton button");for(const e of s)e.addEventListener("click",c);return s}}async addBuyNowButtonListener(e,t,i){const o=e??this.cashbackDao.getSelectorsDataForPageType(i,this.shouldMergeAllAndFinalCheckout()),a=o?.buyNowSelector??"";if(!a)return;const r=this.createSelectorSetting(a,"buyNowButton","","",!0),n=this.getPageRegexData(o,t),s=await this.scraperService.getElementForSelector(document,r,(e=>{e.pageType=i,e.pageRegexData=n,e.cartCachingData=void 0,this.logExtractionError(e)}).bind(this));return s?(this.logDebuggMesageToConsole("Adding click listener to buy now button"),s.addEventListener("click",(async()=>{this.logDebuggMesageToConsole("Buy Now clicked"),this.extractionId=(new Date).getTime().toString();const{response:e,latency:a}=await this.runFunctionWithLatencyMeasure((()=>this.extractDataFromCheckoutPage(o,t,i,!0,!1,!0)));e.extractionTime=a,this.logExtractionStartOrEnd(!1,i,n,e,void 0,{isFromBuyNowButton:!0})})),s):void 0}async addCartMonitor(e,t,i=c.GV.CheckoutPage){const{mutationSelector:o,observeSubtree:a}=this.getCartMutationSelector(e,t);if(o){this.logDebuggMesageToConsole("Adding mutation observer for cart data extraction. mutationSelector",o);const r=this.getPageRegexData(e,t),n=e=>{e.pageType=i,e.pageRegexData=r,e.cartCachingData=void 0,this.logExtractionError(e)},s=async()=>{this.extractionId=(new Date).getTime().toString();const{response:o,latency:a}=await this.runFunctionWithLatencyMeasure((()=>this.extractDataFromCheckoutPage(e,t,i,!1,!0,!0)));o.extractionTime=a,this.logExtractionStartOrEnd(!1,i,r,o,void 0,{isFromCartMonitor:!0})},c=this.createSelectorSetting(o,"cartMutationObserver","","",!0),l=this.shouldEnableMutationObserverAttribute();await this.scraperService.addMutationObserver(document,c,n.bind(this),s.bind(this),a,l)}}getCartMutationSelector(e,t){const i={mutationSelector:"",observeSubtree:!1},o=this.cashbackDao.getFeatureFlag("useCartSelectorAsMutator",!0);if(o){const o=e?.cartSelectors?.cartSelector||t?.details?.cartMonitorSelector||"";i.mutationSelector=o,i.observeSubtree=!1}const a=this.cashbackDao.getFeatureFlag("fallbackToTotalAsMutator",!0);if(!o||!i.mutationSelector&&a){const t=e?.orderTotalDataElementSelector||"";i.mutationSelector=t,i.observeSubtree=!0}return i}getPageRegexData(e,t,i=!1){return JSON.stringify({automated:t?.urlRegex??"",regular:i?this.cashbackDao.getConfirmationPageRegex():e?.checkoutPageUrl})}saveCartData(e,t){try{const t=e?JSON.stringify(e):"";this.cashbackDao.saveToLocalCachePersistent(y,t),this.cashbackDao.saveToLocalCache(y,t)}catch(i){this.logDebugOrErrorEvent("Error saving cart data",!0,t,"",void 0,!0,{error:i,size:this.getObjectSize(e)})}}markAsUsedCartData(e){try{const e=this.readCartData();if(e){e.IsAlreadySent=!0;const t=JSON.stringify(e);this.cashbackDao.saveToLocalCachePersistent(y,t),this.cashbackDao.saveToLocalCache(y,t)}}catch(t){this.logDebugOrErrorEvent("Error in markAsUsedCartData",!0,e,"",void 0,!0,{error:t})}}getObjectSize(e){try{return e?JSON.stringify(e).length:0}catch(e){this.logDebuggMesageToConsole("Error getting object size",e)}return-1}saveProductCollectionData(e){const t=e?JSON.stringify(e):"";this.cashbackDao.saveToLocalCache(D,t)}readProductCollectionData(){const e=this.cashbackDao.readFromLocalCachePersistent(D)??[];return(this.cashbackDao.readFromLocalCache(D)??[])||e}getCurrency(e){const t=this.cashbackDao.getAfdMarket(),i=(0,v.N6)(t);return(e?(0,v.cU)(e,!0):"")||i||""}mergeCartData(e,t){return{OrderSubTotal:t?.OrderSubTotal||e?.OrderSubTotal||0,OrderTotal:t?.OrderTotal||e?.OrderTotal||0,ProductNames:t?.ProductNames||e?.ProductNames||"",Currency:t?.Currency||e?.Currency||"",PricePerItem:t?.PricePerItem||e?.PricePerItem||"",QuantityPerItem:t?.QuantityPerItem||e?.QuantityPerItem||"",ProductUrls:t?.ProductUrls||e?.ProductUrls||"",ProductIds:t?.ProductIds||e?.ProductIds||"",ProductSelllers:t?.ProductSelllers||e?.ProductSelllers||"",IsFromBuyNowButton:t?.IsFromBuyNowButton??e?.IsFromBuyNowButton??!1,ExtractionId:t?.ExtractionId||e?.ExtractionId||"",CartDataCreationTime:t?.CartDataCreationTime||e?.CartDataCreationTime||0,CartId:t?.CartId||e?.CartId||"",ExtractionPageRegex:t?.ExtractionPageRegex||e?.ExtractionPageRegex||"",IsMerged:!0}}mergeExtractedData(e,t){const i={productQuantity:e?.productQuantity||t?.productQuantity||"",productNames:e?.productNames||t?.productNames||"",productPrice:e?.productPrice||t?.productPrice||"",productTitleFromImage:e?.productTitleFromImage||t?.productTitleFromImage||"",productSkus:e?.productSkus||t?.productSkus||"",purchaseTotal:e?.purchaseTotal||t?.purchaseTotal||"",orderSubTotal:e?.orderSubTotal||t?.orderSubTotal||"",transactionId:e?.transactionId||t?.transactionId||"",productSellers:e?.productSellers||t?.productSellers||"",productUrls:e?.productUrls||t?.productUrls||"",productBrands:e?.productBrands||t?.productBrands||"",productCategories:e?.productCategories||t?.productCategories||""};return i.productTitleFromImage=this.dedupValues(i.productTitleFromImage),i}dedupValues(e){if(e){const t=e.split(this.scraperService.getSeparator()).filter((e=>!!e)),i=new Set(t);return Array.from(i).join(this.scraperService.getSeparator())+this.scraperService.getSeparator()}return""}mergeConfirmationDataWithCartCahing(e,t,i,o,a,r){const n=t?this.setConfirmationDetailsFromCartCaching(t):new S.Z;n.currency=n.currency||"",n.orderConfirmationPageUrl=a,n.transactionId=e.transactionId,o||(e.productNames&&(n.productNames=e.productNames,r.push("productNames taken from confirmation page product selector")),!n.productNames&&e.productTitleFromImage&&(n.productNames=e.productTitleFromImage,r.push("productNames taken from image on confirmation page")));const s=this.getOrderTotalSubtotalAndCurrencyIfPresent(e);if(!n.currency&&s.currency&&(n.currency=s.currency,r.push("currency taken from confirmation page")),i||s.orderTotalToUse>0&&(n.purchaseTotal=`${n.currency}${s.orderTotalToUse}`,r.push("purchaseTotal taken from confirmation page")),s.orderSubtotalToUse>0&&(n.orderSubTotalPrice=`${n.currency}${s.orderSubtotalToUse}`,r.push("orderSubTotalPrice taken from confirmation page")),e.productQuantity&&(n.quantityPerItem=e.productQuantity),e.productPrice&&(n.pricePerItem=e.productPrice),n.productNames){const e=n.productNames.split(this.scraperService.getSeparator()).filter((e=>!!e));n.numberOfItems=e.length.toString()}if(!n.purchaseTotal&&n.orderSubTotalPrice&&(n.purchaseTotal=n.orderSubTotalPrice,r.push("purchaseTotal taken from subTotal")),this.cashbackDao.getFeatureFlag("purchaseTotalInTransactionId",!1)&&n.transactionId){const e=this.getPriceFromString(n.transactionId);if(!n.currency){const e=(0,v.cU)(n.transactionId,!0);e&&(n.currency=e,r.push("currency taken from transactionId"))}e>0&&(n.purchaseTotal=`${n.currency}${e}`,r.push("purchaseTotal taken from transactionId"))}return n}getPriceFromString(e){return(0,v.UK)(e,void 0)}getOrderTotalPromProductPrices(e){return e?e.split(this.scraperService.getSeparator()).filter((e=>!!e)).map((e=>this.getPriceFromString(e))).reduce(((e,t)=>e+t),0):0}createLogData(e,t,i,o,a){const{isElectron:r,isChromeDriver:n,driverEvaluate:c,webdriverEvaluate:l,seleniumUnwrapped:u,windowCallPhantom:d,WINDOW_PHANTOM:h,windowPhantom:p}=this.getBrowserData(),g=this.cashbackDao.getSessionIds(),C=g?.retailerSessionId??"",S=g?.pageVisitId??"";let m=!1,A=!1,f="",v=this.personalDataRemover.maskDataInAString(e.transactionId??"");const E=this.personalDataRemover.maskDataInAString(e.productNames??""),P=this.personalDataRemover.deleteSecretsInURL(e.orderConfirmationPageUrl??"")??"";e.transactionId&&!v&&o.push("TransactionId was set to empty by personalDataRemover"),e.productNames&&!E&&o.push("ProductNames was set to empty by personalDataRemover"),e.orderConfirmationPageUrl&&!P&&o.push("ConfirmationPageUrl was set to empty by personalDataRemover");try{m=this.dynamicTransactionUtils.isEnabledDynamicTransactionId(this.cashbackDao?.getRetailerData()?.settings)??!1,({dynamicTransactionId:f,isValidDynamicTransactionId:A}=this.dynamicTransactionUtils.getDynamicTransactionId(this.cashbackDao?.getRetailerData()?.settings)),A&&(v=f,o.push("DynamicTransactionId is set for this transaction"))}catch{o.push("Error setting DynamicTransactionId")}const I=this.cashbackDao.getPersonalizedCashback();return{Currency:e.currency??"",Domain:(0,s.uE)(window.location.hostname),DriverEvaluate:c?JSON.stringify(c):"",EventId:this.GetEventId(),IsChromeDriver:n,IsElectron:r,NavigatorWebdriver:navigator.webdriver??!1,NumberOfItems:e.numberOfItems??"",OrderConfirmationPageUrl:P,OrderConfirmationPageUrlRegex:(0,s.og)(P,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:E,ProductSellerNames:e.productSellerNames??"",PurchaseTotal:e.purchaseTotal??"",QuantityPerItem:e.quantityPerItem??"",PersonalizationDataConsent:this.cashbackDao.getSanConsentFlag(),Rguid:I?.rGuid??"",SeleniumUnwrapped:u??"",TransactionId:v,WebdriverEvaluate:l??"",WindowCallPhantom:d??"",WindowPhantom:p?JSON.stringify(p):"",Window_Phantom:h?JSON.stringify(h):"",DomainCountry:"",RetailerDataDomain:this.cashbackDao.getCurrentDomain(),ExactConfirmationPageUrl:this.cashbackDao.getConfirmationPageRegex()??"",ESF:this.cashbackDao.getESF(),Anid:t,ActiveCashbackOffers:I?JSON.stringify(I):"",IsAADSignedIn:this.cashbackDao.isAadSignedIn(),PageUrlFields:i,PageVisitId:S,RetailerSessionId:C,DynamicTransactionId:f,IsDynamicTransaction:m,ProductBrandNames:this.getCachedProductBrands(E)??"",ProductUrls:e.productUrls??"",ProductCategories:this.getCachedProductCategories(E)??"",ExtractionId:this.extractionId,CartData:a?JSON.stringify(a):""}}getCachedProductBrands(e){try{let t=this.getProductDataFromCachedProduct(e).map((e=>e.ProductBrand)).join(this.scraperService.getSeparator())+this.scraperService.getSeparator();const i=this.scraperService.getSeparator();return t=i.repeat(t.length/i.length)===t?"":t,t}catch(e){this.logDebugOrErrorEvent("Couldn't extract data from cached PDP info",!0,c.GV.UnknownPage,"",void 0,!0,{error:e})}return""}getCachedProductCategories(e){try{let t=this.getProductDataFromCachedProduct(e).map((e=>e.ProductCategory)).join(this.scraperService.getSeparator())+this.scraperService.getSeparator();const i=this.scraperService.getSeparator();return t=i.repeat(t.length/i.length)===t?"":t,t}catch(e){this.logDebugOrErrorEvent("Couldn't extract data from cached PDP info",!0,c.GV.UnknownPage,"",void 0,!0,{error:e})}return""}getProductDataFromCachedProduct(e){let t=[];if(e)try{const i=this.readProductCollectionData()||[],o=e?.split(this.scraperService.getSeparator());o&&o.pop();for(const e of o){let o="",a="";for(const t of i)(this.isAprefixOfB(e,t?.ProductName)||this.isAprefixOfB(t?.ProductName,e))&&(o=t?.ProductBrand??"",a=t?.ProductCategory??"");t.push({ProductName:e,ProductBrand:o,ProductCategory:a})}}catch(e){this.logDebugOrErrorEvent("Couldn't extract data from cached product PDP info",!0,c.GV.UnknownPage,"",void 0,!0,{error:e})}return t}isAprefixOfB(e,t){return e=this.removeSymbolsAndSpacesFromString(e??"")??"",t=this.removeSymbolsAndSpacesFromString(t??"")??"",!(!e||!t)&&t.toLowerCase().startsWith(e.toLowerCase())}removeSymbolsAndSpacesFromString(e){return e.replace(/[,.?!@#$%^&*()[\]{}\\|?' _+=/:;<> ]/g,"")}saveTransactionIdToLocalStorage(e){if(!e)return;const t=this.getSavedTransactionIds(),i=this.cashbackDao.getCurrentDomain();t[i]||(t[i]={});const o=(new Date).getTime();if(Object.values(t[i]).length>this.MAX_TRANSACTIONS_IN_LOCALSTORAGE){let e={id:"",ts:o};Object.keys(t[i]).forEach((o=>{const a=t[i][o],r=parseInt(a);r<e.ts&&(e={id:o,ts:r})})),delete t[i][e.id]}t[i][e]=o.toString(),this.cashbackDao.saveToLocalCache(b,JSON.stringify(t))}isTransactionIdSaved(e){if(!e)return!1;const t=this.getSavedTransactionIds(),i=this.cashbackDao.getCurrentDomain();return Boolean(t&&t[i]&&t[i][e])}getSavedTransactionIds(){return this.cashbackDao.readFromLocalCache(b)??{}}clearDynamicTransactionId(){this.cashbackDao.saveToLocalCachePersistent(f.Q.DynamicTransactionId,JSON.stringify({value:""}))}logCheckoutPageData(e,t,i,o){this.logDebuggMesageToConsole("logging checkout page event",e);const a=this.createEventForSelectorLogger(t,i,{isFromCartMonitor:o},"NewExtraction:::CheckoutData","",!1,e);this.logSelectorDataEvent(a)}logExtractionStartOrEnd(e,t,i,o,a,r={}){const n="Extraction "+(e?"started":"ended"),s=this.createEventForSelectorLogger(t,i,O(O({},r),o),n,"",!1,a,void 0,o?.extractionTime);this.logSelectorDataEvent(s)}logDebugOrErrorEvent(e,t,i,o,a,r=!1,n){if(!t&&this.cashbackDao.getFeatureFlag("disableNonRequiredExtractionLogs",!1))return;const s=this.createEventForSelectorLogger(i,o,n,e,"",r,a,void 0);this.logSelectorDataEvent(s)}logSelectorDataEvent(e){this.logDebuggMesageToConsole(e.Message,e),this.logger.LogInfoWithEvenType(e.Message,c.R.SelectorDataExtraction,e,this.cashbackDao.getImpressionId())}logPurchasePageDataToDebug(e,t,i,o,a={},r){e.Anid="",this.logDebuggMesageToConsole("logging purchase event to log table only",e);const n=this.cashbackDao.getSanConsentFlag()?a:{},s=this.createEventForSelectorLogger(i,o,O(O({confirmationEvent:e},n),{},{logMessages:r}),"New purchase extraction event","",!1,t);this.logger.LogInfoWithEvenType(s.Message,c.R.SelectorDataExtraction,s,this.cashbackDao.getImpressionId())}logPurchasePageData(e,t,i,o){this.logDebuggMesageToConsole("logging purchase event",e);const a=O(O({isNewExtraction:!0,cachedCart:t,extractionId:this.extractionId},i),{},{logMessages:o});this.logger.LogInfoWithEvenType(JSON.stringify(a),c.R.ConfirmationPageDetails,e,this.cashbackDao.getImpressionId())}readCartData(){const e=this.cashbackDao.readFromLocalCachePersistent(y);return this.cashbackDao.readFromLocalCache(y)||e}getOrderTotalSubtotalAndCurrencyIfPresent(e){let t=0,i=0;const o=this.getPriceFromString(e.purchaseTotal),a=this.getPriceFromString(e.orderSubTotal);o>0&&(t=o),a>0&&(i=a,t=t>0?t:a);let r=(0,v.cU)(e.purchaseTotal,!0);return r||(r=e.productPrice?(0,v.cU)(e.productPrice,!0):""),r||(r=e.orderSubTotal?(0,v.cU)(e.orderSubTotal,!0):""),{orderTotalToUse:t,orderSubtotalToUse:i,currency:r}}setConfirmationDetailsFromCartCaching(e){const t=new S.Z;t.pricePerItem=e.PricePerItem??"",t.quantityPerItem=e.QuantityPerItem??"",t.productUrls=e.ProductUrls??"",t.productNames=e.ProductNames??"",t.productSellerNames=e.ProductSelllers??"";const i=e.Currency??"";t.currency=i;const o=e.OrderTotal>0?e.OrderTotal:0,a=e.OrderSubTotal&&e.OrderSubTotal>=0?e.OrderSubTotal:0,r=o>0?o:a;return t.orderSubTotalPrice=a>0?`${i}${a}`:"",t.purchaseTotal=r>0?`${i}${r}`:"",t}GetTimeoutForSelector(e,t=void 0){if(!e)return 0;const i=this.selectorTimeouts;return i&&void 0!==i[e]?i[e]:i?.other&&void 0!==i.other[e]?i.other[e]:i?.other&&void 0!==i.other?.all?i.other.all:t??this.requiredValuesKeyNames[e]?this.DEFAULT_EXTRACTION_TIMEOUT:this.DEFAULT_EXTRACTION_TIMEOUT_NOT_REQUIRED}IsAtLeaseOneRequiredFieldPresent(e){return Boolean(e.transactionId||e.productNames||e.purchaseTotal&&"0"!==e.purchaseTotal)}logExtractionResults(e,t,i,o,a,r,n,s,c,l,u,d=void 0,h){if(r&&this.logDebuggMesageToConsole("selectors extractByValues",r,"result",e),n&&this.logDebuggMesageToConsole("selectors extractByValues_Automated",n,"result",t),this.logDebuggMesageToConsole("result extractedData_merged",i),o&&this.logDebuggMesageToConsole("old cartCachingData",o),a&&this.logDebuggMesageToConsole("new cartCachingData",a),d&&this.logDebuggMesageToConsole("mergedCart",d),this.LogMissingExtractedValuesForSelectors(r,e,"general",d??a??o,l,u),t&&this.LogMissingExtractedValuesForSelectors(n,t,"automated",d??a??o,l,u),!c){const e=this.cashbackDao.isCartCachingEnabled(),t=this.createEventForSelectorLogger(l,u,{isCartCachingEnabled:e,selectorsUsed:r,isFromBuyNowButton:h},"No valid required fields",s,!0,d??a??o);this.logSelectorDataEvent(t)}}LogMissingExtractedValuesForSelectors(e,t,i,o,a,r){if(!e){const e=this.createEventForSelectorLogger(a,r,void 0,"No selectors for page",i,!0,o,t);return void this.logSelectorDataEvent(e)}const n={};if(Object.keys(e).forEach((i=>{if(this.requiredValuesKeyNames[i]){const o=e[i],a=t?t[i]:void 0;o?.selector&&!a&&(n[i]?n[i]+=`; ${o.selector}`:n[i]=o.selector)}})),Object.keys(n).length>0){const e=this.createEventForSelectorLogger(a,r,void 0,"Broken selectors found",i,!0,o,t);e.BrokenSelectors=JSON.stringify(n),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=m.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)}))}getBrowserData(){let e="",t="",i="",o="",a=!1;const r=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")&&(i=document.documentElement.getAttribute("__driver_evaluate")),document?.documentElement?.hasAttribute("$cdc_asdjflasutopfhvcZLmcfl_")&&(o=typeof document.documentElement.getAttribute("$cdc_asdjflasutopfhvcZLmcfl_")),a="undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process?.type||!("undefined"==typeof process||"object"!=typeof process.versions||!process.versions.hasOwnProperty("electron")),{isElectron:a,isChromeDriver:o,driverEvaluate:i,webdriverEvaluate:t,seleniumUnwrapped:e,windowCallPhantom:r,WINDOW_PHANTOM:n,windowPhantom:s}}createEventForSelectorLogger(e,t,i={},o,a,r,n=void 0,s=void 0,c){let l;l=n||this.readCartData();const u=this.cashbackDao.getSanConsentFlag(),d=u||this.canLogPersonalDebugData();i.isAttributionEnabled=d;const h=this.cashbackDao.getSessionIds();return{IsBrokenSelectorDetected:!1,IsPartialBrokenSelectorDetected:!1,BrokenSelectors:"",FullSelectorUsed:"",PartialSelectorUsed:"",Currency:n?.Currency??"",ExtractionResult:d&&s?JSON.stringify(s):"",CartData:d&&l?JSON.stringify(l):"",ErrorMessage:a,Metadata:i?JSON.stringify(i):"",Message:o,IsError:r,PageUrl:d?this.getCurrentUrlValue(!0):"",PageType:e,PageRegexUsed:d?t:"",Domain:this.cashbackDao.getCurrentDomain(),AFDMarket:this.cashbackDao.getAfdMarket(),IsSignedIn:this.cashbackDao.isSignedIn(),PageVisitId:h?.pageVisitId??"",RetailerSessionId:h?.retailerSessionId??"",PersonalizationDataConsent:u,ExtractionId:this.extractionId,Latency:c}}IsNewCart(e,t){return t?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):e.ExtractionPageRegex!==t.ExtractionPageRegex&&(this.logDebuggMesageToConsole("New and old cart difference: ExtractionPageRegex"),!0):(this.logDebuggMesageToConsole("no cached cart"),!0)}getExtractionSelectorsForPurchasePage(e){const t=this.cashbackDao.getConfirmationPageTelemetryData(),i=t?.productDetailsData&&t.productDetailsData.length>0?t.productDetailsData[0]:void 0;if(!t&&!i)return;const o=(0,l.uv)(t?.transactionIdSelector??"",!1),a={productQuantity:this.createSelectorSetting(i?.productQuantitySelector,A.fk.productQuantity),productNames:this.createSelectorSetting(i?.productIdSelector,A.fk.productNames),productTitleFromImage:this.createSelectorSetting(i?.productImageSelector,A.fk.productTitleFromImage),productPrice:this.createSelectorSetting(i?.productPriceSelector,A.fk.productPrice),productSkus:this.createSelectorSetting(i?.productIdSkuSelector,A.fk.productSkus),purchaseTotal:this.createSelectorSetting(t?.purchaseTotalSelector,A.fk.purchaseTotal),orderSubTotal:this.createSelectorSetting(t?.orderSubTotalPriceSelector,A.fk.orderSubTotal),transactionId:this.createSelectorSetting(o,A.fk.transactionId),productSellers:this.createSelectorSetting("",A.fk.productSellers),productUrls:this.createSelectorSetting("",A.fk.productUrls),productBrands:this.createSelectorSetting("",A.fk.productBrands),productCategories:this.createSelectorSetting("",A.fk.productCategories)};return this.addExtractMultipleFlag(a,e)}getExtractionSelectors(e,t,i,o){if(!t&&!e)return;const a=t?.productSelector??"",r=t?.cartSelector??"",n={productQuantity:this.createSelectorSetting(t?.productQuantitySelector,A.fk.productQuantity,r,a),productNames:this.createSelectorSetting(t?.productTitleSelector??i?.productTitleSelector,A.fk.productNames,r,a),productPrice:this.createSelectorSetting(t?.productPriceSelector??i?.productPriceSelector,A.fk.productPrice,r,a),productSkus:this.createSelectorSetting(t?.productIdSkuSelector??i?.productASIN,A.fk.productSkus,r,a),productTitleFromImage:this.createSelectorSetting(t?.productImageSelector,A.fk.productTitleFromImage,r,a),purchaseTotal:this.createSelectorSetting(e?.orderTotalDataElementSelector,A.fk.purchaseTotal),orderSubTotal:this.createSelectorSetting(e?.orderSubTotalElementSelector,A.fk.orderSubTotal),transactionId:this.createSelectorSetting("",A.fk.transactionId),productSellers:this.createSelectorSetting(t?.productSellerSelector,A.fk.productSellers,r,a),productUrls:this.createSelectorSetting(t?.productUrlSelector,A.fk.productUrls,r,a),productBrands:this.createSelectorSetting(i?.productBrandSelector,A.fk.productBrands,r,a),productCategories:this.createSelectorSetting(i?.productCategoryListSelector,A.fk.productCategories,r,a)};return this.addExtractMultipleFlag(n,o)}getExtractionSelectorsAutomated(e,t){const i={productQuantity:this.createSelectorSetting(e?.details?.productQuantity,A.fk.productQuantity),productNames:this.createSelectorSetting(e?.details?.productName,A.fk.productNames),productPrice:this.createSelectorSetting(e?.details?.productPrice,A.fk.productPrice),productSkus:this.createSelectorSetting(e?.details?.productId,A.fk.productSkus),productTitleFromImage:this.createSelectorSetting(e?.details?.getProductNamesFromImg,A.fk.productTitleFromImage),purchaseTotal:this.createSelectorSetting(e?.details?.orderTotalPrice,A.fk.purchaseTotal),orderSubTotal:this.createSelectorSetting(e?.details?.orderSubTotalPrice,A.fk.orderSubTotal),transactionId:this.createSelectorSetting(e?.details?.orderId,A.fk.transactionId),productSellers:this.createSelectorSetting("",A.fk.productSellers),productUrls:this.createSelectorSetting("",A.fk.productUrls),productBrands:this.createSelectorSetting("",A.fk.productBrands),productCategories:this.createSelectorSetting("",A.fk.productCategories)};return this.addExtractMultipleFlag(i,t)}getCurrentUrlValue(e){const t=this.cashbackDao.getLastCommittedURL();return e?this.personalDataRemover.getCurrentUrlValue(e,t):t}createSelectorSetting(e,t,i="",o="",a=void 0){const r={selector:e??"",timeout:this.GetTimeoutForSelector(t,a),keyName:t};return t===A.fk.productUrls&&(r.isLink=!0),t===A.fk.productNames&&(r.shouldSplitSelector=!1),this.shouldUsePlainWait()&&(r.usePlainWait=!0),i&&!this.cashbackDao.getFeatureFlag("removeCartParentSelector",!1)&&(r.parentElementSelector=i),i&&(r.parentElementSelector=i),o&&(r.productElementSelector=o),r}addExtractMultipleFlag(e,t){const i=t===c.GV.ProductPage,o={productQuantity:!0,productNames:!i,productPrice:!0,purchaseTotal:!1,orderSubTotal:!1,transactionId:!1,productTitleFromImage:!0,productSkus:!0,productSellers:!0,productUrls:!0,productBrands:!i,productCategories:!i};return Object.keys(e).forEach((t=>{if(o[t]&&e[t]){const i=o[t]??!1;e[t].shouldExtractAll=i}})),e}addOrUpdateProductInfoInCollection(e,t){if(e.ProductName)try{const t=this.readProductCollectionData(),i=t?.findIndex((t=>t.ProductName===e.ProductName));-1!==i?t[i]=e:(t.length>=100&&t.shift(),t.push(e)),this.saveProductCollectionData(t)}catch(i){this.logDebugOrErrorEvent("Couldn't add product to collection",!0,t,"",void 0,!0,{error:i,size:this.getObjectSize(e)})}}isValidPageUrl(){return this.getCurrentUrlValue(!1).startsWith("http")}getLocalStorageKeyForProductCollection(){return D}getLocalStorageKeyForCartData(){return y}logDebuggMesageToConsole(...e){}}class R{LogColdPathTelemetryEvent(e,t,i,o,a=!1){r.Q.sendLogEventMessageV2(i,t,o,e,a?c.in.Error:c.in.Information)}LogInfoWithEvenType(e,t,i,o){r.Q.sendLogEventMessage(i,t,o,e,c.in.Information)}}var _=i(45822);function k(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function w(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?k(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class x{constructor(){(0,o.Z)(this,"mutationObserver",void 0)}getSeparator(){return x.SEP}async getElementForSelector(e,t,i){try{return await this.WaitForElementToBePresentOnPage(t.timeout,t.selector,e,t.usePlainWait),this.getElement(t.selector,e)}catch(e){i({msg:"ERROR getElementForSelector",errorMessage:e.toString(),metadata:w({},t)})}}async getAllElementsForSelector(e,t,i){try{return await this.WaitForElementToBePresentOnPage(t.timeout,t.selector,e,t.usePlainWait),this.getElements(t.selector,e)}catch(e){i({msg:"ERROR getAllElementsForSelector",errorMessage:e.toString(),metadata:w({},t)})}}async extractFrom(e,t,i,o=!1){if(!t)return;let a=!1;const r={productQuantity:"",productNames:"",productPrice:"",productTitleFromImage:"",productSkus:"",purchaseTotal:"",orderSubTotal:"",transactionId:"",productSellers:"",productUrls:"",productBrands:"",productCategories:""};try{const n=Object.values(t),s=n.filter((e=>e.timeout>0&&!!e.selector)),c=n.filter((e=>e.timeout<=0&&!!e.selector)),l=s.map((t=>this.extractFromElement(t,e,i,o))),u=await Promise.all(l);c.forEach((t=>{u.push(this.extractFromElementSync(t,e,i,o))}));for(const e of u)r[e.key]=e.value,!a&&e.value&&(a=!0)}catch(a){i({msg:"ERROR extractFrom",errorMessage:a.toString(),metadata:{element:typeof e,valueSelectors:t,isFromAutomated:o}})}return a?r:void 0}async addMutationObserver(e,t,i,o,a=!1,r=!0){try{if(!t.selector)return void this.disconnectObserver();const n=await this.getElementForSelector(e,t,i);if(!n)return void this.disconnectObserver();this.addMuttionObserver(o),this.disconnectObserver(),this.startObserving(n,r,a)}catch(e){this.disconnectObserver(),i({msg:"error adding monitor",errorMessage:e.toString(),metadata:{selectorSettings:t}})}}addMuttionObserver(e){this.mutationObserver||(this.mutationObserver=new MutationObserver((async t=>{await e()})))}startObserving(e,t,i){if(this.mutationObserver){const o={attributes:t,characterData:!0,childList:!0,subtree:i};this.mutationObserver.observe(e,o)}}disconnectObserver(){this.mutationObserver&&this.mutationObserver.disconnect()}extractFromElementSync(e,t,i,o){let a="";const r={isFromAutomated:o,key:e.keyName};try{let r;e.parentElementSelector&&(r=this.getParentElement(t,e,i,o)),e.productElementSelector&&(a=this.getDataFromProductElements(r??t,e,i,o)),!a&&r&&(a=this.extractDataFromElement(e,r,i,o)),a||(a=this.extractDataFromElement(e,t,i,o))}catch(t){i({msg:"error in extractFromElementSync",errorMessage:t?.Message??t.toString(),fullSelectorUsed:e.selector,metadata:r})}return{key:e.keyName,value:a}}async waitForOneElement(e,t,i,o){try{if(e.parentElementSelector)return void await this.WaitForElementToBePresentOnPage(e.timeout,e.parentElementSelector,t,e.usePlainWait);if(e.productElementSelector)return void await this.WaitForElementToBePresentOnPage(e.timeout,e.productElementSelector,t,e.usePlainWait);await this.WaitForElementToBePresentOnPage(e.timeout,e.selector,t,e.usePlainWait)}catch(t){i({msg:"error in waitForOneElement",errorMessage:t?.Message??t.toString(),fullSelectorUsed:e.selector,metadata:{isFromAutomated:o,key:e.keyName}})}}async extractFromElement(e,t,i,o){if(!e.selector)return{key:e.keyName,value:""};await this.waitForOneElement(e,t,i,o);const a=this.extractFromElementSync(e,t,i,o).value;return{key:e.keyName,value:a}}getDataFromProductElements(e,t,i,o){if(!t.productElementSelector)return"";const a=this.getElements(t.productElementSelector??"",e),r=[];for(const e of a){const a=this.extractDataFromElement(w(w({},t),{},{shouldExtractAll:!1}),e,i,o);a&&r.push(a)}return r.length>0?r.join(x.SEP)+x.SEP:(0===a.length&&i({msg:"product selector present but product elements cannot be found",fullSelectorUsed:t.productElementSelector,metadata:{isFromAutomated:o,key:t.keyName}}),"")}getParentElement(e,t,i,o){if(!t.parentElementSelector)return;const a=this.getElement(t.parentElementSelector,e);return a||i({msg:"parent selector present but parent cannot be found",fullSelectorUsed:t.parentElementSelector,metadata:{isFromAutomated:o,key:t.keyName}}),a}async WaitForElementToBePresentOnPage(e,t,i,o=!1){if(e<=0)return;const a=e>x.MAX_TIMEOUT?x.MAX_TIMEOUT:e;o?await(0,d._R)(a):await this.WaitForCondition((()=>this.IsElementPresentOnPage(t,i)),a)}IsElementPresentOnPage(e,t){return null!=this.getElement(e,t)}getElement(e,t){if(e.includes(x.SHADOW_ROOT_SEP)){const i=this.getShadowRootData(e,t);return i.length>0?i[i.length-1]:void 0}const i=t.querySelector(e);if(i)return i}getElements(e,t){if(e.includes(x.SHADOW_ROOT_SEP))return this.getShadowRootData(e,t);const i=t.querySelectorAll(e);return i&&i.length>0?i:[]}extractDataFromElement(e,t,i,o){if(e.selector.includes(x.SHADOW_ROOT_SEP)){const i=this.getShadowRootData(e.selector,t);return this.extractAsTextShadowRoots(i,e.shouldExtractAll,e.useInnerText,e.isLink)}const a={isFromAutomated:o,key:e.keyName};let r="";const n=e.shouldSplitSelector??!0,s=e.selector.split(",").reverse(),c=s.join(",");if(n&&s.length>1)for(const o of s){const n=this.extractAsText(t,o,e.shouldExtractAll,e.useInnerText,e.isLink);if(n){r=n;break}i({msg:"Value not found for partial selector",brokenSelectorPart:o,isPartialBrokenSelectorDetected:!0,fullSelectorUsed:e.selector,metadata:a})}return r||(r=this.extractAsText(t,c,e.shouldExtractAll,e.useInnerText,e.isLink),r||i({msg:"Broken selector full",fullSelectorUsed:c,isBrokenSelectorDetected:!0,metadata:a})),r}extractAsTextShadowRoots(e,t,i,o){let a="";for(const r of e)if(r){const e=this.getTextContent(r,i,o);if(e){if(!t)return e;a+=e+x.SEP}}return a}extractAsText(e,t,i,o,a){let r="";const n=e.querySelectorAll(t);for(const e of n)if(e){const t=this.getTextContent(e,o,a);if(t){if(!i)return t;r+=t+x.SEP}}return r}getTextContent(e,t,i){if(i)return e?.getAttribute("href")??"";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:e&&"img"===e.tagName.toLowerCase()?e.alt:t&&e?e.innerText??"":e?.textContent??"";return(o?this.StripMultipleSpaces(this.StripInvalidJSONCharacters(o)):"").trim()}StripMultipleSpaces(e){return e.replace(/\s\s+/g," ")}StripInvalidJSONCharacters(e){return e.replace(/\n/gi,"")}getShadowRootData(e,t){const i=e.split(x.SHADOW_ROOT_SEP);let o=t.querySelectorAll(i[0]);for(const e of i.slice(1)){const t=o[0]?.shadowRoot;if(!t)break;o=t.querySelectorAll(e)}return o||[]}async WaitForCondition(e,t){if(t<=0)return e();let i=9;const o=Math.ceil(t/i);if(o<=0)return e();for(;i>0&&!e();)i--,await(0,d._R)(o);return e()}}(0,o.Z)(x,"SEP","<SEP>"),(0,o.Z)(x,"SHADOW_ROOT_SEP","<"),(0,o.Z)(x,"MAX_TIMEOUT",1e4);var U=x,M=i(82315),L=i(52056),B=i(54869);class F{constructor(e,t,i,a){(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"personalDataRemover",void 0),(0,o.Z)(this,"cashbackDAO",void 0),(0,o.Z)(this,"cartExtractionService",void 0),(0,o.Z)(this,"cashbackLogger",void 0),(0,o.Z)(this,"scraperService",void 0),(0,o.Z)(this,"sessionIds",void 0),(0,o.Z)(this,"dynamicTransactionId",void 0),(0,o.Z)(this,"anid",""),(0,o.Z)(this,"esf",""),this.apiResponse=e??M.Z.getApiResponse(),this.sessionIds=t??B.Z.GetLocalDataService()?.GetSessionIds(),this.anid=i||"",this.esf=a||""}getPersonalDataRemover(){return this.personalDataRemover||(this.personalDataRemover=new a.Z(this.getCashbackDao())),this.personalDataRemover}getDynamicTransactionId(){return this.dynamicTransactionId||(this.dynamicTransactionId=new class{constructor(){}getDynamicTransactionId(e){try{const t=n.Q?.DynamicTransactionId??"";return t&&this.isEnabledDynamicTransactionId(e)?{dynamicTransactionId:t,isValidDynamicTransactionId:!0}:{dynamicTransactionId:t,isValidDynamicTransactionId:!1}}catch(e){return{dynamicTransactionId:"",isValidDynamicTransactionId:!1}}}isEnabledDynamicTransactionId(e){try{return!!e&&(e?.transactionIdSettings?.shouldAutoGenerate??!1)}catch(e){return}}setDynamicTransactionId(){const e=m.Z.uuidv4();L.Z.SendStorageMessage(f.Q.DynamicTransactionId,JSON.stringify({value:e}))}}),this.dynamicTransactionId}getCashbackLogger(){return this.cashbackLogger||(this.cashbackLogger=new R),this.cashbackLogger}getFragmentCollectionService(){return new class{constructor(e,t,i){(0,o.Z)(this,"cashbackDAO",void 0),(0,o.Z)(this,"cashbackLogger",void 0),(0,o.Z)(this,"personalDataRemover",void 0),(0,o.Z)(this,"DEFAULT_FRAGMENT_COLLECTION_TIMEOUT",2e3),(0,o.Z)(this,"currentUrlMasked",""),(0,o.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=i,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="",i){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 o=this.cashbackDAO.getHtmlCollectionRate()||"0",a=void 0!==i?i:parseFloat(o);if(!(0,_.P4)()&&Math.random()>a)return void this.logDebuggMesageToConsole("No collection. Generated number is above rate");const r=this.cashbackDAO.getPageType();if(!e&&!(0,_.Ak)(r))return void this.logDebuggMesageToConsole(`do not collect page of type ${r}`);const n=this.cashbackDAO.getRetailerSettings()?.GetFragmentCollectionTimeout(r)||this.DEFAULT_FRAGMENT_COLLECTION_TIMEOUT;await this.logHtmlFragment(a,r,o,t,n)}getPiiRemovalSelector(){const e=this.cashbackDAO.getRetailerData(),t=this.cashbackDAO.getPageType(),i=this.cashbackDAO.getLastCommittedURL();return this.personalDataRemover.getPiiRemovalSelector(e,t,i)}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,i,o,a){this.logDebuggMesageToConsole("log html for pageType",t),await(0,d._R)(a);const r=this.cashbackDAO.getImpressionId(),n=this.getHtmlFragmentTelemetryMetadata(t,i);n.HtmlFragment=this.getHtmlFragment(),n.HtmlFragment?(n.HtmlFragment=btoa(encodeURIComponent(n.HtmlFragment)),this.cashbackLogger.LogColdPathTelemetryEvent(`Fragment collection form NewHtmlFragmentCollectionService;collectionRate:${e}. ${o}`,c.R.HtmlFragment,n,r)):this.logError(`HtmlFragmentTelemetry:::Failed to log fragment. ${o}`,t,"HtmlFragmentTelemetry error",{collectionRate:e,rateFromBackend:i})}logError(e,t,i="",o=void 0){const a=this.cashbackDAO.getSessionIds(),r={Metadata:o?JSON.stringify(o):"",Domain:this.cashbackDAO.getCurrentDomain(),AFDMarket:this.cashbackDAO.getAfdMarket(),IsSignedIn:this.cashbackDAO.isSignedIn(),PageVisitId:a?.pageVisitId??"",RetailerSessionId:a?.retailerSessionId??"",PersonalizationDataConsent:this.cashbackDAO.getSanConsentFlag(),ErrorMessage:i,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(r.Message),this.cashbackLogger.LogInfoWithEvenType(e,c.R.SelectorDataExtraction,r,this.cashbackDAO.getImpressionId())}getHtmlFragmentTelemetryMetadata(e,t){const i=this.cashbackDAO.getCurrentDomain(),o=this.cashbackDAO.getSessionIds(),a=o?.retailerSessionId??"",r=o?.pageVisitId??"";return this.logDebuggMesageToConsole("retailerSessionId",a),this.logDebuggMesageToConsole("pageVisitId",r),{Domain:i,TimeToMask:"",PageType:e,PageUrl:this.currentUrlMasked,aOCFragmentCollectionRate:t,HtmlFragment:"",EncryptionKey:"",RetailerSessionId:a,PageVisitId:r}}getCurrentUrlValue(e){return this.personalDataRemover.getCurrentUrlValue(e,this.cashbackDAO.getLastCommittedURL())}getHtmlFragment(){const e=this.cloneNodeWithPlaceholders(document.documentElement,!1,performance.now()),t=this.getPiiRemovalSelector();return this.personalDataRemover.maskDataInADocumentBySelector(e,t),e?.outerHTML??""}cloneNodeWithPlaceholders(e,t,i){const o=new URL(this.cashbackDAO.getLastCommittedURL());if(performance.now()-i>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 i=e.cloneNode(!1);return t&&(i.textContent="*****"),i}if(e.nodeType===Node.ELEMENT_NODE){const t=e;if("hidden"===window.getComputedStyle(t).visibility)return null;const a=t.getAttribute("id");if(a&&a.startsWith("batBeacon"))return null;const r=t.cloneNode(!1);let n=!1;const s=t.getAttributeNames();for(const e of s){if(this.DISALLOWED_NAMES.has(e.toLowerCase())){n=!0;break}for(const i of this.DISALLOWED_NAMES)if(t.getAttribute(e)?.toLowerCase()?.includes(i)){n=!0;break}if(n)break}["src","href"].forEach((e=>{this.convertToAbsoluteUrl(t,r,e,o)}));for(const e of t.childNodes){const t=this.cloneNodeWithPlaceholders(e,n,i);t&&r.appendChild(t)}return r}return null}convertToAbsoluteUrl(e,t,i,o){const a=e.getAttribute(i);if(a&&!a.startsWith("http")&&!a.startsWith("//")){const e=new URL(a,o).toString();t.setAttribute(i,e)}}logDebuggMesageToConsole(...e){}}(this.getCashbackDao(),this.getCashbackLogger(),this.getPersonalDataRemover())}getScrapperService(){return this.scraperService||(this.scraperService=new U),this.scraperService}getPurchaseExtractionService(){return this.cartExtractionService||(this.cartExtractionService=new N(this.getCashbackLogger(),this.getScrapperService(),this.getCashbackDao(),this.getPersonalDataRemover(),this.getDynamicTransactionId())),this.cartExtractionService}getCashbackDao(){return this.cashbackDAO||(this.cashbackDAO=new class{constructor(e,t,i,a,r,n){(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"sessionIds",void 0),(0,o.Z)(this,"settings",void 0),(0,o.Z)(this,"retailerData",void 0),(0,o.Z)(this,"anid",""),(0,o.Z)(this,"esf",""),(0,o.Z)(this,"hasLocalStorageAccess",!0),(0,o.Z)(this,"logger",void 0),(0,o.Z)(this,"personalDataRemover",void 0),this.apiResponse=e,this.sessionIds=t,this.anid=i,this.esf=a,this.settings=new u.Z(e?.retailerData?.settings),e?.retailerData&&(this.retailerData=p.Z.Create(e.retailerData)),this.hasLocalStorageAccess=this.isLocalStorageAvailable(),this.logger=r,this.personalDataRemover=n}getDataMaskRules(){const e=this.apiResponse?.retailerData?.dataMaskRules,t=[];if(e&&e.length>0)for(const i of e)if(i?.ruleName&&i?.ruleValue&&i?.maskType){const e=new h.Z(i?.ruleName,i?.maskType,i?.ruleValue);t.push(e)}return t}isTraveldomain(){return this.apiResponse?.retailerData?.isTravelDomain??!1}getConfirmationPageRegex(){return this.apiResponse?.retailerData?.orderConfirmationPageUrl}getPlatform(){return this.apiResponse?.retailerData?.platform??""}getSanConsentFlag(){return(0,d.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(){const e=(0,l.E)(this.getLastCommittedURL(),this.getCurrentDomain(),this.getRetailerData(),this.getConfirmationPageTelemetryData(),this.getAfdMarket(),this.getFeatureFlag("shouldIgnoreAutomatedSelectorsForPageType",!0),this.getFeatureFlag("shouldPreferAutomatedSelectors",!1));if(e.errorMessage.trim()){const t="Error in getPageType";this.logErrorEvent(t,e.errorMessage)}return e.pageType}getAutomatedSelectorsDataForPage(e){return(0,l.IL)(e,this.getAutomatedSelectorsData(),this.getLastCommittedURL())}isCartCachingEnabled(){return this.getConfirmationPageTelemetryData()?.isCartCachingEnabled??!0}getAfdMarket(){return this.apiResponse?.aFDMarket??""}getLastCommittedURL(){return window.location.toString()}getSelectorsDataForPageType(e,t){const i=this.apiResponse?.retailerData?.allCheckoutPages,o=this.apiResponse?.retailerData?.allFinalCheckoutPages,a=(0,l._B)(i,this.getLastCommittedURL(),e),r=(0,l._B)(o,this.getLastCommittedURL(),e);return t&&a&&r?C(C({},a),r):r||a}getAnid(){return this.anid}getConfirmationPageTelemetryData(){return this.apiResponse?.retailerData?.confirmationPageTelemetry}isFragmentCollectionEnabled(){return(0,d.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){this.hasLocalStorageAccess&&window.localStorage.setItem(e,t)}saveToLocalCachePersistent(e,t){r.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){if(this.hasLocalStorageAccess)try{const t=window.localStorage.getItem(e);if(t)return JSON.parse(t)}catch(e){return}}getRetailerData(){return this?.retailerData}getFeatureFlag(e,t){return this.getRetailerSettings()?.GetOtherFeatureFlag(e,t)??t}getAutomatedSelectorsData(){return this.apiResponse?.retailerData?.allAutomatedSelectors??[]}isLocalStorageAvailable(){try{if("undefined"!=typeof window&&window?.localStorage){const e="test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}return!1}catch(e){return!1}}logErrorEvent(e,t){const i=this.getSanConsentFlag(),o=this.getSessionIds(),a={IsBrokenSelectorDetected:!1,IsPartialBrokenSelectorDetected:!1,BrokenSelectors:"",FullSelectorUsed:"",PartialSelectorUsed:"",Currency:"",ExtractionResult:"",CartData:"",ErrorMessage:"",Metadata:t,Message:e,IsError:!0,PageUrl:(i?this.getMaskedUrl():"")??"",PageType:c.GV.UnknownPage,PageRegexUsed:"",Domain:this.getCurrentDomain(),AFDMarket:this.getAfdMarket(),IsSignedIn:this.isSignedIn(),PageVisitId:o?.pageVisitId??"",RetailerSessionId:o?.retailerSessionId??"",PersonalizationDataConsent:i,ExtractionId:""};this.logger?.LogInfoWithEvenType(a.Message,c.R.SelectorDataExtraction,a,this.getImpressionId())}getMaskedUrl(){const e=this.getLastCommittedURL();return this.personalDataRemover?.getCurrentUrlValue(!0,e)}}(this.apiResponse,this.sessionIds,this.anid,this.esf,this.cashbackLogger,this.personalDataRemover)),this.cashbackDAO}static initFactory(e,t,i,o){return this.instance||(this.instance=new F(e,t,i,o)),this.instance}static getFactory(){return this.instance?this.instance:this.initFactory(void 0,void 0,"","")}static resetFactory(e,t,i,o){this.instance=new F(e,t,i,o),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,o.Z)(F,"instance",void 0);var Z=F},60269:function(e,t,i){var o=i(72370);t.Z=class{constructor(){(0,o.Z)(this,"retailerData",void 0),(0,o.Z)(this,"impressionId",void 0),(0,o.Z)(this,"coupons",void 0),(0,o.Z)(this,"suppressedCoupons",void 0),(0,o.Z)(this,"market",void 0),(0,o.Z)(this,"userPersonalizationInfo",void 0),(0,o.Z)(this,"cashback",void 0),(0,o.Z)(this,"isCashbackEstimationSupportedForDomain",void 0),(0,o.Z)(this,"userInfo",void 0)}}},29853:function(e,t,i){i.d(t,{Z:function(){return A}});var o=i(72370),a=i(69886),r=i(99182),n=i(6747);class s{constructor(){(0,o.Z)(this,"cartSelector",void 0),(0,o.Z)(this,"collapsedCartProductImageSelector",void 0),(0,o.Z)(this,"productSelector",void 0),(0,o.Z)(this,"productTitleSelector",void 0),(0,o.Z)(this,"productPriceSelector",void 0),(0,o.Z)(this,"productImageSelector",void 0),(0,o.Z)(this,"productUrlSelector",void 0),(0,o.Z)(this,"productQuantitySelector",void 0),(0,o.Z)(this,"productSellerSelector",void 0),(0,o.Z)(this,"productSellerRegex",void 0),(0,o.Z)(this,"productIdSkuSelector",void 0),(0,o.Z)(this,"productIdSkuRegex",void 0),(0,o.Z)(this,"productIdSkuAttribute",void 0),(0,o.Z)(this,"productPriceRegex",void 0),(0,o.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,o.Z)(this,"productTitleSelector",void 0),(0,o.Z)(this,"productSellerSelector",void 0),(0,o.Z)(this,"productBrandSelector",void 0),(0,o.Z)(this,"productImageSelector",void 0),(0,o.Z)(this,"productOutOfStockSelector",void 0),(0,o.Z)(this,"productPriceSelector",void 0),(0,o.Z)(this,"productASIN",void 0),(0,o.Z)(this,"productUPCSelector",void 0),(0,o.Z)(this,"aggregateRatingSelector",void 0),(0,o.Z)(this,"aggregateRatingNumberOfRatingsSelector",void 0),(0,o.Z)(this,"reviewSelector",void 0),(0,o.Z)(this,"reviewRatingSelector",void 0),(0,o.Z)(this,"reviewDateSelector",void 0),(0,o.Z)(this,"reviewerNameSelector",void 0),(0,o.Z)(this,"productCategoryListSelector",void 0),(0,o.Z)(this,"productCategoryRegex",void 0),(0,o.Z)(this,"productBrandRegex",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.productCategoryListSelector=e.productCategoryListSelector,t.productCategoryRegex=e.productCategoryRegex,t.productBrandRegex=e.productBrandRegex,t}}var u=l;class d{constructor(){(0,o.Z)(this,"otherSellersOverlayLinkSelector",void 0),(0,o.Z)(this,"otherSellerOfferElementSelector",void 0),(0,o.Z)(this,"otherSellerHeadingSelector",void 0),(0,o.Z)(this,"otherSellerPriceSelector",void 0),(0,o.Z)(this,"otherSellerNameSelector",void 0),(0,o.Z)(this,"productImageSelector",void 0),(0,o.Z)(this,"otherSellerRatingSelector",void 0),(0,o.Z)(this,"otherSellerDeliverySelector",void 0),(0,o.Z)(this,"otherSellerAddButtonSelector",void 0),(0,o.Z)(this,"otherSellerAddedConfirmationSelector",void 0),(0,o.Z)(this,"otherSellerLowestPriceSelector",void 0),(0,o.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,o.Z)(this,"checkoutPageUrl",void 0),(0,o.Z)(this,"priceSelector",void 0),(0,o.Z)(this,"startDateSelector",void 0),(0,o.Z)(this,"endDateSelector",void 0),(0,o.Z)(this,"domainType",void 0),(0,o.Z)(this,"nameSelector",void 0),(0,o.Z)(this,"isRoundTripSelector",void 0),(0,o.Z)(this,"dateSeparationRegex",void 0),(0,o.Z)(this,"dateCleaningRegex",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.dateCleaningRegex=e.dateCleaningRegex,t.dateSeparationRegex=e.dateSeparationRegex,t}}var g=p;class C{constructor(){(0,o.Z)(this,"pageUrlMatchRegex",void 0),(0,o.Z)(this,"flightPriceSelector",void 0),(0,o.Z)(this,"returnFlightPriceSelector",void 0),(0,o.Z)(this,"startDateSelector",void 0),(0,o.Z)(this,"endDateSelector",void 0),(0,o.Z)(this,"domainType",void 0),(0,o.Z)(this,"sourceLocationSelector",void 0),(0,o.Z)(this,"destinationLocationSelector",void 0),(0,o.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,o.Z)(this,"inputBoxSelector",void 0),(0,o.Z)(this,"applyButtonSelector",void 0),(0,o.Z)(this,"removeCouponButtonSelector",void 0),(0,o.Z)(this,"orderTotalDataElementSelector",void 0),(0,o.Z)(this,"orderTotalDataContainerElementSelector",void 0),(0,o.Z)(this,"orderSubTotalElementSelector",void 0),(0,o.Z)(this,"disabled",void 0),(0,o.Z)(this,"checkoutPageUrl",void 0),(0,o.Z)(this,"layoutClickSelector",void 0),(0,o.Z)(this,"clickBeforeStartSelector",void 0),(0,o.Z)(this,"finalCheckoutButtonSelector",void 0),(0,o.Z)(this,"edgeEnabled",void 0),(0,o.Z)(this,"couponAcceptedMessageElementSelector",void 0),(0,o.Z)(this,"closeModal",void 0),(0,o.Z)(this,"appliedCouponSelector",void 0),(0,o.Z)(this,"errorMessageSelector",void 0),(0,o.Z)(this,"couponSuccessMessageSelectors",void 0),(0,o.Z)(this,"couponFailureMessageSelectors",void 0),(0,o.Z)(this,"enabledTips",void 0),(0,o.Z)(this,"otherSellerSelectors",void 0),(0,o.Z)(this,"clippingSelectors",void 0),(0,o.Z)(this,"cartSelectors",void 0),(0,o.Z)(this,"catalogSelectors",void 0),(0,o.Z)(this,"clickForCartSelector",void 0),(0,o.Z)(this,"socialSelectors",void 0),(0,o.Z)(this,"pinterestSelectors",void 0),(0,o.Z)(this,"automatedCartExtractionEnabled",void 0),(0,o.Z)(this,"shipmentSelector",void 0),(0,o.Z)(this,"preTaxSelector",void 0),(0,o.Z)(this,"estimatedTaxSelector",void 0),(0,o.Z)(this,"waitAfterApplyingCurrentCoupon",void 0),(0,o.Z)(this,"manualCouponApplyTrackingEnabled",void 0),(0,o.Z)(this,"suggestedCouponElementSelector",void 0),(0,o.Z)(this,"suggestedCouponRegex",void 0),(0,o.Z)(this,"suggestedCouponsOnlyPage",void 0),(0,o.Z)(this,"supportedNoOrderTotal",void 0),(0,o.Z)(this,"domMutationEnabled",void 0),(0,o.Z)(this,"pageType",void 0),(0,o.Z)(this,"automaticCouponSavingsSelector",void 0),(0,o.Z)(this,"travelCheckoutSelectors",void 0),(0,o.Z)(this,"isAutoShowDisabled",void 0),(0,o.Z)(this,"productAddToCartSelector",void 0),(0,o.Z)(this,"buyNowSelector",void 0),(0,o.Z)(this,"pageUrlRegex",void 0),(0,o.Z)(this,"pageTypeSelector",void 0),(0,o.Z)(this,"addToCartOverlaySelector",void 0),(0,o.Z)(this,"getProductNamesFromImg",void 0),(0,o.Z)(this,"productTitleSearchSelector",void 0),(0,o.Z)(this,"travelSearchSelectors",void 0),(0,o.Z)(this,"isHomePageSameAsCheckout",void 0),(0,o.Z)(this,"priceDivideByQuantity",void 0),(0,o.Z)(this,"piiRemovalSelector",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.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,t.piiRemovalSelector=e.piiRemovalSelector,e.otherSellerSelectors&&(t.otherSellerSelectors=h.Create(e.otherSellerSelectors)),e.clippingSelectors&&(t.clippingSelectors=a.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=r.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,i){i.d(t,{p:function(){return d}});var o=i(72370),a=i(31656),r=i(21597),n=i(89366),s=i(86743),c=i(3274),l=i(52056);class u extends n.Z{constructor(...e){super(...e),(0,o.Z)(this,"initializeStartTime",performance.now()),(0,o.Z)(this,"scriptRunNum",0),(0,o.Z)(this,"apiResponseParam",[])}initializeRuntime(e){0!==this.scriptRunNum&&(this.initializeStartTime=performance.now()),this.apiResponseParam=e}handleMessages(e,t){let i,o;this.apiResponseParam&&(this.apiResponseParam.length>r.$R.enabled_features&&(i=this.apiResponseParam[r.$R.enabled_features]),o=this.GetEnabledServiceFeatures()),a.R.Create(i,o);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>r.$R.enabled_service_features&&this.apiResponseParam[r.$R.enabled_service_features].length>0?e=this.apiResponseParam[r.$R.enabled_service_features]:this.apiResponseParam.length>r.$R.checkout_enabled_service_features_v2&&this.apiResponseParam[r.$R.checkout_enabled_service_features_v2].length>0&&(e=this.apiResponseParam[r.$R.checkout_enabled_service_features_v2]),e}}const d=new u},46261:function(e,t,i){i.d(t,{GA:function(){return n},LE:function(){return r},Wi:function(){return a}});var o=i(72370);const a="CheckoutStatus",r=18e4;class n{constructor(){(0,o.Z)(this,"CheckoutTime",void 0),(0,o.Z)(this,"CheckoutButtonClicked",void 0),(0,o.Z)(this,"CartId",void 0),(0,o.Z)(this,"CartValue",void 0)}}},1094:function(e,t,i){i.d(t,{Z:function(){return I}});var o=i(66933),a=i(21488),r=i(29247),n=i(36493),s=i(91495),c=i(44092),l=i(27689),u=i(9448),d=i(90066),h=i(82315),p=i(72370),g=i(5144),C=i(56372),S=i(52056);class m extends C.Z{constructor(...e){super(...e),(0,p.Z)(this,"traceId",void 0)}init(e,t,i,o){this.initCommonInfo(e,t,i,g.G7.Validator),this.traceId=o,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 i="error";S.Z.SendLogEvent(e,t,i,void 0,void 0,void 0),S.Z.SendMessage(u.H.CheckoutPageValidationError,[i,this.traceId])}catch(e){}}}var A=m,f=i(60269),v=i(44922),E=i(46557),P=i(11849),I=class{static CreateCheckoutPageData(e){if(e){const t=new f.Z;if(e.retailerData&&(t.retailerData=E.Z.Create(e.retailerData)),e.impressionId&&(t.impressionId=e.impressionId),e.coupons){t.coupons=[];for(const i of e.coupons)t.coupons.push(i)}if(e.suppressedCoupons){t.suppressedCoupons=[];for(const i of e.suppressedCoupons)t.suppressedCoupons.push(i)}return e.userPersonalizationInfo&&(t.userPersonalizationInfo=e.userPersonalizationInfo),e.market&&(t.market=e.market),e.cashback&&(t.cashback=o.Z.Create(e.cashback)),e.userInfo&&(t.userInfo=a.Z.Create(e)),t.isCashbackEstimationSupportedForDomain=e.isCashbackEstimationSupportedForDomain,t}return new f.Z}static GetInitialFields(e){const t=[],i=e.retailerData.getCurrentCheckoutPage();return i&&[i.inputBoxSelector,i.removeCouponButtonSelector,i.clickBeforeStartSelector,i.layoutClickSelector].forEach((e=>{r.ZP.IsValidDataField(e)&&t.push(e)})),t}static GetInitialFieldsByCurrentCheckoutPageData(e){const t=[];return e&&[e.inputBoxSelector,e.removeCouponButtonSelector,e.clickBeforeStartSelector,e.layoutClickSelector].forEach((e=>{r.ZP.IsValidDataField(e)&&t.push(e)})),t}static GetAndSendOrderTotal(e,t,i){let o=!1,a=!1;i!==v.S.NoCheckoutPageUrl&&i!==v.S.DisabledCheckoutPageData||(o=!0),i!==v.S.NoSelectors&&i!==v.S.PageIsInvalid&&i!==v.S.IsPageValidError||(a=!0);const r=this.getDefaultOrderTotalErrorMessage(i),n=h.Z.getApiResponse(),s=n.retailerData?.domainName;try{const i=n.retailerData.getCurrentCheckoutPage();this.GetOrderTotal(i,e,n.impressionId,s).then((e=>{this.SendValidationLog(t,n.impressionId,n.traceId,o,a,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??r,"error")}}static GetCurrentPathName(){return location.pathname}static SendValidationLog(e,t,i,o,a,r,n,s){const c=S.Z.GetValidationLogMessage(e,o,a);e?n&&-1!==n&&S.Z.SendLogEvent(t,c,"true",n,s,void 0,void 0,r):S.Z.SendLogEvent(t,c,"false",n,s,void 0,void 0,r),n&&-1!==n&&this.SendGMVMessage(n,s??"$",i)}static SendGMVMessage(e,t,i){const o=(0,n.qm)(t)?t:(0,n.Vv)(t)??"USD";S.Z.SendMessage(u.H.CheckoutPageGMV,[i,e.toString(),o])}static async GetOrderTotal(e,t,i,o){let a={OrderTotal:-1,Currency:(0,n.N6)(t)??"$",PageCurrency:""};e&&r.ZP.IsValidDataField(e.orderTotalDataElementSelector)&&(a=await r.ZP.WaitForCondition((async()=>d.Z.HasVisibleElement(e.orderTotalDataElementSelector)),5e3).then((()=>P.Z.GetCartValue(e.orderTotalDataElementSelector,t))).catch((e=>(S.Z.SendLogEvent(i,e?.message??"checkoutpage GMV error.","error"),a))));try{const e=s.Q?.CartValues,t=(0,l.BQ)(e,!0)??{},i=new Date;t[o]={cartValue:a,timestamp:i};const r=JSON.stringify({value:JSON.stringify(t)});S.Z.SendStorageMessage("CartValues",r)}catch(e){}return a}static GetValidatorAutoOpenController(){const e=h.Z.getApiResponse(),t=location.pathname,i=new A;return i.init(e.impressionId,e?.retailerData?.domainName,t,e.traceId),i}static getDefaultOrderTotalErrorMessage(e){switch(e){case v.S.DisabledCheckoutPageData:return"disabled checkoutpage GMV error.";case v.S.NoSelectors:return"no valid initial fields to check";case v.S.NoCoupons:return"no coupons";case v.S.AllCouponsBlocked:return"all coupons were blocked";case v.S.NoCheckoutPageUrl:return"no checkoutpage data GMV error."}return"checkoutpage GMV error."}}},50607:function(e,t,i){i.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 o=i(59645),a=i(5144),r=i(11050),n=i(91495),s=i(75434),c=i(41310),l=i(52056);const u=e=>!!e&&!!e.shouldAutoShow&&e.offersType===r.h.SPB&&!!(e.offer||e.relatedOffers&&0!==e.relatedOffers.length),d=(e,t,i)=>{if(e&&e.relatedOffers){const o=m(t),a=new Set([...i,...o]),r=e.relatedOffers.filter((e=>{if(e.cashbackProducts&&e.cashbackProducts.length>0){const t=e.cashbackProducts[0];if(e.value&&t.price&&t.image&&!a.has(e.id))return!0}return!1}));if(r.length>0)return r[0]}return null},h=(e,t,i,o,a)=>{if(!0===a)return!1;if(!e)return!1;if(!e.shouldAutoShow)return!1;if(e.offersType!==r.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([...o,...m(t)]),c=new Set(i);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,i,r=!1)=>{const n=new o.Z(a.xu.ICSpbOffersNoShowHomePage);n.Metadata=JSON.stringify({userInfo:e,isError:r,pageTitle:document?.title,reason:i}),l.Z.SendLogEvent(t,"SPB notification not shown on home page","",void 0,void 0,a.R.EdgeFlyoutStatus,n)},g=(e,t,i,n,s=!1)=>{const c=e?.offersType===r.h.SPB,u=new o.Z(c?a.xu.ICSPBPdpOffersNoShow:a.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===r.h.Quotient,isError:s,pageTitle:document?.title}),l.Z.SendLogEvent(i,d,"",void 0,void 0,a.R.EdgeFlyoutStatus,u)},C=(e,t,i)=>{const o={isExactMatch:!!e.offer,relatedOffersLength:e.relatedOffers?.length||0,isPdpSpb:!0,pageTitle:document?.title};c.Z.LogSPBTelemetry(a.xu.ICQtPdpOffersShow,"Qt pdp shown",e,t,i,o)},S=(e,t,i)=>{const o={isExactMatch:!!e.offer,relatedOffersLength:e.relatedOffers?.length||0,isPdpSpb:!0,pageTitle:document?.title};c.Z.LogSPBTelemetry(a.xu.ICSPBPdpOffersShow,"Spb pdp shown",e,t,i,o)},m=e=>{try{const t=n.Q?.GroceryCashbackActivated,i=((0,s.rm)(t)??{})[e]??void 0;return i?.fullItems?Object.keys(i.fullItems):[]}catch(e){return[]}}},92800:function(e,t,i){i.d(t,{W:function(){return l},a:function(){return u}});var o=i(72370),a=i(29247),r=i(1094),n=i(54869);class s{constructor(e){(0,o.Z)(this,"autoApplyCallback",void 0),(0,o.Z)(this,"cashbackOmniboxCallback",void 0);const t=n.Z.GetValidatorModule(),i=r.Z.GetInitialFieldsByCurrentCheckoutPageData(e?.retailerData?.getCurrentCheckoutPage());i&&!e.retailerData?.isCheckoutPageSelectorsPresent&&e.retailerData?.multiMsgValidationEnabled&&(0,a.IM)((()=>t.IsPageValid(i)),(()=>{e?.retailerData?.setIsCheckoutPageSelectorsPresent(!0),this.handleMultiPageCheckoutPageValidate()}))}setAutoApplyCallback(e){this.autoApplyCallback=e}setCashbackOmniboxCallback(e){this.cashbackOmniboxCallback=e}handleMultiPageCheckoutPageValidate(){this.autoApplyCallback&&this.autoApplyCallback(),this.cashbackOmniboxCallback&&this.cashbackOmniboxCallback()}}let c;function l(e){return c||(c=new s(e)),c}function u(){c=void 0}},44922:function(e,t,i){i.d(t,{S:function(){return a}});var o=i(72370);let a=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.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,o.Z)(this,"domain",void 0),(0,o.Z)(this,"validationReason",void 0),(0,o.Z)(this,"time",void 0),(0,o.Z)(this,"initializeTime",void 0),(0,o.Z)(this,"preValidationTime",void 0),(0,o.Z)(this,"path",void 0),(0,o.Z)(this,"pageStatus",void 0),(0,o.Z)(this,"scriptRunNum",void 0),(0,o.Z)(this,"validationMsgNum",void 0)}}},34802:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"domain",void 0),(0,o.Z)(this,"pageType",void 0),(0,o.Z)(this,"pageUrl",void 0),(0,o.Z)(this,"orderId",void 0),(0,o.Z)(this,"orderIdFromUrl",void 0),(0,o.Z)(this,"orderTotal",void 0),(0,o.Z)(this,"orderSubtotal",void 0),(0,o.Z)(this,"productName",void 0),(0,o.Z)(this,"productItemPrice",void 0),(0,o.Z)(this,"productTotalPrice",void 0),(0,o.Z)(this,"productQuantity",void 0),(0,o.Z)(this,"productId",void 0),(0,o.Z)(this,"currency",void 0),(0,o.Z)(this,"productPrice",void 0),(0,o.Z)(this,"productNameFromImg",void 0),(0,o.Z)(this,"randomId",void 0),(0,o.Z)(this,"pageUrlFields",void 0)}static Create(e){const t=new a;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=a},50978:function(e,t,i){i.d(t,{JR:function(){return r},Vj:function(){return a}});var o=i(72370);const a="PersonalizedPromotionsRawData";class r{constructor(){(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"PageType",void 0),(0,o.Z)(this,"PageUrl",void 0),(0,o.Z)(this,"OrderId",void 0),(0,o.Z)(this,"OrderIdFromUrl",void 0),(0,o.Z)(this,"OrderTotal",void 0),(0,o.Z)(this,"OrderSubtotal",void 0),(0,o.Z)(this,"ProductName",void 0),(0,o.Z)(this,"ProductItemPrice",void 0),(0,o.Z)(this,"ProductTotalPrice",void 0),(0,o.Z)(this,"ProductPrice",void 0),(0,o.Z)(this,"ProductNameFromImg",void 0),(0,o.Z)(this,"RandomId",void 0),(0,o.Z)(this,"ProductQuantity",void 0),(0,o.Z)(this,"ProductId",void 0),(0,o.Z)(this,"Currency",void 0),(0,o.Z)(this,"ExtractionId",void 0),(0,o.Z)(this,"CartDataCreationTime",void 0)}}},14440:function(e,t,i){var o=i(72370);class a{static Create(e){const t=new a;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,o.Z)(this,"productTitle",void 0),(0,o.Z)(this,"productPrice",void 0),(0,o.Z)(this,"productUrl",void 0),(0,o.Z)(this,"productImg",void 0),(0,o.Z)(this,"productQuantity",void 0),(0,o.Z)(this,"productSeller",void 0),(0,o.Z)(this,"foundInWebAssist",void 0),(0,o.Z)(this,"webAssistTitle",void 0),(0,o.Z)(this,"webAssistPrice",void 0),(0,o.Z)(this,"webAssistImg",void 0),(0,o.Z)(this,"buyNowItem",void 0),(0,o.Z)(this,"productBrand",void 0),this.foundInWebAssist=!1}}t.Z=a},90650:function(e,t,i){i.d(t,{lD:function(){return o},si:function(){return a}});const o=["confirmation number","confirmation email","thank you for your order","order placed","order was placed","track your order"],a=["cvv"];t.ZP=class{static PageIncludesPaymentKeyWords(e,t){if(e)for(const i of t)if(e.includes(i))return!0;return!1}}},87869:function(e,t,i){i.d(t,{L:function(){return r},c:function(){return a}});var o=i(72370);let a=function(e){return e.finalCheckoutButtonVisible="finalCheckoutButtonVisible",e.successfulPaymentKeywordsFound="successfulPaymentKeywordsFound",e.failurePaymentKeywordsFound="failurePaymentKeywordsFound",e.inputFieldsFound="inputFieldsFound",e}({});class r{constructor(){(0,o.Z)(this,"purchaseFailed",void 0),(0,o.Z)(this,"indicators",void 0)}}},46557:function(e,t,i){i.d(t,{Z:function(){return S}});var o=i(72370);class a{constructor(){(0,o.Z)(this,"hasLink",void 0),(0,o.Z)(this,"couponCodeElement",void 0),(0,o.Z)(this,"couponCodeHash",void 0),(0,o.Z)(this,"retailerElement",void 0),(0,o.Z)(this,"retailerHash",void 0),(0,o.Z)(this,"channelId",void 0),(0,o.Z)(this,"username",void 0)}static Create(e){const t=new a;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 r=a,n=i(29247),s=i(56577),c=i(29853),l=i(1094);class u{constructor(){(0,o.Z)(this,"productPageUrl",void 0),(0,o.Z)(this,"addToCartButtonSelector",void 0),(0,o.Z)(this,"backgroundAAEnabled",void 0),(0,o.Z)(this,"productAddedConfirmationSelector",void 0),(0,o.Z)(this,"addToCartButtonContainer",void 0),(0,o.Z)(this,"suggestedCouponElementSelector",void 0),(0,o.Z)(this,"suggestedCouponRegex",void 0)}static Create(e){const t=new u;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 d=u,h=i(54869),p=i(5144),g=i(92800);class C{constructor(){(0,o.Z)(this,"checkoutPageRegex",void 0),(0,o.Z)(this,"platform",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"orderConfirmationPageUrl",void 0),(0,o.Z)(this,"searchQueryUrlRegex",void 0),(0,o.Z)(this,"allCheckoutPages",void 0),(0,o.Z)(this,"isTravelDomain",void 0),(0,o.Z)(this,"allFinalCheckoutPages",void 0),(0,o.Z)(this,"checkoutPageKey",void 0),(0,o.Z)(this,"isCheckoutPageSelectorsPresent",void 0),(0,o.Z)(this,"finalCheckoutPageKey",void 0),(0,o.Z)(this,"productPageKey",void 0),(0,o.Z)(this,"exclusiveMarket",void 0),(0,o.Z)(this,"multiMsgValidationEnabled",void 0),(0,o.Z)(this,"youtubeTemplates",void 0),(0,o.Z)(this,"allProductPages",void 0),(0,o.Z)(this,"exactCheckoutPageUrl",void 0),(0,o.Z)(this,"productOutOfStockSelector",void 0),(0,o.Z)(this,"productNameSelector",void 0),(0,o.Z)(this,"productPriceSelector",void 0),(0,o.Z)(this,"productPageUrl",void 0),(0,o.Z)(this,"productImageSelector",void 0),(0,o.Z)(this,"aaConsentEnabled",void 0),(0,o.Z)(this,"isStorewideCashbackEstimationEnabled",void 0),(0,o.Z)(this,"storeCartInEdgeStorage",void 0),(0,o.Z)(this,"cartMonitorUrl",void 0),(0,o.Z)(this,"travelCheckoutPageKey",void 0),(0,o.Z)(this,"checkoutPageUrl",void 0),(0,o.Z)(this,"confirmationPageTelemetry",void 0),(0,o.Z)(this,"isAOCFragmentCollectionEnabled",void 0),(0,o.Z)(this,"aOCFragmentCollectionRate",void 0),(0,o.Z)(this,"addressBarExpansionEnabled",void 0),(0,o.Z)(this,"retailerTrivia",void 0),(0,o.Z)(this,"disabledPopupOriginationList",void 0),(0,o.Z)(this,"allAutomatedSelectors",void 0),(0,o.Z)(this,"automatedSelectorsKey",void 0),(0,o.Z)(this,"isAddressBarCashbackEnabled",void 0),(0,o.Z)(this,"isCompositeNotificationPhCExcludedRetailer",void 0),(0,o.Z)(this,"isCompositeNotificationPhCTopRetailer",void 0),(0,o.Z)(this,"productPageUrlRegex",void 0),(0,o.Z)(this,"settings",void 0),(0,o.Z)(this,"edgeFeatureFlag",void 0),(0,o.Z)(this,"isEligibleForRewards",void 0)}static Create(e){const t=new C;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.checkoutPageRegex=e.checkoutPageRegex),t}updateCurrentCheckoutPage(e){return this.checkoutPageKey=this.findCurrentPage(e,this.allCheckoutPages),this.isCheckoutPageSelectorsPresent=null,(0,g.a)(),-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 i=this.allAutomatedSelectors[t];if(new RegExp(i.urlRegex).test(e))return this.automatedSelectorsKey=t,i}this.automatedSelectorsKey=-1}isConfirmationPage(e){return new RegExp(this.orderConfirmationPageUrl).test(e)}async getIsCheckoutPageSelectorsPresent(){return null==this.isCheckoutPageSelectorsPresent&&await this.updateIsCheckoutPageSelectorsPresent(),this.isCheckoutPageSelectorsPresent??!1}setIsCheckoutPageSelectorsPresent(e){this.isCheckoutPageSelectorsPresent=e}async updateIsCheckoutPageSelectorsPresent(){if(-1===this.checkoutPageKey)return void(this.isCheckoutPageSelectorsPresent=!1);const e=l.Z.GetInitialFieldsByCurrentCheckoutPageData(this.getCurrentCheckoutPage());if(0===e.length)return void(this.isCheckoutPageSelectorsPresent=!1);const t=h.Z.GetValidatorModule();this.isCheckoutPageSelectorsPresent=await(0,n.w)((()=>t.IsPageValid(e)),5e3).then((async e=>Promise.resolve(e))).catch((e=>Promise.reject(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(d.Create(t))}createYoutubeTemplateList(e){if(this.youtubeTemplates=[],e.youtubeTemplates&&e.youtubeTemplates.length>0)for(const t of e.youtubeTemplates)this.youtubeTemplates.push(r.Create(t))}findCurrentPage(e,t){for(let i=0;t&&i<t.length;i++)if(n.ZP.IsPageMatch(t[i].checkoutPageUrl,t[i].pageUrlRegex,e))return t[i].disabled?-1:i;return-1}findCurrentProductPage(e,t){for(let i=0;i<t.length;i++)if(n.ZP.IsOnPage(t[i].productPageUrl,e))return i;return-1}findCurrentAutomatedSelectorsPage(e,t){for(let i=0;i<t.length;i++)if(n.ZP.IsPageRegexMatch(t[i].urlRegex,e))return i;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??p.GV.UnknownPage;return e!==p.GV.UnknownPage?e:this.isProductPage(location.href)?p.GV.ProductPage:p.GV.UnknownPage}}var S=C},55648:function(e,t,i){i.d(t,{Z:function(){return f}});var o=i(72370),a=i(56005),r=i(93078),n=i(93190),s=i(73557),c=i(91495),l=i(44092),u=i(91897),d=i(44922),h=i(52056),p=i(54869),g=i(86743),C=i(12714),S=i(82315),m=i(56854);class A extends C.Z{constructor(...e){super(...e),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"aaConsentEnabled",void 0),(0,o.Z)(this,"aaConsentData",void 0),(0,o.Z)(this,"validatorModule",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.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=S.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,t){if(!this.aaConsentEnabled)return!1;const i=this.apiResponse.retailerData.allProductPages;if((0,m.r)())for(let e=0;e<i.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}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=a.Z.GetAAConsentStorageKey(this.localDataService.GetDomainName());h.Z.SendStorageMessage(t,JSON.stringify({value:JSON.stringify(this.aaConsentData)}));const i=new class{constructor(){(0,o.Z)(this,"BgaaResultAvailable",void 0)}};i.BgaaResultAvailable=e,h.Z.StartEdgeDriver("",JSON.stringify({action:r.v.PDPconsentAA,data:i}))}getAAConsentStr(e,t){const i=a.Z.GetAAConsentStorageKey(t);return"string"==typeof e[i]?e[i]:e[i]?.value??""}getAAConsentData(e){try{if(!e)return;return JSON.parse(e)}catch(e){return}}}var f=A},59518:function(e,t,i){var o=i(72370),a=i(5144),r=i(55648),n=i(82315),s=i(29247),c=i(44922),l=i(1094),u=i(31714),d=i(59645),h=i(73557),p=i(4872),g=i(12714),C=i(90066),S=i(55590),m=i(20546),A=i(52056),f=i(54869),v=i(9839),E=i(31656),P=i(86743),I=i(3634),T=i(91495),O=i(65559),y=i(56854),D=i(57459),b=i(92800);class N extends g.Z{constructor(...e){super(...e),(0,o.Z)(this,"checkoutPageUrlData",void 0),(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"isPageValid",void 0),(0,o.Z)(this,"aaValidationReason",void 0),(0,o.Z)(this,"canOpen",void 0),(0,o.Z)(this,"autoOpenReasons",void 0),(0,o.Z)(this,"totalPrice",void 0),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"validator",void 0),(0,o.Z)(this,"aocValidatorUtilities",void 0),(0,o.Z)(this,"bgaaService",void 0)}GetPopupOriginationList(){return[h.sR.AUTO_SHOW_COUPONS_CHECKOUT]}async CanAutoOpenForFeature(e,t){if(this.classifiedAsNonCheckoutPage())return Promise.resolve(!1);E.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 i=this.localDataService.IsExpressCheckoutPage(),o={auto_apply_status:this.isPageValid,express_checkout_status:i,open_micro_notifcation:!1,page_validations:[],page_validations_auto_open:[],auto_open_reasons:[]};if(E.R.isExperimentActive(p.H.cashbackActivationOmnibar)){if(this.aaValidationReason===c.S.PageIsInvalid&&(0,b.W)(this.apiResponse).setAutoApplyCallback((()=>{this.validator.SendValidationMessage(!0,c.S.PageBecameValid,this.domainName,void 0,!(0,P.XB)(),!1,o);const e=new CustomEvent(I.T2,{detail:{popupOrigination:h.sR.AUTO_SHOW_COUPONS_CHECKOUT}});window.dispatchEvent(e)})),!this.isPageValid)return this.validator.SendValidationMessage(this.isPageValid,this.aaValidationReason,this.domainName,void 0,!1,!1,o),Promise.resolve(!1)}else 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,P.XB)(),!1,o);const e=new CustomEvent(I.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 n=null;const u=A.Z.ParseBackgroundAutoApplyStateData(T.Q.rawStorageObj);u&&this.checkoutPageUrlData&&(n=await this.bgaaService.TryValidateBackgroundAutoApplyState(u,this.localDataService.GetMarket(),this.checkoutPageUrlData)),this.SetTotalPrice(),this.canOpen=await this.shouldAutoOpenForAA(o);const g=this.canOpen;let C=g;const f=T.Q.BGAAApplyButtonClicked,v=E.R.isExperimentActive(p.H.suppressAAAutoApplyThreshold),D=(0,y.r)();let N;if(D&&this.canOpen&&(n===a.ps.Positive&&f==="true_"+this.domainName||n===a.ps.Negative)&&(this.canOpen=!1,this.autoOpenReasons.push("BGAA is active"),C=!1,A.Z.SendStringStorageMessage(S.Q.BGAAApplyButtonClicked,"false_"+this.domainName)),v)try{const e=E.R.getServiceExperimentValue(p.H.suppressAAAutoApplyThreshold),t=E.R.getServiceExperimentValue(p.H.suppressAADomainSuccessThreshold);if(t&&e){const i=parseInt(t,10),o=parseInt(e,10),r=T.Q.UnsuccessfulAutoApplyCount;r&&o>0&&i>0&&this.canOpen&&r>=o&&(this.canOpen=this.HasHighConfidenceCouponsDomainLevel(i),this.canOpen||this.autoOpenReasons.push("Unsuccessful AA count is above threshold"));const n=new d.Z(a.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;N=c,n.Domain=this.domainName,n.Metadata=JSON.stringify({unsuccessfulAACount:r,aaFailureThreshold:o,domainThreshold:i,currentDomainSuccesRate:s,canOpen:c,autoOpenReasons:this.autoOpenReasons}),A.Z.SendLogEvent(this.apiResponse.impressionId,"Suppress auto apply experiement result telemetry","",void 0,void 0,a.R.EdgeFlyoutStatus,n,this.domainName)}}catch(e){A.Z.SendLogEvent(this.apiResponse.impressionId,"Suppress auto apply experiment error:"+e?.message,"error",void 0,void 0,a.R.AutoApply)}const R=new r.Z;R.Init();const _=new m.Z;_.Init();const k=new O.Z;if(k.Init(),o.auto_open_reasons.push(...this.autoOpenReasons),R.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,R.AutoTriggerAutoApply(null!=n)):_.isAutoApplyingBestCouponAllowed()?((0,P.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,P.XB)()&&this.canOpen,!1,o),_.AutoApplyBestCoupon()):k.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),k.AutoApplyExclusiveCoupon()):((0,P.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,P.XB)()&&this.canOpen,!1,o)),D){const e=this.canOpen,t=new d.Z(a.xu.SuppressAutoApply);t.Domain=this.domainName,t.Metadata=JSON.stringify({bgaaApplyButtonClicked:f,bgaaResult:n,canOpenInitial:g,canOpenWithBGAA:C,canOpenFinal:e,isSuppressAAActive:v,canOpenWithIsSuppressAAActive:N}),A.Z.SendLogEvent(this.apiResponse.impressionId,"BGAA checkout page - canOpen status for AUTO_SHOW_COUPONS_CHECKOUT","",void 0,void 0,a.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=f.Z.GetLocalDataService(),this.validator=f.Z.GetValidatorModule(),this.aocValidatorUtilities=l.Z.GetValidatorAutoOpenController(),this.bgaaService=f.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??a.GV.CheckoutPage)!==a.GV.CheckoutPage}GetTotalPrice(){return this.checkoutPageUrlData&&!this.checkoutPageUrlData.supportedNoOrderTotal?A.Z.GetOrderTotalString(this.checkoutPageUrlData.orderTotalDataElementSelector):""}SetTotalPrice(){this.aocValidatorUtilities&&!this.checkoutPageUrlData?.supportedNoOrderTotal&&(A.Z.SendStorageMessage("price"+this.domainName,JSON.stringify({value:this.totalPrice})),(0,P.XB)()?v.Q.setTotalPrice(this.totalPrice):this.aocValidatorUtilities.setTotalPrice(this.totalPrice))}async HasEligibleCoupons(){try{const e=f.Z.GetSuggestedCouponService().GetSuggestedCoupons(),t=await f.Z.GetCartExtractionService().WaitForCartExtractionAndBlockedCouponsThenGetCartData(),i=t?.BlockedCouponsData?.BlockedCoupons??[];return 0===i.length||D.Z.FilterUnblockedCoupons(this.apiResponse.coupons,e,i).length>0}catch(e){return!0}}async IsAAValid(){if(!this.checkoutPageUrlData)return c.S.IsPageValidError;if(!this.IsAutoApplyEnabled())return c.S.DisabledCheckoutPageData;const e=l.Z.GetInitialFields(this.apiResponse);if(0===e.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}if(E.R.isExperimentActive(p.H.onlyShowAANotificationWithEligibleCoupons)||E.R.isExperimentActive(p.H.delayForAAEligibleCouponsCheck))try{const t=this.HasEligibleCoupons();let i;i=E.R.isExperimentActive(p.H.cashbackActivationOmnibar)?this.apiResponse.retailerData.getIsCheckoutPageSelectorsPresent():s.ZP.WaitForCondition((async()=>this.validator.IsPageValid(e)),5e3);const o=await t;return E.R.isExperimentActive(p.H.onlyShowAANotificationWithEligibleCoupons)&&!o?c.S.AllCouponsBlocked:await i?(this.PrefetchAutoApplyResources(),c.S.PageIsValid):c.S.PageIsInvalid}catch(e){return this.validator.sendErrorMessage(this.apiResponse.impressionId,e?.message??"checkoutpage error."),c.S.IsPageValidError}if(E.R.isExperimentActive(p.H.cashbackActivationOmnibar))try{return await this.apiResponse.retailerData.getIsCheckoutPageSelectorsPresent()?(this.PrefetchAutoApplyResources(),c.S.PageIsValid):c.S.PageIsInvalid}catch(e){return this.validator.sendErrorMessage(this.apiResponse.impressionId,e?.message??"checkoutpage error."),c.S.IsPageValidError}return await s.ZP.WaitForCondition((async()=>this.validator.IsPageValid(e)),5e3).then((async e=>e?(this.PrefetchAutoApplyResources(),c.S.PageIsValid):c.S.PageIsInvalid)).catch((e=>(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 i=document.createElement("LINK");i.setAttribute("rel","prefetch"),i.href=e?t+"Shopping_Progress_Dark_01.mp4":t+"Shopping_Progress_01.mp4",i.setAttribute("as","fetch");const o=document.createElement("LINK");o.setAttribute("rel","prefetch"),o.href=e?t+"Shopping_Success_Dark_01.mp4":t+"Shopping_Success_01.mp4",o.setAttribute("as","fetch");const a=document.createElement("LINK");a.setAttribute("rel","prefetch"),a.href=e?t+"Shopping_Finished_Dark_01.mp4":t+"Shopping_Finished_01.mp4",a.setAttribute("as","fetch"),document.body.appendChild(i),document.body.appendChild(o),document.body.appendChild(a)}}IsAutoApplyEnabled(){return!0===this.checkoutPageUrlData?.edgeEnabled}setAttributeForInputBox(){const e=this.checkoutPageUrlData?.isAutoShowDisabled;if(void 0!==this.checkoutPageUrlData&&this.checkoutPageUrlData.inputBoxSelector&&!e){const e=C.Z.GetFirstVisibleElement(this.checkoutPageUrlData.inputBoxSelector);e?.setAttribute("edge-shopping-apply-coupon-input-box-tag","")}}async shouldAutoOpenForAA(e){const t=e.auto_apply_status;let i=!0;if(!(0,P.XB)()){const e={Reason:""};i=this.aocValidatorUtilities.isPopupOriginationUnblocked(h.sR.AUTO_SHOW_COUPONS_CHECKOUT,e),e.Reason&&this.autoOpenReasons.push(e.Reason)}const o=E.R.isExperimentActive(p.H.CouponsPersonalization),r=this.validator.GetRuleBasedTriggerController();if(i&&o&&r&&this.apiResponse?.coupons&&this.apiResponse.coupons.length>0&&!(0,P.XB)())if(i=r.canAutoOpen(),i)e.personalizationAutoOpenTelemetryData=r.getPersonalizationAutoOpenTelemetryData();else{this.autoOpenReasons.push("RuleBased Trigger Controller decides to not auto open the flyout");const e=new d.Z(a.xu.PersonalizedAutoTriggerOff);e.Metadata=JSON.stringify({personalizationAutoOpenTelemetryData:r.getPersonalizationAutoOpenTelemetryData(),popupOriginationEnum:h.sR.AUTO_SHOW_COUPONS_CHECKOUT}),A.Z.SendLogEvent(this.apiResponse.impressionId,"RuleBased Trigger Controller decides to not auto open the flyout",t?"true":"false",void 0,void 0,a.R.EdgeFlyoutStatus,e)}const n=E.R.getMultipleVariants(p.H.couponsConfidence),s=E.R.getVariantValue(n,u.qG.CouponLevelThreshold,-1),c=E.R.getVariantValue(n,u.qG.DomainLevelThreshold,-1);if(i&&s>=0){const e=this.HasHighConfidenceCouponsCouponsLevel(s);i=i&&e,i||this.autoOpenReasons.push("No high confidence coupons available above threshold at coupons level")}if(i&&c>=0){const e=this.HasHighConfidenceCouponsDomainLevel(c);i=i&&e,i||this.autoOpenReasons.push("No high confidence coupons available above threshold at domain level")}return i}HasHighConfidenceCouponsCouponsLevel(e){let t=!1,i=!1;if(this.apiResponse?.coupons?.length)for(const o of this.apiResponse.coupons){const a=void 0===o.successRate?0:o.successRate;if(i||void 0===a||0===a||(i=!0),a>=e){t=!0;break}}return!i||t}HasHighConfidenceCouponsDomainLevel(e){let t=!0;return this.apiResponse?.retailerData?.retailerTrivia?.successRate&&(t=this.apiResponse?.retailerData?.retailerTrivia?.successRate>=e),t}}t.Z=N},86161:function(e,t,i){i.d(t,{m:function(){return o}});const o={extractedData:{},localData:{},apiData:{}}},12714:function(e,t,i){i.d(t,{Z:function(){return o}});class o{async Init(){}async UpdateAutoOpenData(e,t){}async TryLateAutoOpenForFeature(e,t){}async PostTriggerDecision(e,t){}async PostValidation(){}GetAutoOpenParams(){}GetNotificationHost(){}}},98574:function(e,t,i){var o=i(72370),a=i(5144),r=i(73557),n=i(91495),s=i(82315),c=i(1094),l=i(52056),u=i(11849),d=i(54869),h=i(86743),p=i(12714),g=i(31024),C=i(55648),S=i(44922),m=i(27689),A=i(33491),f=i(3634),v=i(56854);class E extends p.Z{constructor(...e){super(...e),(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"canOpen",void 0),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"validator",void 0),(0,o.Z)(this,"aocValidatorUtilities",void 0),(0,o.Z)(this,"BestCouponConsentData",void 0),(0,o.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,m.BQ)(n.Q.ProductBestCouponConsent),this.checkoutPageUrlData=this.apiResponse.retailerData.getCurrentCheckoutPage(),Promise.resolve()}GetPopupOriginationList(){return[r.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY]}GetAutoOpenParams(){return JSON.stringify({bestCouponConsentData:this.BestCouponConsentData})}async CanAutoOpenForFeature(e,t){const i=(0,A.WN)("isBgaaComplete");if(this.isCheckoutPage()||!1===i)return Promise.resolve(!1);const o=l.Z.ParseBackgroundAutoApplyStateData(n.Q.rawStorageObj),s=o?.BackgroundAAStatus.domainName===this.domainName;let c=null;if(o&&s&&i&&(c=await this.TryValidateBackgroundAutoApplyState(o,this.localDataService.GetMarket())),this.canOpen=await this.shouldAutoOpenForBGAA(),this.canOpen&&c&&c===a.ps.Positive){const e=new CustomEvent(f.T2,{detail:{popupOrigination:r.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY}});window.dispatchEvent(e)}else this.canOpen=!1;return(new C.Z).Init(),this.canOpen&&i&&this.validator.SendValidationMessage(!0,S.S.PageIsValid,this.domainName,void 0,!(0,h.XB)()&&this.canOpen,!1,void 0),(0,A.Ev)("isBgaaComplete",!1),Promise.resolve(this.canOpen)}async TryValidateBackgroundAutoApplyState(e,t,i){try{return await this.ValidateBackgroundAutoApplyState(e,t,i)}catch(e){}return null}async ValidateBackgroundAutoApplyState(e,t,i){const o=g.Z.GetBackgroundAAKeyName();if(Date.now()-e.StartTime>864e5)return this.validator.DeleteKeyFromPersistentStorage(o),g.Z.SendBackgroundAAStateValidationMessage(""),null;const a=g.Z.CanCurrentDomainDeleteBgaaState(e.BackgroundAAStatus.domainName);if(!a&&e.BackgroundAAStatus.expiredState)return g.Z.SendBackgroundAAStateValidationMessage(""),null;const r=e.BackgroundAAStatus.result,n=g.Z.CanCurrentPageDeleteBgaaState(e.BackgroundAAStatus.pageUrl);if(!n&&e.BackgroundAAStatus.expiredState)return g.Z.SendBackgroundAAStateValidationMessage(""),null;if(n&&i){const a=await u.Z.WaitAndGetCartValue(i.orderTotalDataElementSelector,t),s=await u.Z.WaitAndGetCartValue(i.orderSubTotalElementSelector,t,1e3);return g.Z.ValidateBgAAState(e,a.OrderTotal,s.OrderTotal)?this.GetBgaaResult(e,r):(n?this.validator.DeleteKeyFromPersistentStorage(o):(e.BackgroundAAStatus.expiredState=!0,this.validator.SendStorageMessage(o,JSON.stringify({value:e.ToString()}))),g.Z.SendBackgroundAAStateValidationMessage(""),null)}return a?this.GetBgaaResult(e,r):null}GetBgaaResult(e,t){const i=Math.round(100*e.MaxDiscount)/100;(t===a.ps.InProgress||t===a.ps.Cancelled)&&i>0&&(t=a.ps.Positive);const o={BestCoupon:e.BestCoupon?.couponCode,Result:t,Savings:i,SuccessfulCoupons:e.CouponResults.filter((e=>e.Discount>0)).map((e=>e.Code))};return g.Z.SendBackgroundAAStateValidationMessage(JSON.stringify(o)),t}isCheckoutPage(){return!!this.checkoutPageUrlData&&this.checkoutPageUrlData.pageType!==a.GV.ProductPage&&!(!this.checkoutPageUrlData.checkoutPageUrl||"/"===this.checkoutPageUrlData.checkoutPageUrl)}async shouldAutoOpenForBGAA(){if(!(0,v.r)())return!1;let e=!0;return(0,h.XB)()||(e=this.aocValidatorUtilities.isPopupOriginationUnblocked(r.sR.AUTO_SHOW_COUPONS_BACKGROUND_AUTO_APPLY)),e}}t.Z=E},74113:function(e,t,i){i.d(t,{Z:function(){return _}});var o=i(72370),a=i(59645),r=i(58474);class n extends r.Z{constructor(e,t,i,a,r){super(),(0,o.Z)(this,"Discount",void 0),(0,o.Z)(this,"StartingPrice",void 0),(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"ProductUrl",void 0),(0,o.Z)(this,"DiscountString",void 0),this.StartingPrice=t??0,this.Discount=i??0,this.ProductUrl=e,this.DiscountString=a,this.Domain=r}}var s=n,c=i(5144),l=i(5491),u=i(93190),d=i(73557),h=i(55590),p=i(29247),g=i(50616),C=i(36493),S=i(91495),m=i(27689),A=i(9448),f=i(90066),v=i(41290),E=i(44922),P=i(52056),I=i(54869),T=i(93970),O=i(12714),y=i(1094),D=i(86743),b=i(31656),N=i(4872);class R extends O.Z{constructor(...e){super(...e),(0,o.Z)(this,"checkoutPageUrlData",void 0),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"impressionId",void 0),(0,o.Z)(this,"traceId",void 0),(0,o.Z)(this,"validator",void 0),(0,o.Z)(this,"aocValidatorUtilities",void 0),(0,o.Z)(this,"rakutenJP","rakuten.co.jp"),(0,o.Z)(this,"isClippingExpansion",b.R.isExperimentActive(N.H.couponClippingExpansion))}GetPopupOriginationList(){return[d.sR.AUTO_SHOW_COUPONS_CLIPPING]}async CanAutoOpenForFeature(e,t){if(!1===this.isClippingExpansion&&g.Z.expansionDomainsList.includes(this.domainName))return Promise.resolve(!1);const i=await this.waitForIsClippingScenario(this.checkoutPageUrlData);if(b.R.getServiceExperimentValue(N.H.clipCloseSnooze)&&!(0,D.XB)()&&!this.aocValidatorUtilities.isPopupOriginationUnblocked(d.sR.AUTO_SHOW_COUPONS_CLIPPING))return Promise.resolve(!1);if(this.checkoutPageUrlData?.clippingSelectors){const e=new a.Z(c.xu.CouponClippingSelectorsAvailable);e.Metadata=JSON.stringify({Domain:this.domainName,isClippingValid:i,Url:location.pathname}),P.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(!i||!this.checkoutPageUrlData?.clippingSelectors)return Promise.resolve(!1);const o=this.getAutoClipData();if(!o?.includes(this.domainName))return i&&(this.validator.SendValidationMessage(!1,E.S.Clipping,this.domainName,[u.p.COUPONS_CLIPPING]),this.localDataService.SetIsClippingSent(!0)),Promise.resolve(i);const r=new v.Z(new class{SendLogMessage(e,t,i,o,a){P.Z.SendLogEventMessage(o,t,a,i,e)}SaveSavingsTransactionToEdge(e){P.Z.SendStorageMessage(c.Sl.CouponClippingTransactionsKey,JSON.stringify({value:JSON.stringify(e)}))}SendEdgeAANegativeResult(){}SendEdgeAAPositiveResult(e,t,i){}SendEdgeAAErrorMessage(e){}},c.KE.AutoCouponClipping);return await r.TryClipCoupons(this.checkoutPageUrlData.clippingSelectors,this.domainName,new l.V,this.impressionId)&&(P.Z.SendMessage(A.H.RecordShoppingUserEngagement,[T.OE.CouponClipping]),P.Z.SendMessage(A.H.RecordShoppingUserAction,[T.J6.CouponClipping])),Promise.resolve(!1)}Init(){return this.localDataService=I.Z.GetLocalDataService(),this.domainName=this.localDataService.GetDomainName(),this.checkoutPageUrlData=this.localDataService.GetCheckoutPageData().retailerData.getCurrentCheckoutPage(location.pathname),this.validator=I.Z.GetValidatorModule(),this.aocValidatorUtilities=y.Z.GetValidatorAutoOpenController(),this.impressionId=this.localDataService.GetImpressionId(),this.checkoutPageUrlData,Promise.resolve()}async waitForIsClippingScenario(e){const t=e?.clippingSelectors;if(!t?.discountSelector||!t?.signedInSelector)return!1;const i=t.waitForPageLoad;i&&await p.ZP.Sleep(i);const o=await this.isClippingPage(t),a=await this.isClippingScenario(t,o),r=await this.logIfClippingExist(t,o);return a&&r}getAutoClipData(){if(S.Q?.AutoClipData){let e=new class{constructor(){(0,o.Z)(this,"enabledDomains",void 0)}};try{e=(0,m.BQ)(S.Q.AutoClipData)}catch{P.Z.DeleteKeyFromPersistentStorage(h.Q.AutoClipData)}return e.enabledDomains}}isClippingScenario(e,t){let i;const o=f.Z.HasVisibleElement(e.signedInSelector);if(this.domainName===this.rakutenJP){let a=f.Z.HasVisibleElement(e.clipCouponSelector);if(!a){const t=f.Z.GetFirstVisibleElement(e.clickBeforeClipSelector);t?.click(),a=f.Z.HasVisibleElement(e.clipCouponSelector)}i=t&&(o||!!e.isSignInOptional)&&a}else{const a=f.Z.HasVisibleElement(e.alreadyClippedSelector);i=t&&(o||!!e.isSignInOptional)&&!a}if(i){const t=new a.Z(c.xu.CouponClippingElements);t.Metadata=JSON.stringify({signedInSelector:e.signedInSelector,alreadyClippedSelector:e.alreadyClippedSelector,isSignInOptional:e.isSignInOptional,Url:location.pathname}),P.Z.SendLogEventMessage(t,c.R.EdgeFlyoutStatus,this.impressionId,"isClippingScenario",c.in.Information)}return i}logIfClippingExist(e,t){if(!t)return!1;try{const t=f.Z.GetFirstVisibleElement(e.orderTotalDataElementSelector),i=t?.innerText??"";let o,a;if(i.includes("-")){const e=i.split("-");o=g.Z.getInitialPrice(e[0]),a=g.Z.getInitialPrice(e[1])}else o=g.Z.getInitialPrice(i);const r=this.getDiscount(o,a,e);if(void 0===r||0===r.discount)return!1;const n=new s(location.pathname,o,r?.discount,r?.discountString,(0,m.S8)());P.Z.SendLogEventMessage(n,c.R.ClippingExist,this.impressionId,"There is clipping",c.in.Information)}catch(e){P.Z.SendLogEvent(this.impressionId,"Error while logging clipping data : "+e?.message,"error",void 0,void 0,void 0),P.Z.SendMessage(A.H.CheckoutPageValidationError,["error",this.traceId])}return!0}isClippingPage(e){const t=f.Z.HasVisibleElement(e.clickBeforeClipSelector),i=f.Z.HasVisibleElement(e.clipCouponSelector);if(t||i){const t=new a.Z(c.xu.CouponClippingElements);t.Metadata=JSON.stringify({clickBeforeClipSelector:e.clickBeforeClipSelector,clipCouponSelector:e.clipCouponSelector,Url:location.pathname}),P.Z.SendLogEventMessage(t,c.R.EdgeFlyoutStatus,this.impressionId,"isClippingPage",c.in.Information)}return t||i}getDiscount(e,t,i){let o;if(this.domainName===this.rakutenJP){const t=[];let a=f.Z.GetAllMatchingElements(i.discountSelector);if(!a.length){const e=f.Z.GetFirstVisibleElement(i.clickBeforeClipSelector);if(e?.click(),a=f.Z.GetAllMatchingElements(i.discountSelector),!a)return}a.forEach((i=>{const o="%"===i.childNodes[1].textContent||"%"===i.childNodes[1].textContent?(0,C.K)(i.childNodes[0].textContent??"0")*e:(0,C.K)(i.childNodes[0].textContent??"0");t.push(o)})),t.sort(((e,t)=>e-t)),o={discount:t[0],maxDiscount:t[t.length-1],discountString:t[0].toString()}}else{const a=f.Z.GetFirstVisibleElement(i.discountSelector),r=a?.innerText??"";if(r.includes("-")){const n=r.split("-"),s=g.Z.getAmazonClippingDiscount(e,n[0])??0,c=g.Z.getAmazonClippingDiscount(e,n[1])??0;let l=0,u=0;if(i.isSalePriceNotDiscount)if(t){const i=0===s?0:e-s,o=0===c?0:t-c;l=Math.min(i,o),u=Math.max(i,o)}else u=0===s?0:e-s,l=0===c?0:e-c;else l=s,u=c;o={discount:l,maxDiscount:u,discountString:a?.innerText??""}}else{let t=g.Z.getAmazonClippingDiscount(e,r)??0;i.isSalePriceNotDiscount&&(t=0===t?0:e-t),o={discount:t??0,maxDiscount:t??0,discountString:a?.innerText??""}}}return o}}var _=R},65559:function(e,t,i){var o=i(72370),a=i(56005),r=i(93078),n=i(73557),s=i(55590),c=i(91495),l=i(44092),u=i(91897),d=i(27689),h=i(82315),p=i(23498),g=i(52056),C=i(12714),S=i(56854);class m extends C.Z{constructor(...e){super(...e),(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"ExclusiveCouponConsentWithDomain",void 0),(0,o.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[a.Z.GetAAConsentStorageKey(this.domainName)]))}GetPopupOriginationList(){return[n.sR.AUTO_SHOW_ABANDONED_CART]}async CanAutoOpenForFeature(e,t){const i=this.apiResponse.retailerData.allProductPages;if((0,S.r)()&&i.length>0)for(let e=0;e<i.length;e++)if(this.apiResponse.retailerData.allProductPages[e].backgroundAAEnabled)return!1;return"true"!==(0,l.Lt)("CanOpenAAConsent")&&!this.isAutoTriggeredAAAllowed()}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:r.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}}t.Z=m},98011:function(e,t,i){var o=i(72370),a=i(41865),r=i(3634),n=i(95457),s=i(4872),c=i(31656),l=i(47594),u=i(59645),d=i(59352),h=i(5144),p=i(93078),g=i(93190),C=i(11050),S=i(88767),m=i(73557),A=i(55590),f=i(18491),v=i(71544),E=i(33491),P=i(91495),I=i(27689),T=i(4724),O=i(47746),y=i(8018),D=i(57550),b=i(82315),N=i(9839),R=i(1094),_=i(50607),k=i(44922),w=i(52056),x=i(54869),U=i(86743),M=i(12714),L=i(22801);class B extends M.Z{constructor(...e){super(...e),(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"hasSpbExpiryNotifyVariation",!1),(0,o.Z)(this,"hasSpbAddToCartNotifyVariation",!1),(0,o.Z)(this,"autoActivationOnCartPage",!1),(0,o.Z)(this,"itemLevelCashback",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"cartExtractionService",void 0)}Init(){this.apiResponse=b.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=x.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=x.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,w.Z.SendLogEventMessage(t,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,e.message,h.in.Error)}this.autoActivationOnCartPage=!1}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,t){const i=P.Q?.ICIsPendingTransactionPresent??!1,o=x.Z.GetICValidatorService();if(o.GetPopupOriginationList().includes(e)){if((0,U.XB)()&&(await o.Init(),await o.CanAutoOpen(e))){const e=x.Z.GetLocalDataService(),t=x.Z.GetValidatorModule();(e.GetICNotificationType()===y.c.GroceryAutoShow||e.GetICNotificationType()===y.c.AddedToCartPDP||e.GetICNotificationType()===y.c.SpbHomePage)&&t.SendValidationMessage(!1,k.S.GroceryCashback,this.apiResponse.retailerData?.domainName??"",[g.p.GROCERY_ITEMIZED_CASHBACK_LANDING])}return await this.handleICGroceryCashback(e,i)}if(this.isSpbCheckoutFlagActive()&&e===m.sR.AUTO_SHOW_SPB_CHECK_OUT_PAGE_NOTIFICATION)try{if(this.isCheckoutPage()){const t=this.cartExtractionService.GetAvailableCartData(),i=[];this.GetSpbCartOffers(i).then((()=>{const o=this.ProcessSpbCheckOutPage(i,t);if(o&&o.length>0){N.Q.sendControllerStorageMessage(A.Q.GroceryMatchedCartSpbOffers,JSON.stringify({value:o})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:y.c.SpbCartPageNotification}));const t=new CustomEvent(r.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,w.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=y.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 i=(e?.value||[]).find((e=>e.position===S.zE.SPB_OFFERS));return!(!(i&&i?.offer&&i?.promotionInformation)||t&&"true"!==i.offerLevelSignals?.autoshow)}(this.apiResponse.comparableOffers)){const i={spbOffer:B.GetSpbOffer(this.apiResponse.comparableOffers)};return this.logCanAutoOpenForFeature(e,t,!0,i),this.saveLatency(),Promise.resolve(!0)}const i=this.hasDataForPdpSpb(this.apiResponse);return i&&this.logCanAutoOpenForFeature(e,t,i),Promise.resolve(i)}if(e===m.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING)return t?((0,_.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,i=this.apiResponse.productItemizedCashBack.offer?.description,o=this.apiResponse.productItemizedCashBack.offer?.expiryDate,a=this.apiResponse.productItemizedCashBack.offer?.source,r=this.apiResponse.productItemizedCashBack.offer?.id,n=this.domainName,s=(0,I.Ek)(),c=this.apiResponse.productItemizedCashBack.offer?.cashbackProducts.find((e=>e.url===s));return w.Z.StartEdgeDriver("",JSON.stringify({action:p.v.InstantAddToCart,data:{value:e,minQty:t,description:i,expiryDate:o,source:a,id:r,domain:n,productUrl:s,quotientProductDetails:c}})),Promise.resolve(!1)}catch{return Promise.resolve(!1)}return Promise.resolve(t)}return Promise.resolve(!1)}saveLatency(){const e=new Map,t=(new Date).getTime();e.cpsSPBPDPLatency=new L.Z(L.e,L.e,t,L.e),N.Q.sendControllerStorageMessage(A.Q.NotificationLatency,JSON.stringify({value:e}))}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,_.cA)(e.userInfo,e.impressionId,"no spb home offer to autoshow for micro notification",!1),!1;const i=x.Z.GetLocalDataService(),o=i?.GetCheckoutPageData()||e,a=o?.retailerData?.getCurrentCheckoutPage();return a?.pageType===h.GV.HomePage}catch(t){(0,_.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,i,o){const a={Domain:t,PageUrl:(0,I.Ek)(),Status:"",PopupOrigination:e,Metadata:o?JSON.stringify(o):void 0};N.Q.sendLogEventMessage(a,h.R.AutoOpenController,this.apiResponse.impressionId,`Can ${i?"":"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),i="amazon.com"===e,o=this.hasInstantAddToCartConsent();return t&&i&&o}hasInstantAddToCartConsent(){const e=!!P.Q?.GroceryInstantAddToCart;return e&&N.Q.sendControllerStorageMessage(A.Q.GroceryInstantAddToCart,JSON.stringify({value:!1})),e}IsConfirmationPage(e){const t=x.Z.GetLocalDataService(),i=t?.GetCheckoutPageData()||e,o=i?.retailerData?.getCurrentCheckoutPage();return o?.pageType===h.GV.ConfirmationPage}ActivateQTOfferOnCartPageNotification(){this.apiResponse.personalizedAdsResponse;try{const e=x.Z.GetLocalDataService(),t=e?.GetCheckoutPageData()||this.apiResponse,i=t.retailerData.getCurrentCheckoutPage(location.pathname);if(t&&this.cartExtractionService&&i?.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,i=new Map;if(this.itemLevelCashback.itemizedCashback.forEach((e=>{e.cashbackProducts.forEach((o=>{t.set(o.productId,o),i.set(o.productId,e)}))})),this.itemLevelCashback.activatedOffers){this.itemLevelCashback.activatedOffers.forEach((e=>{e.cashbackProducts.forEach((e=>{t.delete(e.productId)}))}));const e=(0,E.Mw)("activatedProductId");e&&t.delete(e)}const o=this.cartExtractionService.GetAvailableCartData();if(o?.Products){let a;if(o.Products.forEach((o=>{const r=this.normalizeUrl(this.domainName,o.productUrl);if(r){const o=(0,D.xJ)(r,e),n=i.get(o.productId),s=t.get(o.productId);n&&s&&(a=O.Z.CreateFromUAPI(n),a.cashbackProducts=[],a.cashbackProducts.push(T.Z.CreateFromUAPI(s)))}})),null!==a&&a){(0,E.Xo)("activatedProductId",a.cashbackProducts[0].productId),a.expAfterActivatingDate||(a.expAfterActivatingDate=(new Date).getTime()+864e5),N.Q.sendControllerStorageMessage(A.Q.CartPageCashbackNotification,JSON.stringify({value:a})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:y.c.CartPageNotification}));const e=new u.Z(h.xu.CartPageCashbackNotification);return e.Metadata=JSON.stringify({offer:a}),e.Domain=this.domainName,w.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,w.Z.SendLogEventMessage(t,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,e.message,h.in.Error)}return!1}shouldShowcofirmationNotification(){const e=(0,I.BQ)(P.Q.ICPendingTransaction)??{},t=this.apiResponse.retailerData?.domainName||"";return!!(e&&e[t]&&this.IsConfirmationPage(this.apiResponse))}hasActivatedQt(){const e=!!P.Q?.GroceryCashbackItem&&!!P.Q?.ICActivatedPending;if(e){const e=y.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,_.WL)(e.productItemizedCashBack))return!1;const t=y.c.PdpSPB,i={};return i.cashbackData=this.apiResponse.productItemizedCashBack,i.currentUrl=(0,I.Ek)(),i.type=t,i.pageTitle=(0,I.AL)(),(0,_.jV)(e.productItemizedCashBack,e.userInfo,e.impressionId),N.Q.sendControllerStorageMessage(A.Q.ICCurrentPageInfo,JSON.stringify({value:JSON.stringify(i)})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:t})),!0}catch(t){(0,_.LT)(e.productItemizedCashBack,e.userInfo,e.impressionId,"has error processing pdp data for SPB",!0)}return!1}ProcessSpbCheckOutPage(e,t){try{if(t){const i=this.GetCartProductIds(t),o=this.GetRelatedCartSpbOffers(e),a=this.FilterActivatedOffers(o);return this.GetMatchedSpbOffers(i,a)}}catch(e){const t=new u.Z(h.xu.SPBCheckoutNotification);return t.Metadata=JSON.stringify({}),t.Domain=this.domainName,void w.Z.SendLogEventMessage(t,h.R.EdgeFlyoutStatus,this.apiResponse.impressionId,e.message,h.in.Error)}}GetMatchedSpbOffers(e,t){const i=[];return e.forEach((e=>{const o=t[e];o&&o.adsOffer&&o.adsOffer.promotionInformation&&i.push(o)})),i}GetCartProductIds(e){const t=[],i=e?.Products.map((e=>this.normalizeUrl(this.domainName,e.productUrl)));for(const e of i)if(e){const i=this.GetProductId(e);i&&t.push(i)}return t}GetProductId(e){if(this.itemLevelCashback?.domainData){const t=n.Z.Create(this.itemLevelCashback.domainData);if(e){const i=(0,D.xJ)(e,t);if(i)return i.productId}}}FilterSpbOffers(e,t){return e.forEach((e=>{e&&e.source&&"spb"===e.source&&t.push(e)})),t}FilterActivatedOffers(e){const t=[],i=Object.keys(e),o=this.apiResponse?.personalizedAdsResponse?.personalizedCashback,a=o||void 0;if(a?.adsCashback&&a?.adsCashback?.length>0){const e=a?.adsCashback;e.forEach((e=>{if(e&&e?.destinationUrl){const i=this.normalizeUrl(this.domainName,e?.destinationUrl);if(i){const e=this.GetProductId(i);e&&t.push(e)}}}))}const r=i.filter((e=>!t.includes(e))),n={};for(const t of r)n[t]=e[t];return n}GetRelatedCartSpbOffers(e){const t=[];e.forEach((e=>{if(e.cashbackData&&e.cashbackData.itemizedCashBackResponse&&e.cashbackData.itemizedCashBackResponse.offers){const i=e.cashbackData.itemizedCashBackResponse.offers;this.FilterSpbOffers(i,t)}}));const i={};for(const e of t)if(e.adsOffer&&e.adsOffer.destinationUrl){const t=this.GetProductId(new URL(e.adsOffer.destinationUrl));t&&(i[t]=e)}return i}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||"",i=e.itemLevelCashBack?.submittedOfferIds||[],o=e.itemLevelCashBack?.activatedOffers?.map((e=>e.id))||[];if(!(0,_.mg)(e.productItemizedCashBack,t,i,o))return!1;const a=y.c.PDP,r={};return r.cashbackData=e.productItemizedCashBack,r.currentUrl=(0,I.Ek)(),r.type=a,r.pageTitle=(0,I.AL)(),N.Q.sendControllerStorageMessage(A.Q.ICCurrentPageInfo,JSON.stringify({value:JSON.stringify(r)})),N.Q.sendControllerStorageMessage(A.Q.ICNotificationType,JSON.stringify({value:a})),(0,_.iQ)(e.productItemizedCashBack,e.userInfo,e.impressionId),!0}catch(t){(0,_.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 i=this.cartExtractionService.GetAvailableCartData();if(i?.Products&&this.isCheckoutPage()&&this.isSpbCheckoutFlagActive()){const o=i?.Products.map((e=>e.productTitle));this.searchWithKeywords(o);const a=i=>{e.push(i?.detail?.jsonResponse),e.length===o.length&&t(!0)};window.addEventListener(r.fU,a),setTimeout((()=>{window.removeEventListener(r.fU,a),t(!0)}),700)}else t(!0)}))}isCheckoutPage(){const e=R.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,i=a.Z.Create(this.apiResponse),o=x.Z.GetICValidatorService();await o.Init();const r={appName:v.Z.GetClientName(),buildVersion:i?.buildVersion,enabledfeatures:c.R.GetExpRawData()},n=e.map((async e=>{try{return o.SendGetCashbackMessage(t,e,f.x.Search,r)}catch(e){return null}}));return await Promise.all(n)}}t.Z=B},43263:function(e,t,i){i.d(t,{Z:function(){return N}});var o=i(72370),a=i(64865),r=i(4872),n=i(31656),s=i(79308);class c{constructor(){(0,o.Z)(this,"heading",void 0),(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"delivery",void 0),(0,o.Z)(this,"soldBy",void 0),(0,o.Z)(this,"rating",void 0),(0,o.Z)(this,"sellerUrl",void 0),(0,o.Z)(this,"index",void 0),(0,o.Z)(this,"totalPrice",void 0),(0,o.Z)(this,"currency",void 0),(0,o.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=i(15612),d=i(5144),h=i(93190),p=i(39088),g=i(73557),C=i(29247),S=i(36493),m=i(91495),A=i(27689),f=i(90066),v=i(1094);class E{constructor(){(0,o.Z)(this,"ProductAddedNotification",void 0),(0,o.Z)(this,"Url",void 0)}static Create(e){const t=new E;return t.ProductAddedNotification=e.ProductAddedNotification,t.Url=e.Url,t}}var P=E,I=i(44922),T=i(52056),O=i(54869),y=i(86743),D=i(12714);class b extends D.Z{constructor(...e){super(...e),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"validatorModule",void 0),(0,o.Z)(this,"isConfirmationScenario",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"checkoutPageUrlData",void 0)}async Init(){try{if(this.localDataService=O.Z.GetLocalDataService(),this.validatorModule=O.Z.GetValidatorModule(),this.domainName=this.localDataService.GetDomainName(),this.checkoutPageUrlData=this.localDataService.GetCheckoutPageData().retailerData.getCurrentCheckoutPage(v.Z.GetCurrentPathName()),!this.checkoutPageUrlData||!this.ShouldTriggerOtherSellers(this.checkoutPageUrlData))return;this.ManageOtherSellersData(v.Z.GetCurrentPathName(),m.Q.storageObjStr,m.Q.rawStorageObj);const e=this.GetOtherSellersNotificationData(v.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,t){if(!this.checkoutPageUrlData||!this.ShouldTriggerOtherSellers(this.checkoutPageUrlData))return!1;if(n.R.getServiceExperimentValue(r.H.disableNotificationForSimilarSellers)||!(0,y.XB)()&&this.validatorModule.validationMsgNum>0)return this.ValidateOtherSellersScenario(this.domainName,this.checkoutPageUrlData,this.localDataService.GetMarket(),this.isConfirmationScenario),!1;this.validatorModule.SendValidationMessage(!1,I.S.CheckingOtherSellers,this.domainName);const i=await this.ValidateOtherSellersScenario(this.domainName,this.checkoutPageUrlData,this.localDataService.GetMarket(),this.isConfirmationScenario);return i&&this.validatorModule.SendValidationMessage(!1,I.S.OtherSellers,this.domainName,[h.p.OTHER_SELLERS],!1,!(0,y.XB)()),i}ShouldTriggerOtherSellers(e){return void 0!==e.otherSellerSelectors&&this.IsVersionAllowed(p.W1,e.otherSellerSelectors.jSVersionThreshold)}isOtherSellersScenario(e){const t=e?.otherSellerSelectors?.otherSellersOverlayLinkSelector;return!(!t||(0,a.TF)(t))&&f.Z.HasVisibleElement(t)}CheckOtherSellersAutoOpen(e){const t=e.otherSellerSelectors.otherSellerLowestPriceSelector,i=f.Z.GetFirstVisibleElement(t);if(i&&i.innerText){const i=T.Z.GetOrderTotalString(e.orderTotalDataElementSelector),o=new l;if(o.price=T.Z.GetOrderTotalString(t),o.delivery="",!this.OtherSellerHasLowerPrice("amazon",i,o,""))return!1}return!0}async StoreOtherSellersInfo(e,t,i){if(!t)return null;if(!this.ValidateDataFields(e,t))return null;const o="OtherSellersData_"+v.Z.GetCurrentPathName(),a="OtherSellersIframe";try{const r=t.otherSellerSelectors.otherSellersOverlayLinkSelector,n=f.Z.GetFirstVisibleElement(r);if(n){const c=n.getAttribute("href");if(c&&e.includes("amazon")){const r=this.CreateIframe(a,c);document.body.insertBefore(r,document.body.children[0]);const n=await this.CollectOtherSellersInfo(e,t,a,i);try{this.RankOtherSellers(n)}catch(t){const i="Error while ranking other sellers. "+t,o=new s.Z;o.SetResultData(e,0,(0,S.K)(n?.productPrice??""),"",n?.currency??"$","Error"),T.Z.SendLogEventMessage(o,d.R.OtherSellers,this.validatorModule.impressionId,i,d.in.Information)}if(n&&n.otherSellers?.length>0)return T.Z.SendStorageMessage(o,JSON.stringify({value:JSON.stringify(n)})),n}else if("walmart.com"===e){const n=this.CreateIframe(a,v.Z.GetCurrentPathName());document.body.appendChild(n),await C.ZP.WaitForCondition((async()=>{const e=document.querySelectorAll("#"+a)[0],t=e?.contentDocument?.body,i=t?.querySelector(r);return void 0!==i?.innerText}),13e4);const s=document.querySelectorAll("#"+a)[0],c=s?.contentDocument?.body,l=c?.querySelector(r);l&&(l.click(),await setTimeout((()=>{l.click()}),3e3));const u=await this.CollectOtherSellersInfo(e,t,a,i);if(u&&u.otherSellers?.length>0)return T.Z.SendStorageMessage(o,JSON.stringify({value:JSON.stringify(u)})),u}}}catch(t){const i="Error while getting collecting other sellers data. "+t,o=new s.Z;o.SetResultData(e,0,0,"","","Error"),T.Z.SendLogEventMessage(o,d.R.OtherSellers,this.validatorModule.impressionId,i,d.in.Information)}return null}ResetOtherSellersNotificationFlag(){T.Z.SendStorageMessage("OtherSellersNotificationData_"+v.Z.GetCurrentPathName(),JSON.stringify({value:null}))}ValidateOtherSellerConfirmationScenario(e,t,i){return!(!this.ShouldTriggerOtherSellers(t)||!this.isOtherSellersConfirmationScenario(i)||(this.ResetOtherSellersNotificationFlag(),0))}IsVersionAllowed(e,t){if((0,a.TF)(t))return!0;try{return parseFloat(e)>=parseFloat(t)}catch(e){}return!1}isOtherSellersConfirmationScenario(e){if(e?.ProductAddedNotification){if(e?.Url===v.Z.GetCurrentPathName())return!0;this.ResetOtherSellersNotificationFlag()}return!1}ManageOtherSellersData(e,t,i){const o="OtherSellersData_"+e;!(0,a.TF)(i[o])&&T.Z.DeleteKeyFromPersistentStorage(o);const r=t.replace(/[,{]"OtherSellersData_[^\s{]*":null/g,"").replace(/[,{]"OtherSellersConfirmationData_[^\s{]*":null/g,"").match(/[,{]"OtherSellersData_[^\s{]*":|[,{]"OtherSellersConfirmationData_[^\s{]*":/g);r&&r.length>20&&this.ClearOtherSellersStorage(r,i)}ClearOtherSellersStorage(e,t){if(null!==e&&null!=t)for(const i of e){const e=i.slice(2,-2);if((0,a.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"),T.Z.SendLogEventMessage(t,d.R.OtherSellers,this.validatorModule.impressionId,e,d.in.Information)}else T.Z.DeleteKeyFromPersistentStorage(e)}}GetOtherSellersNotificationData(e,t){const i="OtherSellersNotificationData_"+e;return(0,a.TF)(t[i])?new P:P.Create((0,A.BQ)(t[i]))}async ValidateOtherSellersScenario(e,t,i,o){return!!this.isOtherSellersScenario(t)&&(o?(this.TryStoreOtherSellersInfo(e,t,i,!1),!1):this.ShouldAutoShowForOtherSellers(e,m.Q.OtherSellersAutoShowCount??0,m.Q.OtherSellersLastAutoShowTime)?e.includes("amazon")&&!this.CheckOtherSellersAutoOpen(t)?(this.TryStoreOtherSellersInfo(e,t,i,!1),!1):await this.TryStoreOtherSellersInfo(e,t,i,!0):(this.TryStoreOtherSellersInfo(e,t,i,!1),!1))}async TryStoreOtherSellersInfo(e,t,i,o){const a=await this.StoreOtherSellersInfo(e,t,i),r=null!==a;if(!r)return!1;let n=!0;if("amazon.com"===e&&a&&a.otherSellers?.length>0){const e=a.otherSellers[0].heading?.toLowerCase()??"";n=e.includes("new")&&!e.includes("like")}return!!(r&&n&&o)}ShouldAutoShowForOtherSellers(e,t,i){if((0,a.TF)(i)||t<2)return!0;const o=this.ParseLastAutoShowTime(e,i);return o<=0||Date.now()-o>72e5&&(T.Z.SendStorageMessage("OtherSellersAutoShowCount",JSON.stringify({value:null})),T.Z.SendStorageMessage("OtherSellersLastAutoShowTime",JSON.stringify({value:null})),!0)}ParseLastAutoShowTime(e,t){try{return Date.parse(t)}catch(t){const i="Error while parsing other sellers autoshow date. "+t,o=new s.Z;return o.SetResultData(e,0,0,"","","Error"),T.Z.SendLogEventMessage(o,d.R.OtherSellers,this.validatorModule.impressionId,i,d.in.Information),0}}OtherSellerHasLowerPrice(e,t,i,o,a,r){try{const n=(0,S.K)(t);let s=(0,S.K)(i.price);const c=this.GetDeliveryRegex(e,o,r??"");let l=0;const u=i.delivery.trim().match(c);u&&u.length>0&&(l=(0,S.K)(u[0])),l>0&&(s+=l),i.totalPrice=s;const d=n-s;if(n&&s&&d>=(a??.6)&&d/n>=.01)return!0}catch(e){}return!1}GetDeliveryRegex(e,t,i){if("walmart.com"===e)return/\$[0-9.,]+/;try{const e=(0,S.Cl)(t,i),o="^"+(0,S.So)(e)+"\\s*[0-9.,]+",a="[0-9.,]+\\s*"+(0,S.So)(e);return new RegExp(o+"|"+a)}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,i,o){const r=new u.Z;r.otherSellers=[];const n=t.otherSellerSelectors;await C.ZP.WaitForCondition((async()=>{const e=document.querySelectorAll("#"+i)[0],t=e?.contentDocument?.body,o=t?.querySelector(n.otherSellerOfferElementSelector);return void 0!==o?.innerText}),13e4);const s=document.querySelectorAll("#"+i)[0],c=s?.contentDocument?.body,d=c?.querySelectorAll(n.otherSellerOfferElementSelector);if(!d)return r;let h=T.Z.GetOrderTotalString(t.orderTotalDataElementSelector);h?.includes("(")&&h?.includes(")")&&(h=h.slice(0,h.indexOf("("))),r.productPrice=h,r.currency=(0,S.cU)(h);let p=0;for(const t of d){if(0===p&&"walmart.com"===e){p+=1;continue}const i=new l,a=t.querySelector(n.otherSellerPriceSelector);i.price=a?.innerText??"",i.currency=(0,S.cU)(a?.innerText??"");const s=t.querySelector(n.otherSellerDeliverySelector);if(i.delivery=s?.innerText??"","walmart.com"===e){const e=a?.innerText?.split("\n");if(e&&(i.price=e[0],i.currency="$",e.length>1)){const t=e[1];!t.toLowerCase().includes("free")&&i.delivery&&(i.delivery+=t)}}if(!this.OtherSellerHasLowerPrice(e,h,i,i.currency,void 0,o))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";i.heading=c?.innerText,i.soldBy=u?.innerText,i.sellerUrl=u?.getAttribute("href")??"","-1"!==g&&(i.rating=parseFloat(g.replace("-","."))),i.index=p,r.otherSellers.push(i),p+=1}const g=c?.querySelector(n.productImageSelector);return g&&!(0,a.TF)(g.src)&&(r.productImage=g.src),r.productUrl=v.Z.GetCurrentPathName(),r.dataCreationTime=Date.now(),r}ValidateDataFields(e,t){const i=t.otherSellerSelectors;if(void 0===i)return!1;const o=C.ZP.IsValidDataField(i.otherSellersOverlayLinkSelector)&&C.ZP.IsValidDataField(i.otherSellerOfferElementSelector)&&C.ZP.IsValidDataField(i.otherSellerHeadingSelector)&&C.ZP.IsValidDataField(i.otherSellerPriceSelector)&&C.ZP.IsValidDataField(i.otherSellerDeliverySelector)&&C.ZP.IsValidDataField(i.productImageSelector)&&C.ZP.IsValidDataField(i.otherSellerNameSelector)&&C.ZP.IsValidDataField(i.otherSellerAddButtonSelector)&&C.ZP.IsValidDataField(i.otherSellerAddedConfirmationSelector),a=C.ZP.IsValidDataField(i.otherSellerRatingSelector),r=C.ZP.IsValidDataField(t.errorMessageSelector);if(e.includes("amazon"))return o&&a;if("walmart.com"===e)return o&&r;{const t="Other sellers scenario for wrong domain: "+e,i=new s.Z;return i.SetResultData(e,0,0,"","","Error"),T.Z.SendLogEventMessage(i,d.R.OtherSellers,this.validatorModule.impressionId,t,d.in.Information),!1}}CreateIframe(e,t){const i=document.createElement("iframe");return i.id=e,i.src=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.border="none",i.style.visibility="hidden",i.style.left="0",i.style.top="0",i.hidden=!0,i.tabIndex=-1,i.title="empty",i.style.display="none",i}RankOtherSellers(e){const t=[],i=[];for(const o of e.otherSellers){let a=!1;if(o.heading?.toLowerCase().includes("new")){const t=o.totalPrice,i=(0,S.K)(e.productPrice);let r=1;o.heading?.toLowerCase().includes("like new")&&(r=3),i-t>=r&&(a=!0)}a?t.push(o):i.push(o)}return e.otherSellers=t.concat(i),e}}var N=b},20546:function(e,t,i){var o=i(72370),a=i(56005),r=i(3634),n=i(5144),s=i(93078),c=i(73557),l=i(55590),u=i(29247),d=i(91495),h=i(44092),p=i(91897),g=i(27689),C=i(90066),S=i(82315),m=i(23498),A=i(9839),f=i(52056),v=i(12714),E=i(56854),P=i(31656),I=i(4872),T=i(54869);class O extends v.Z{constructor(...e){super(...e),(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"BestCouponConsentData",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"aaConsentData",void 0),(0,o.Z)(this,"localDataService",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.localDataService=T.Z.GetLocalDataService(),this.apiResponse.retailerData?.aaConsentEnabled&&(this.aaConsentData=(0,g.BQ)(d.Q.rawStorageObj[a.Z.GetAAConsentStorageKey(this.domainName)]))}GetPopupOriginationList(){return[c.sR.AUTO_SHOW_PRODUCT_BEST_COUPON_CONSENT]}async CanAutoOpenForFeature(e,t){if(!P.R.isExperimentActive(I.H.reenableProductBestCoupon))return!1;const i=this.apiResponse.retailerData.allProductPages;if((0,E.r)()&&i.length>0)for(let e=0;e<i.length;e++)if(this.apiResponse.retailerData.allProductPages[e].backgroundAAEnabled)return!1;return!("true"===(0,h.Lt)("CanOpenAAConsent")||this.isAutoTriggeredAAAllowed()||!this.apiResponse.productBestCoupon?.coupon)||!!P.R.isExperimentActive(I.H.reenableProductBestCouponSearchPage)&&(this.searchPageHasBestCoupon(e).catch(console.error),!1)}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],f.Z.SendStorageMessage(l.Q.ProductBestCouponConsent,JSON.stringify({value:JSON.stringify(this.BestCouponConsentData)})),!1)}AutoApplyBestCoupon(){this.BestCouponConsentData&&this.BestCouponConsentData[this.domainName]?.productBestCoupon&&(f.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],f.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 searchPageHasBestCoupon(e){const t=this.apiResponse.retailerData.allCheckoutPages.find((e=>e.pageType===n.GV.SearchPage)),i=t?.checkoutPageUrl,o=window.location.href.toLocaleLowerCase();let a=!1;if(i&&o&&t.productTitleSearchSelector){const e=i.split(",");for(const t of e){const e=new RegExp(t).exec(o);if(e&&e.length>0){a=!0;break}}}if(t&&a){await(0,u.dz)((async()=>C.Z.HasVisibleElement(t.productTitleSearchSelector)),1e3);const i=document.querySelectorAll(t.productTitleSearchSelector);if(i?.length>0)for(let t=0;t<i.length&&t<3;t++){let o=i[t].textContent?.replace(/[\n\r]+|[\s]{2,}/g," ")?.trim()??"";const a=this.apiResponse.retailerData?.domainName??(0,g.S8)();"macys.com"===a&&o&&(o=o.replace(/[\w]+   /g,""));const n=await this.fetchBestCouponForProduct(o,a);if(n&&void 0!==n?.coupon&&void 0!==n?.couponType){n.product=o,A.Q.sendControllerStorageMessage(l.Q.ProductBestCoupon,JSON.stringify({value:JSON.stringify(n)}));const t=new CustomEvent(r.T2,{detail:{popupOrigination:e}});return void window.dispatchEvent(t)}}}}async fetchBestCouponForProduct(e,t){const i={Domain:t,ProductName:e,ImpressionId:this.localDataService.GetImpressionId(),Muid:this.localDataService.GetMuid(),Market:this.localDataService.GetMarket()};try{const e=T.Z.GetClientRequestsService();return await e.SendRequest("cartProcessing","getProductBestCoupon",i)}catch(e){}}}t.Z=O},7664:function(e,t,i){i.d(t,{X:function(){return H}});var o=i(72370),a=i(27900),r=i(5144);const n="TravelDataStorageInfo";class s{constructor(){(0,o.Z)(this,"Price",void 0),(0,o.Z)(this,"TravelDataCreationTime",void 0),(0,o.Z)(this,"CheckoutId",void 0),(0,o.Z)(this,"StartDate",void 0),(0,o.Z)(this,"EndDate",void 0),(0,o.Z)(this,"Currency",void 0),(0,o.Z)(this,"Name",void 0),(0,o.Z)(this,"DomainType",void 0),(0,o.Z)(this,"flightLegs",void 0),(0,o.Z)(this,"isRoundTrip",void 0),(0,o.Z)(this,"PageUrl",void 0)}}var c=i(33491),l=i(29247),u=i(43686),d=i(18435),h=i(84830),p=i(71544),g=i(4872);class C{constructor(){(0,o.Z)(this,"name",void 0),(0,o.Z)(this,"startDate",void 0),(0,o.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=i(39088),A=i(82960),f=i(3634),v=i(90066),E=i(55590),P=i(36493),I=i(14440);class T{}(0,o.Z)(T,"ProductIdsGetter",{"amazon.com":e=>{const t=document.querySelectorAll(e);if(t){let e="";return t.forEach((t=>{const i=t.defaultValue.split("|")[0];e+=i+T.sep})),e}return null},"walmart.com":e=>{const t=document.querySelector(e);if(t){const e=t?.src,i=/item_ids=([^&]*)/,o=e?.match(i);let a="";return o&&o.length>=2&&o[1].split("%2C").forEach((e=>{a+=e+T.sep})),a}return null},"jcpenney.com":e=>{const t=document.querySelectorAll(e);if(t){let e="";return t.forEach((t=>{const i=t.dataset.ppid;e+=i+T.sep})),e}return null}}),(0,o.Z)(T,"sep","<SEP>");var O=T;class y{constructor(){(0,o.Z)(this,"checkoutUrl",void 0),(0,o.Z)(this,"domain",void 0),(0,o.Z)(this,"domainType",void 0),(0,o.Z)(this,"checkoutId",void 0),(0,o.Z)(this,"startDate",void 0),(0,o.Z)(this,"endDate",void 0),(0,o.Z)(this,"name",void 0),(0,o.Z)(this,"currency",void 0),(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"flightLegs",void 0),(0,o.Z)(this,"isRoundTrip",void 0)}static Create(e){const t=new y;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 D=y,b=i(27689),N=i(11849),R=i(52056),_=i(54869),k=i(93970),w=i(31656),x=i(64865),U=i(91495),M=i(57459),L=i(59368);function B(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function F(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?B(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class Z{constructor(){(0,o.Z)(this,"cartExtractionSuccessful",void 0),(0,o.Z)(this,"mutationObserver",void 0),(0,o.Z)(this,"isPersonalizationDataConsentEnabled",void 0),(0,o.Z)(this,"onCartExtractionCallback",void 0),(0,o.Z)(this,"retailerData",void 0)}subscribe(e){this.onCartExtractionCallback=e}async Init(){const e=_.Z.GetLocalDataService(),t=e.GetCheckoutPageData();if(this.isPersonalizationDataConsentEnabled=t.userInfo?.isPersonalizationDataConsentEnabled??e.IsP13nEnabled()??!1,!t.retailerData)return;this.retailerData=t.retailerData,this.logInfo("Starting cart collection",t.retailerData.domainName??"","","",!1);const i=e.GetIsFinalCheckoutPage(),o=(0,b.uf)(t?.market,t.retailerData?.exclusiveMarket),a=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(i){const e=A.Z.uuidv4();this.logInfo("Attempting cart extraction from final checkout page",n,a,e,!1),this.TryCheckAndCollectCartInformation(n,a,c,o,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,a,o,t,l,s,u,d,e)}const p=t.retailerData?.getCurrentCheckoutPage(location.pathname);if(!p)return;const g=p.pageType??r.GV.CheckoutPage;if(g===r.GV.CheckoutPage||g===r.GV.NoInputCheckoutPage)if(i){const e=A.Z.uuidv4();this.TryShouldAttemptCartCollectionAgain(n,a,p,o,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,a,e,!1),this.TryCheckAndCollectCartInformation(n,a,p,o,u,d,p?.automatedCartExtractionEnabled,t.isCashbackEstimationSupportedForDomain,l,s,void 0,e)}if(g===r.GV.ProductPage){const e=A.Z.uuidv4();this.logInfo("Attempting cart extraction from product page",n,a,e,!1),this.CollectCartInfoFromProductPage(n,t,a,o,u,d,l,s,e)}}async PostValidation(){}async TryShouldAttemptCartCollectionAgain(e,t,i,o,a,n,s,c,l,u,d){this.ShouldAttemptCartCollectionAgain(i,s).then((r=>{r&&this.TryCheckAndCollectCartInformation(e,t,i,o,a,n,s,c,l,u,void 0,d)})).catch((i=>{const o={domain:e,cartUrl:location.pathname};this.LogCartExtractionEvent(o,r.R.CartExtractionError,i?.message,r.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,i,o,a,n,s,c,l,u,d,h){i?.travelCheckoutSelectors?this.CheckAndCollectTravelCheckoutInformation(e,t,i.travelCheckoutSelectors,o,l).catch((i=>{const o={domain:e,cartUrl:location.pathname,isTravel:!0};this.LogCartExtractionEvent(o,r.R.CartExtractionError,"Error during travel checkout extraction: "+i?.message,r.in.Error,t,h)})):this.CheckAndCollectCartInformation(e,t,i,o,a,n,s,c,l,u,d,i?.getProductNamesFromImg,h).catch((i=>{const o={domain:e,cartUrl:location.pathname};this.LogCartExtractionEvent(o,r.R.CartExtractionError,i?.message,r.in.Error,t,h)}))}GetLastTravelData(){const e=(0,c.Mw)(n);return e&&!(0,x.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)(a.OY);return e&&!(0,x.TF)(e)?JSON.parse(e):null}GetFastCart(){try{const e=(0,c.Mw)(a.hm);if(e&&!(0,x.TF)(e))return JSON.parse(e)}catch(e){}return null}GetAvailableCartData(){const e=this.GetLastCartData(),t=(0,c.Mw)(a.hm);let i=null;t&&!(0,x.TF)(t)&&(i=JSON.parse(t));const o=i?.CartDataCreationTime??0;return e?.CartDataCreationTime&&e?.CartDataCreationTime>o?e:i}async CheckAndCollectCartInformation(e,t,i,o,a,n,s,c,u,d,h,p,g){if(!i||!i?.cartSelectors&&!0!==s&&!n?.details?.productName){this.cartExtractionSuccessful=!1;const i="Unable to get cart data: No Selectors",o={cartId:"",cartUrl:location.pathname,domain:e};return"rei.com"===e&&(o.cartUrl=location.pathname+location.hash),void this.LogCartExtractionEvent(o,r.R.CartExtractionError,i,r.in.Error,t,g)}const C=i?.pageType===r.GV.ProductPage,S=this.GetLastCartData(),m=performance.now(),A=i.orderTotalDataElementSelector;let f={OrderTotal:-1,Currency:(0,P.N6)(o)??"",PageCurrency:""};l.ZP.IsValidDataField(A)&&(f=await l.ZP.WaitForCondition((async()=>v.Z.RunQuerySelectorAll(A)?.length>0),5e3).then((async()=>await N.Z.WaitAndGetCartValue(A,o))).catch((i=>{const o={cartId:S?.CartId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(o,r.R.CartExtractionError,i?.message,r.in.Error,t,g),f}))),f.OrderTotal>0||(f=await N.Z.WaitAndGetCartValue2(A,o));const E=performance.now(),I=this.GetTimeDiff(m,E);this.logInfo(`Cart value extracted. timeToExtract: ${I} ms, extracted total: ${f?.OrderTotal}`,e,t,g,!1);try{const r=new URL(window.location.href);d&&this.MonitorCart(e,t,r,i,o,a,n,s,c,u,d,g)}catch(i){const o={cartId:S?.CartId??"",cartUrl:location.pathname,domain:e};this.LogCartExtractionEvent(o,r.R.CartExtractionError,"error adding cart monitor: "+i?.message,r.in.Error,t,g)}if(S&&!this.ShouldCollectStorageData(f,S,i?.cartSelectors?.productSellerSelector))return this.notifyCartDataListeners(),void this.logInfo("Stopping cart extraction: cart hasn't changed",e,t,g);if(!i?.cartSelectors&&!n?.details?.productName)return this.logInfo("Extracting cart from automatedSelectorsData",e,t,g),void _.Z.GetAutomaticCartExtractionService().TryCollectCartInformation(e,f,o,t,k.ZP.traceId,a,S?.CartId);const T=i.cartSelectors;try{await this.CollectCartInformation(e,f,T,t,i,a,o,n,S?.CartId,u,C,h,p,g)}catch(i){const o={cartId:S?.CartId??"",cartUrl:location.pathname,domain:e};"rei.com"===e&&(o.cartUrl=location.pathname+location.hash),this.LogCartExtractionEvent(o,r.R.CartExtractionError,i?.message,r.in.Error,t,g)}const O=performance.now(),y=this.GetTimeDiff(m,O);this.logInfo(`Cart extraction finished. Total time: ${y} ms`,e,t,g,!1)}async TryCheckAndCollectTravelCheckoutInformation(e,t,i,o){this.CheckAndCollectTravelCheckoutInformation(e,t,i,o).catch((e=>{}))}async CheckAndCollectTravelCheckoutInformation(e,t,i,o,a){if(!i){const i={cartId:"",cartUrl:location.pathname,domain:e};return void this.LogCartExtractionEvent(i,r.R.CartExtractionError,"unable to get travel checkout data: no selectors",r.in.Error,t)}const n=this.GetLastTravelData(),s=i.priceSelector;let c={OrderTotal:-1,Currency:"$",PageCurrency:""};if(l.ZP.IsValidDataField(s)&&(c=await l.ZP.WaitForCondition((async()=>v.Z.RunQuerySelectorAll(s)?.length>0),5e3).then((async()=>await N.Z.WaitAndGetCartValue2(s,o))).catch((i=>{const o={cartId:n?.CheckoutId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(o,r.R.CartExtractionError,"Couldn't get cart value: "+i?.message,r.in.Error,t),c}))),!n||this.ShouldCollectTravelStorageData(c,n))try{await this.CollectTravelCheckoutInformation(e,t,i,n?.CheckoutId,a)}catch(i){const o={cartId:n?.CheckoutId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(o,r.R.CartExtractionError,"Error during travel checkout collection: "+i?.message,r.in.Error,t),c}else{const i={cartId:n?.CheckoutId??"",cartUrl:location.pathname,domain:e};this.LogCartExtractionEvent(i,r.R.CartExtractionError,"Stopping travel checkout extraction: cart hasn't changed",r.in.Error,t)}}ShouldCollectTravelStorageData(e,t){return!(t&&t.Price===e.OrderTotal&&-1!==e.OrderTotal&&!(0,x.TF)(t.CheckoutId)&&Date.now()-t.TravelDataCreationTime<=432e5)}async CollectTravelCheckoutInformation(e,t,i,o,a){const u=new D;let d;if(u.domain=e,u.domainType=i.domainType,u.checkoutId=o??A.Z.uuidv4(),u.checkoutUrl=location.pathname,await l.ZP.WaitForCondition((async()=>(d=v.Z.GetFirstVisibleElement(i.startDateSelector),void 0!==d)),5e3),void 0===d){const i={cartId:"",cartUrl:location.pathname,domain:e};this.LogCartExtractionEvent(i,r.R.CartExtractionError,"Unable to find start date of travel checkout page",r.in.Error,t)}u.flightLegs=[];const h=v.Z.GetAllVisibleElements(i.startDateSelector),p=v.Z.GetAllVisibleElements(i.endDateSelector),g=v.Z.GetAllVisibleElements(i.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=v.Z.GetFirstVisibleElement(i.endDateSelector),m=v.Z.GetFirstVisibleElement(i.nameSelector);u.endDate=C?.innerText?.trim()??"",u.name=m?.innerText?.trim()??"",(0,L.kO)(u.startDate,u.endDate,i.dateSeparationRegex)&&([u.startDate,u.endDate]=(0,L.Ox)(u.startDate,u.endDate,i.dateSeparationRegex)),u.endDate=(0,L.Pf)(u.startDate,i.dateCleaningRegex),u.endDate=(0,L.Pf)(u.endDate,i.dateCleaningRegex);const f=R.Z.GetOrderTotalString(i.priceSelector),E=(0,P.cU)(f),I=(0,P.K)(f,E);u.price=I,u.currency=E,this.LogCartExtractionEvent(u,r.R.TravelCheckoutExtraction,"Successfully extracted Travel Checkout Information",r.in.Information,t);const T=new s;T.Price=u.price,T.CheckoutId=u.checkoutId,T.StartDate=u.startDate,T.EndDate=u.endDate,T.Name=u.name,T.DomainType=u.domainType,T.Currency=u.currency,T.TravelDataCreationTime=Date.now(),T.PageUrl=location.pathname,(0,c.Xo)(n,JSON.stringify(T)),a&&this.SendPersistentTravelCheckoutMessage(e,T,t)}async MonitorCart(e,t,i,o,a,r,n,s,c,u,d,h){if(d===i.pathname||c){const s={attributes:!0,characterData:!0,childList:!0,subtree:!0};this.mutationObserver||(this.mutationObserver=new MutationObserver((async i=>{this.CheckAndCollectCartInformation(e,t,o,a,r,n,o?.automatedCartExtractionEnabled,c,u,d,void 0,o?.getProductNamesFromImg,h),window.dispatchEvent(new Event("CartUpdate"))})));const p=o?.orderTotalDataElementSelector,g=o?.orderTotalDataContainerElementSelector;if(p){await l.ZP.WaitForCondition((async()=>{const e=v.Z.GetFirstVisibleElement(p);return void 0!==e?.innerText}),5e3);const e=v.Z.GetFirstVisibleElement(p);if(e&&(this.mutationObserver?.disconnect(),this.mutationObserver?.observe(e,s),g)){const e=v.Z.GetFirstVisibleElement(g);e&&this.mutationObserver?.observe(e,s)}}if("kohls.com"===e&&"/checkout/shopping_cart.jsp"===i.pathname){const e="shoppingBagHook",t=document.getElementById(e);t&&this.mutationObserver?.observe(t,s)}else if("bedbathandbeyond.com"===e&&"/store/checkout"===i.pathname){const e="ul[class*='ProgressBar']",t=v.Z.GetFirstVisibleElement(e);t&&(this.mutationObserver?.disconnect(),this.mutationObserver?.observe(t,s))}else if("macys.com"===e&&i.pathname===d){const e="bag-summary",t=document.getElementById(e);t&&this.mutationObserver?.observe(t,s)}else if("rei.com"===e&&i.pathname===d){const e=v.Z.GetFirstVisibleElement("section-navigation");e&&this.mutationObserver?.observe(e,s)}}else this.mutationObserver?.disconnect()}ShouldCollectStorageData(e,t,i){if(t&&t.OrderTotal===e.OrderTotal&&-1!==e.OrderTotal&&!(0,x.TF)(t.CartId)){if(w.R.isExperimentActive(g.H.fixCartUpdate)&&t.Products?.length>0&&i&&!Boolean(t?.Products[0].productSeller))return!0;if(Date.now()-t.CartDataCreationTime<=a.l$)return this.cartExtractionSuccessful=!0,!1}return!0}async GetProductNamesDirectly(e,t,i,o,a,n,s,c,u,d,h){let p;if(await l.ZP.WaitForCondition((async()=>(p=this.QueryAllWithAutomatedFallback(document,i?.productTitleSelector,s?.details?.productName,t,o,!1),void 0!==p&&p.length>0)),5e3),p=this.QueryAllWithAutomatedFallback(document,i?.productTitleSelector,s?.details?.productName,t,o,!0),!(p&&p.length>0)){const t="No cart selector provided, unable to find products with product title selector.";return void this.LogCartExtractionEvent(e,r.R.CartExtractionError,t,r.in.Error,o,h)}for(const t of p){const i=new I.Z;i.productTitle=t?.textContent?.trim()??"",e.products.push(i)}const C=w.R.isExperimentActive(g.H.improvedCartModelCouponCoverage);C&&this.SetBlockedCouponsRequestPending(!0),this.logInfo("Log cart from product names directly",t,o,h),this.LogCartInfo(e,t,o,a,n,c,u,d,void 0,h),C&&this.CheckAndSendCartProcessingRequest(a,e,t).then((()=>this.SetBlockedCouponsRequestPending(!1))).catch((e=>{this.SetBlockedCouponsRequestPending(!1)}))}QueryWithAutomatedFallback(e,t,i,o,a){const r=this.QueryAllWithAutomatedFallback(e,t,i,o,a,e===document);return r&&r.length>0?r[0]:void 0}QueryAllWithAutomatedFallback(e,t,i,o,a,n,s){const c=t?e.querySelectorAll(t):void 0,l=i?e.querySelectorAll(i):void 0;if(n&&t&&i){const e={Domain:o,PageUrl:location.href,ManualSelector:t,AutomatedSelector:i,ManualMatchCount:c?.length??0,AutomatedMatchCount:l?.length??0},n="QueryAll with automated fallback";this.LogCartExtractionEvent(e,r.R.AutomatedSelectorsDiagnostic,n,r.in.Information,a,s,!0)}return c??l}isEmptyCart(e){try{const t=document?.body?.innerText?.toLocaleLowerCase()??"",i="",o=e?.emptyCartText?.toLocaleLowerCase()??"";if(i&&t.includes(i))return!0;if(!(0,x.TF)(o)&&t.includes(o))return!0}catch(e){}return!1}async CollectCartInformation(e,t,i,o,a,n,s,c,d,h,p,g,C,S){const m=new u.Z;if(m.domain=e,m.cartValue=t.OrderTotal,m.currency=t.Currency,m.cartUrl=location.pathname,m.cartId=d??A.Z.uuidv4(),m.products=[],"rei.com"===e&&(m.cartUrl=location.pathname+location.hash),!i||"amazon.com"!==e&&"walmart.com"!==e&&"jcpenney.com"!==e||(m.productIds=O.ProductIdsGetter[e](i.productIdSkuSelector)),!(i?.cartSelector||(0,x.TF)(i?.productTitleSelector??"")&&(0,x.TF)(c?.details?.productName??""))){const t="no cart selector provided but has product title selector.";return m.cartUrl=location.pathname,this.LogCartExtractionEvent(m,r.R.CartExtractionError,t,r.in.Error,o,S),this.GetProductNamesDirectly(m,e,i,o,a,s,c,h,p,g,S),void this.notifyCartDataListeners()}if(!i||!i.cartSelector||!i.productSelector){const e="Unable to find cart, no cartSelector and no title/name selector provided.";return m.cartUrl=location.pathname,void this.LogCartExtractionEvent(m,r.R.CartExtractionError,e,r.in.Error,o,S)}const f=performance.now();let E;await l.ZP.WaitForCondition((async()=>(E=v.Z.GetFirstVisibleElement(i.cartSelector),void 0!==E)),5e3);const P=performance.now();let T;if(this.GetTimeDiff(f,P),void 0===E){if(this.isEmptyCart(i))return this.logInfo("Empty cart",e,o,S),void this.handleSuccessfulCartExtraction(m,e,o,a,n,s,h,p,g,!0);const t="Unable to find cart";return void this.LogCartExtractionEvent(m,r.R.CartExtractionError,t,r.in.Error,o,S)}if(await l.ZP.WaitForCondition((async()=>(T=E?.querySelectorAll(i.productSelector),void 0!==T&&T.length>0)),"bedbathandbeyond.com"===e?1e4:5e3),"bedbathandbeyond.com"===e||"target.com"===e||"cvs.com"===e){let e;await l.ZP.WaitForCondition((async()=>(e=E?.querySelectorAll(i.productTitleSelector),void 0!==e&&e.length>0&&e.length===T?.length)),1e4),T=E?.querySelectorAll(i.productSelector)}if("walmart.com"===e){const e=this.CollectProductInformationFromCollapsedCart(a,E);m.products.push(...e)}const y=this.GetLastCartData(),D=void 0!==y?.Products?.find((e=>!e.productTitle||""===e.productTitle));if("walmart.com"===e&&(void 0===T||T.length<=0)&&(null==y||null!=y&&D)){const e=E?.querySelectorAll(i.productImageSelector);if(void 0!==e&&e.length>0)for(const t of e){const e=t.getAttribute("alt");if(e){const i=new I.Z;i.productTitle=e.trim(),i.productImg=t?.src??"",m.products.push(i)}}else if(m.products.length<=0){const e="Unable to find products in cart by product image";return void this.LogCartExtractionEvent(m,r.R.CartExtractionError,e,r.in.Error,o,S)}}else if((void 0===T||T.length<=0)&&m.products.length<=0){const e="Unable to find products in cart";return void this.LogCartExtractionEvent(m,r.R.CartExtractionError,e,r.in.Error,o,S)}if(T&&T.length>0)for(const t of T){const n=await this.CollectProductInfo(t,i,c,e,o,C,a.priceDivideByQuantity);if(null!=n)p&&!g&&(n.buyNowItem=!0),m.products.push(n);else{const e="Could not extract product info";this.LogCartExtractionEvent(m,r.R.CartExtractionError,e,r.in.Error,o,S)}}if(this.IsNewCart(m,y))this.handleSuccessfulCartExtraction(m,e,o,a,n,s,h,p,g,!1,S);else{const e="Unneccessary Cart Extraction: Cart is the same as the last cart, not collecting again";this.LogCartExtractionEvent(m,r.R.CartExtractionError,e,r.in.Error,o,S)}}async handleSuccessfulCartExtraction(e,t,i,o,a,r,n,s,c,l,u){this.saveNonAugmentedCart(e);const d=performance.now();try{const i=_.Z.GetAutomaticCartExtractionService();await i.augmentWithWebAssist(e.products,t,k.ZP.traceId,a)}catch(e){this.logInfo("Error augmenting cart with WebAssist",t,i,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,i,u,!1),this.LogCartInfo(e,t,i,o,r,n,s,c,l),this.CheckAndSendCartProcessingRequest(o,e,t).then((()=>this.SetBlockedCouponsRequestPending(!1))).catch((e=>{this.SetBlockedCouponsRequestPending(!1)}))}async saveNonAugmentedCart(e){const t=new a.Vr;t.OrderTotal=e.cartValue,t.CartDataCreationTime=Date.now(),t.CartId=e.cartId,t.ProductIds=e.productIds,t.Products=e.products,t.url=location.pathname,(0,c.Xo)(a.hm,JSON.stringify(t)),this.notifyCartDataListeners()}async CheckAndSendCartProcessingRequest(e,t,i){const o=e?.pageType??r.GV.CheckoutPage;if("amazon.com"!==i&&o===r.GV.CheckoutPage&&t.products.length>0){const e=await this.SendBlockedCouponsRequest(_.Z.GetLocalDataService().GetMuid(),i,t);this.ProcessBlockedCoupons(e)}}async SendBlockedCouponsRequest(e,t,i){if(t&&t.length>0)try{const o=_.Z.GetLocalDataService(),a=new h.Z(p.Z.GetClientName(),m.Kr,void 0,p.Z.enabledServiceFlights,w.R.GetServiceExperiments()),r=this.GetCartModelRequestCoupons(),n={muid:e,domain:t,clientContext:a,cartExtractionId:this.GetLastCartExtractionId(),impressionId:o.GetImpressionId(),coupons:r},s=i.products.filter((e=>e.productTitle&&e.productTitle.length>0)).map((e=>e.productTitle));n.productNames=s.slice(0,10);const c=_.Z.GetClientRequestsService(),l=(await c.SendRequest("cartProcessing","getBlockedCoupons",n)).couponCodes;return{OriginalCoupons:r?.map((e=>e.couponCode))??null,BlockedCoupons:l??null}}catch(e){}return{OriginalCoupons:[],BlockedCoupons:[]}}GetCartModelRequestCoupons(){const e=_.Z.GetLocalDataService();try{const t=_.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)(a.OY,JSON.stringify(t)))}SetBlockedCouponsRequestPending(e){(0,c.Xo)("blockedCouponsRequestPending",e.toString())}GetBlockedCouponsRequestPending(){return"true"===(0,c.Mw)("blockedCouponsRequestPending")}CartProductNameResolution(e,t,i){try{let o=!1;for(const e of t.products)if(void 0===e.productTitle||""===e.productTitle){o=!0;break}if(!o)return{cartInfo:t,message:"products from current cart used"};if(i?.Products){o=!1;for(const e of i.Products)if(void 0===e.productTitle||""===e.productTitle){o=!0;break}if(!o)return t.products=i.Products,{cartInfo:t,message:"products from last cached cart used"}}const a=U.Q?.PersistentCartData,r=((0,b.BQ)(a)??{})[e]??{},n=r?.cartDataStorageInfo??{};if(n?.Products){o=!1;for(const e of n.Products)if(void 0===e.productTitle||""===e.productTitle){o=!0;break}if(!o)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,i);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,i){if(!i?.Products)return null;for(const o of i.Products)if((o.productUrl===e||o.productImg===t)&&o.productTitle&&""!==o.productTitle)return o;return null}CollectProductInfo(e,t,i,o,r,n,s){const u=this.QueryWithAutomatedFallback(e,t.productTitleSelector,i?.details?.productName,o,r),h=e.querySelector(t.productUrlSelector),p=e.querySelector(t.productImageSelector),g=e.querySelector(t.productSellerSelector)||v.Z.GetFirstVisibleElement(t.productSellerSelector);let C=u?.innerText?.trim()||u?.textContent?.trim()||"";const S=R.Z.GetOrderTotalString(t.productPriceSelector,e),m=(0,P.K)(S)??-1,A=d.Z.getQuantity(t.productQuantitySelector,e);let f=g?.innerText?.trim()||g?.textContent?.trim()||"";const E=p?.src??"",T=h?.getAttribute("href")??"";if(f&&l.ZP.IsValidDataField(t.productSellerRegex)&&(f=f.replace(t.productSellerRegex,"")),("walmart.com"===o||"target.com"===o||"jcpenney.com"===o||"bodegaaurrera.com.mx"===o||"kroger.com"===o||n)&&(0,x.TF)(C)){const e=p?.getAttribute("alt");e&&(C=e.trim())}if((0,x.TF)(C)&&(0,x.TF)(T)&&(0,x.TF)(E))return null;let O="";try{let e=JSON.parse((0,c.Mw)(a.D8)||"[]");for(const t of e)if(C.includes(t?.ProductName)){O=t?.ProductBrandName??"",f=f||t?.ProductSellerName||"";break}}catch(e){}const y=new I.Z;return y.productTitle=C,y.productBrand=O,y.productPrice=m,y.productUrl=T,y.productImg=E,y.productQuantity=A,y.productSeller=f,s&&A>1&&(y.productPrice=Number((m/A).toFixed(2))),y}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 i=!0,o=!1;for(let a=0;a<e.products.length;a++){const r=e.products[a];if(-1===t.Products.findIndex((e=>e.productTitle===r.productTitle)))return!0;i=i&&Boolean(r.productUrl),o=o||Boolean(r.productSeller)}let a=!0,r=!0;t.Products.forEach((e=>{a=a&&Boolean(e.productUrl),r=r&&Boolean(e.productSeller)}));const n=o&&!r,s=i&&!a;return!(!w.R.isExperimentActive(g.H.fixCartUpdate)||!n)||s}LogCartInfo(e,t,i,o,n,s,l,u,d,h){let p={OrderTotal:-1,Currency:(0,P.N6)(n)??"",PageCurrency:""};p=N.Z.GetCartValue(o.orderTotalDataElementSelector,n),p.OrderTotal>0||(p=N.Z.TrySimpleGetCartValue(o.orderTotalDataElementSelector,n)),e.cartValue=p.OrderTotal,e.currency=p.Currency;const C=this.GetLastCartData(),S=w.R.isExperimentActive(g.H.fixCartUpdate);if((0,x.TF)(o.orderSubTotalElementSelector)||(e.subTotal=R.Z.GetOrderTotalString(o.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 v=A.Z.uuidv4();if(this.LogCartExtractionEvent(e,r.R.CartExtraction,p,r.in.Information,i,`${v}_${h}`),S&&!this.IsNewCart(e,C))return void this.logInfo("No cart log. fixCartUpdate and not new cart",t,i,h);const I=new a.Vr;if(I.OrderTotal=e.cartValue,I.CartDataCreationTime=Date.now(),I.CartId=e.cartId,I.ProductIds=e.productIds,I.Products=m?g.cartInfo.products:e.products,I.Currency=e.currency??"",e.subTotal&&(I.OrderSubTotal=(0,P.K)(e.subTotal)??-1),(0,c.NN)()||this.LogCartExtractionEvent(e,r.R.CartExtractionError,"No access to local storage",r.in.Error,i,h),l&&void 0!==C?.Products){const t=e.products[0],i=location.pathname;if(!(0,x.TF)(t.productTitle)){let e=!1;for(const o of C.Products)if(o.productQuantity>0&&(0===o.productUrl.indexOf(i)||o.productTitle===t.productTitle)){t.productQuantity&&!isNaN(t.productQuantity)?o.productQuantity=o.productQuantity+t.productQuantity:o.productQuantity=o.productQuantity+1,o.buyNowItem=!u,e=!0;break}if(!e){const e=C.Products;t.buyNowItem=!u,e.push(t),I.Products=e}}}const T=this.CollectGroceryInfo(o);I.CartPreTax=T.preTaxTotal,I.CartEstimatedTax=T.estimatedTax,I.ShipmentDate=T.shipmentDate,I.ExtractionId=v,I.url=location.pathname,(0,c.Xo)(a.OY,JSON.stringify(I));const O=performance.now();this.logInfo(`Writing to local storage, timeTook:  ${this.GetTimeDiff(n,O)}, total: ${I.OrderTotal}`,t,i,h,!1),(0,c.TJ)(a.hm);const y=f.PK[t]?.useCartAtPathname;y&&location.pathname.toLocaleLowerCase().includes(y)&&R.Z.SendStorageMessage(E.Q.PostPurchasePathnameProducts,JSON.stringify({value:I.Products})),s&&this.SendPersistentCartMessage(t,I,i,h)}else{const t="Unable to get enough info about products in cart";this.LogCartExtractionEvent(e,r.R.CartExtractionError,t,r.in.Error,i,h)}}CollectGroceryInfo(e){const t=e.shipmentSelector,i=e.preTaxSelector,o=e.estimatedTaxSelector;let a,r,n;if(l.ZP.IsValidDataField(t)&&l.ZP.IsValidDataField(i)&&l.ZP.IsValidDataField(o))try{a=this.GetShipmentDate(t);const e=R.Z.GetOrderTotalString(i);r=(0,P.K)(e)??-1;const s=R.Z.GetOrderTotalString(o);n=(0,P.K)(s)??-1}catch(e){}return{shipmentDate:a,preTaxTotal:r,estimatedTax:n}}GetShipmentDate(e,t){const i=e.split(","),o=R.Z.GetOrderTotalString(i[0]);if(o)try{const e=R.Z.parseDate(o);return"Invalid Date"===e.toString()?"":e}catch(e){}else if(4===i.length){const e=R.Z.GetOrderTotalString(i[1])?.trim(),t=R.Z.GetOrderTotalString(i[2])?.trim(),o=R.Z.GetOrderTotalString(i[3])?.trim();return new Date(`${e} ${t} ${o}`)}return""}SendPersistentCartMessage(e,t,i,o){try{const i=U.Q?.PersistentCartData??"",o=(0,b.BQ)(i)??{};o[e]={cartDataStorageInfo:t,timestamp:new Date};const a=JSON.stringify({value:JSON.stringify(o)});R.Z.SendStorageMessage("PersistentCartData",a)}catch(e){this.LogCartExtractionEvent(t,r.R.CartExtractionError,"Could not send cart data to storage:  "+e?.message,r.in.Error,i,o)}}SendPersistentTravelCheckoutMessage(e,t,i,o){try{const i=U.Q?.PersistentTravelData??"",o=(0,b.BQ)(i)??{};o[e]={travelDataStorageInfo:t,timestamp:new Date};const a=JSON.stringify({value:JSON.stringify(o)});R.Z.SendStorageMessage("PersistentTravelData",a)}catch(e){this.LogCartExtractionEvent(t,r.R.CartExtractionError,"Could not send travel data to storage:  "+e?.message,r.in.Error,i,o)}}ShouldSendTelemetryData(e){return this.isPersonalizationDataConsentEnabled||e!==r.R.CartExtraction&&e!==r.R.TravelCheckoutExtraction}LogCartExtractionEvent(e,t,i,o,a,n,s){let c={};if(this.ShouldSendTelemetryData(t)&&(c=e),!s){void 0===this.cartExtractionSuccessful&&(t===r.R.CartExtraction?this.cartExtractionSuccessful=!0:this.cartExtractionSuccessful=!1);const e=_.Z.GetLocalDataService(),i=e.GetSessionIds()?.retailerSessionId??"",o=e.GetSessionIds()?.pageVisitId??"";c=F(F({},c),{},{isPersonalizationDataConsentEnabled:this.isPersonalizationDataConsentEnabled,extractionId:n??null,PageVisitId:o,RetailerSessionId:i})}R.Z.SendLogEventMessage(c,t,a,i,o)}logInfo(e,t,i,o,a=!0){try{if(!this.isPersonalizationDataConsentEnabled)return;if(!a&&"True"!==this?.retailerData?.settings?.other?.enableAllCartLogs&&"true"!==this?.retailerData?.settings?.other?.enableAllCartLogs)return;const n=_.Z?.GetLocalDataService(),s=n?.GetSessionIds()?.retailerSessionId??"",c=n?.GetSessionIds()?.pageVisitId??"",l={domain:t||location.hostname,cartUrl:location.pathname,isPersonalizationDataConsentEnabled:this.isPersonalizationDataConsentEnabled,extractionId:o??null,PageVisitId:c,RetailerSessionId:s};R.Z.SendLogEventMessage(l,r.R.CartExtractionError,i,e,r.in.Information)}catch(e){}}CollectProductInformationFromCollapsedCart(e,t){let i;const o=[];i=e.cartSelectors.collapsedCartProductImageSelector?e.cartSelectors.collapsedCartProductImageSelector:"[aria-label='collapsed item list'] img";const a=t?.querySelectorAll(i);if(void 0!==a&&a.length>0)for(const e of a){const t=e.getAttribute("alt");if(t){let i,a;const r=t.match(" quantity \\d+$");r&&r.length>0?(i=t.replace(r[0],""),a=parseInt(r[0].split(" quantity ")[1],10)):(i=t,a=1);const n=new I.Z;n.productTitle=i.trim(),n.productQuantity=a,n.productImg=e?.src??"",o.push(n)}}return o}ShouldAddCartButtonListener(e,t){let i=e?.clickForCartSelector;return i||"walmart.com"!==t||(i="#cart-button-header"),i&&v.Z.GetAllVisibleElements(i).length>0?{shouldAddListener:!0,cartButtonSelector:i}:{shouldAddListener:!1,cartButtonSelector:""}}AddCartButtonListener(e,t,i,o,a,r,n,s,c,u,d,h){const p=v.Z.GetFirstVisibleElement(e);p?.addEventListener("click",(async()=>{l.ZP.WaitForCondition((async()=>{const e=this.GetCartCheckoutPage(i.retailerData.allCheckoutPages);if(e&&e.checkoutPageUrl!==t)return!1;i.retailerData.updateCurrentCheckoutPage(t);const o=i.retailerData.getCurrentCheckoutPage();return!!o?.cartSelectors?.cartSelector&&v.Z.HasVisibleElement(o?.cartSelectors?.cartSelector)}),1e3).then((e=>{if(e){i.retailerData.updateCurrentCheckoutPage(t);const e=i.retailerData.getCurrentCheckoutPage();this.TryCheckAndCollectCartInformation(o,a,e,r,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===r.GV.CheckoutPage||e.pageType===r.GV.NoInputCheckoutPage));return t.length>0?t[0]:null}async CollectCartInfoFromProductPage(e,t,i,o,a,r,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(!v.Z.GetFirstVisibleElement(u.addToCartOverlaySelector))return void(l=!1);if(l)return;l=!0;const h=t.retailerData.getCurrentCheckoutPage();this.TryCheckAndCollectCartInformation(e,i,h,o,a,r,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()=>v.Z.HasVisibleElement(d)),5e3).then((async()=>v.Z.GetFirstVisibleElement(d)));h?.addEventListener("click",(async()=>{const l=t.retailerData.getCurrentCheckoutPage();this.TryCheckAndCollectCartInformation(e,i,l,o,a,r,l?.automatedCartExtractionEnabled,t.isCashbackEstimationSupportedForDomain,n,s,void 0,c)}))}}notifyCartDataListeners(){try{this.onCartExtractionCallback&&this.onCartExtractionCallback()}catch(e){}}}let G;function H(){return G||(G=new Z),G}},61241:function(e,t,i){i.d(t,{Z:function(){return N}});var o=i(72370),a=i(33491),r=i(95457),n=i(4872),s=i(31656),c=i(5144),l=i(29247),u=i(36493),d=i(27689),h=i(93978),p=i(41310),g=i(90066),C=i(82315),S=i(9839),m=i(1094);class A{constructor(){(0,o.Z)(this,"Domain",void 0),(0,o.Z)(this,"ProductName",void 0),(0,o.Z)(this,"ProductSellerName",void 0),(0,o.Z)(this,"ProductBrandName",void 0),(0,o.Z)(this,"ProductCategory",void 0),(0,o.Z)(this,"Url",void 0),(0,o.Z)(this,"PageUrl",void 0),(0,o.Z)(this,"Price",void 0),(0,o.Z)(this,"ImageUrl",void 0),(0,o.Z)(this,"ProductUpc",void 0),(0,o.Z)(this,"ProductAsin",void 0),(0,o.Z)(this,"Currency",void 0),(0,o.Z)(this,"Market",void 0),(0,o.Z)(this,"ProductVariant",void 0),(0,o.Z)(this,"Badges",void 0),(0,o.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 f=A;class v{constructor(){(0,o.Z)(this,"ProductName",void 0),(0,o.Z)(this,"Url",void 0),(0,o.Z)(this,"AggregateRating",void 0),(0,o.Z)(this,"AggregateRatingCount",void 0)}static Create(e){const t=new v;return t.ProductName=e.ProductName,t.Url=e.Url,t.AggregateRating=e.AggregateRating,t.AggregateRatingCount=e.AggregateRatingCount,t}}var E=v;class P{constructor(){(0,o.Z)(this,"ProductName",void 0),(0,o.Z)(this,"Url",void 0),(0,o.Z)(this,"Reviews",void 0)}static Create(e){const t=new P;return t.ProductName=e.ProductName,t.Url=e.Url,t.Reviews=e.Reviews,t}}var I=P,T=i(52056),O=i(54869),y=i(93970),D=class{static CreateVariant(e){return"amazon.com"===e.toLowerCase()?new class{constructor(){(0,o.Z)(this,"pdpUrl","pdp_url"),(0,o.Z)(this,"imageUrl","image_icon_url"),(0,o.Z)(this,"asin","asin"),(0,o.Z)(this,"productVariant","product_variant")}ExtractVariants(){let e="{product_variant: {",t="";const i={};for(let e=0;e<25&&(t="#color_name_"+e,null!=g.Z.GetFirstMatchingElement(t));e++){const o=this.ExtractVariantUrl(t);if(null===o)continue;const a=this.ExtractVariantImageUrl(t);if(null===a)continue;const r=this.ExtractVariantAsin(t);if(null===r)continue;const n=this.ExtractVariantAttribute(t),s={};s[this.pdpUrl]=o,s[this.imageUrl]=a,s[this.asin]=r,"none"!==n[0]&&(s[n[0]]=n[1]),i["variant_"+(e+1)]=s}const o={};return o[this.productVariant]=i,e=JSON.stringify(o),e}ExtractVariantUrl(e){const t=g.Z.GetFirstMatchingElement(e);let i="default-data-url";const o=t?.getAttribute("data-dp-url");return""!==o&&null!=o&&(i=o),"default-data-url"===i||null==i?null:i}ExtractVariantImageUrl(e){const t=e+" .a-button",i=g.Z.GetFirstMatchingElement(t),o=i?.getAttribute("id");if(null==o)return null;const a="#"+o+"-announce > div > div > img",r=g.Z.GetFirstMatchingElement(a),n=r?.src??"";return null==n?null:n}ExtractVariantAsin(e){const t=g.Z.GetFirstMatchingElement(e),i=t?.getAttribute("data-defaultasin");return i}ExtractVariantAttribute(e){const t=g.Z.GetFirstMatchingElement("#variation_color_name > div > label")?.innerText,i=g.Z.GetFirstMatchingElement("#variation_color_name > div > span")?.innerText;return void 0!==t&&void 0!==i&&null!==t&&null!==i?[t,i]:["none","none"]}}:new class{ExtractVariants(){return""}}}},b=i(27900),N=class{constructor(){(0,o.Z)(this,"currentPageUrl",void 0),(0,o.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=O.Z.GetLocalDataService(),t=e.GetCheckoutPageData(),i=e.GetItemLevelCashbackData();t.retailerData.updateCurrentCheckoutPage(m.Z.GetCurrentPathName());const o=t.retailerData.getCurrentCheckoutPage(),a=o?.catalogSelectors,l=t.retailerData.domainName,u=t.impressionId;if(o?.pageType===c.GV.ProductPage){let e=a?.productPriceSelector,i=a?.productImageSelector,o=a?.productTitleSelector,r=a?.productOutOfStockSelector;s.R.isExperimentActive.bind(n.H.pdpSelectorExtraction)&&(e=e??t?.retailerData?.productPriceSelector,i=i??t?.retailerData?.productImageSelector,o=o??t?.retailerData?.productNameSelector,r=r??t?.retailerData?.productOutOfStockSelector),this.ExtractReviews(l,u,a?.reviewSelector,a?.reviewRatingSelector,a?.reviewDateSelector,a?.reviewerNameSelector,a?.productTitleSelector).catch((e=>{})),this.ExtractRatings(l,u,a?.aggregateRatingSelector,a?.aggregateRatingNumberOfRatingsSelector,a?.productTitleSelector).catch((e=>{}));const d=(new Date).getTime();this.ExtractPDPOffer(l,u,e,i,o,a?.productSellerSelector,a?.productBrandSelector,a?.productUPCSelector,a?.productASIN,r,a?.productCategoryListSelector,a?.productBrandRegex,a?.productCategoryRegex).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(y.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(y.EI.DataExtracted,[C.Z.getApiResponse().traceId,JSON.stringify(e)])}))}else if(o?.pageType===c.GV.SearchPage&&i?.domainData){const e=r.Z.Create(i.domainData),t=p.Z.IsSearchPage(this.currentPageUrl,e);t?.searchKey&&this.ExtractSearchProduct(l,u,a?.productTitleSelector,a?.productPriceSelector,t.searchKey)}}async CachePdpOffer(e){try{let t=JSON.parse((0,a.Mw)(b.D8)||"[]");t=t.filter((t=>t.ProductName!==e.ProductName)),e?.ProductName&&t.push(e),t.length>b.xD&&t.shift(),(0,a.Xo)(b.D8,JSON.stringify(t))}catch(e){}}async PostValidation(){}async ExtractReviews(e,t,i,o,a,r,n){if(i){await l.ZP.WaitForCondition((async()=>{if(void 0===i)return!1;const e=g.Z.RunQuerySelectorAll(i);return void 0!==e&&e.length>0}),5e3);try{const s=i?g.Z.RunQuerySelectorAll(i):[],l=o?g.Z.RunQuerySelectorAll(o):[],u=a?g.Z.RunQuerySelectorAll(a):[],d=r?g.Z.RunQuerySelectorAll(r):[],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)),f=new I;f.Reviews=JSON.stringify([C,S,m,A,[this.currentPageUrl.toString().split("?")[0]]]),f.Url=p.toString().split("?")[0],void 0!==h&&(f.ProductName=h),this.LogCatalogExtractionEvent(f,c.R.CatalogExtractionReviews,"",c.in.Information,t)}catch(e){}}}async ExtractRatings(e,t,i,o,a){if(i&&o){await l.ZP.WaitForCondition((async()=>void 0!==i&&void 0!==g.Z.GetFirstVisibleElement(i)),5e3);try{const r=new URL(window.location.href),n=g.Z.GetFirstVisibleElement(i)??void 0,s=g.Z.GetFirstVisibleElement(o)?.innerText,l=a?g.Z.GetFirstVisibleElement(a)?.innerText:"";if(void 0!==n&&void 0!==s){const i=new E;i.AggregateRating=this.GetAggregateRating(n,e),i.AggregateRatingCount=s,i.Url=r.toString().split("?")[0],i.ProductName=l??"",this.LogCatalogExtractionEvent(i,c.R.CatalogExtractionRating,"",c.in.Information,t)}}catch(e){}}}async ExtractPDPOffer(e,t,i,o,a,r,n,s,c,h,p,C,S){const m=new f;if(!i||!o||!a)return m;await l.ZP.WaitForCondition((async()=>{if(void 0===a)return!1;const e=g.Z.GetFirstVisibleElement(a),t=g.Z.GetFirstVisibleElement(i);return void 0!==e&&(!i||void 0!==t)}),5e3);try{const t=new URL(window.location.href),l=g.Z.GetFirstVisibleElement(a)?.innerText,A=g.Z.GetFirstMatchingElement(o),f=A?.src??"",v=g.Z.GetFirstVisibleElement(i)?.innerText;let E="$",P=0,I="",T="USD";const O=(0,d.S8)(),y=D.CreateVariant(O);let b="";const N=y.ExtractVariants();if(null!==N&&(b=N),v&&v.length){E=(0,u.cU)(v),P=(0,u.K)(v);const e=(0,u.Vv)(E);void 0!==e&&(T=e),I=P.toString()}let R,_,k,w,x,U;r&&(R=g.Z.GetFirstVisibleElement(r)?.innerText),n&&(_=g.Z.GetFirstVisibleElement(n)?.innerText),p&&(k=g.Z.GetFirstVisibleElement(p)?.innerText),s&&(w=g.Z.GetFirstVisibleElement(s)?.innerText),c&&(x=g.Z.GetFirstVisibleElement(c)?.innerText),h&&(U=g.Z.GetFirstVisibleElement(h)?.innerText),m.Domain=e,m.Price=I,m.ProductVariant=b,m.ImageUrl=f,m.Url=t.toString().split("?")[0],m.PageUrl=t.toString(),m.ProductName=l??"",m.ProductSellerName=R,m.ProductBrandName=this.applyRegexSelectorToString(C,_)??"",m.ProductCategory=this.applyRegexSelectorToString(S,k)??"",m.ProductAsin=x,m.ProductUpc=w,m.Currency=T,m.OutOfStock=U;const M=[navigator.language],L=this.GetMarket(M,this.GetSupportedMarkets());let B="en-us";if(void 0!==L&&(B=L,"USD"===T)){const e=(0,u.N6)(B);if(void 0!==e){const t=(0,u.Vv)(e);m.Currency=t}}return m.Market=B,m}catch(e){return m}}applyRegexSelectorToString(e,t){if(!e||!t)return t;const i=e?.split(","),o=i?.map((e=>new RegExp(e,"g")));let a=t;return o&&o.forEach((e=>{const i=new RegExp(e,"g");let o;for(;null!==(o=i.exec(t))&&o?.length>1;)a=o[1]})),a}async ExtractSearchProduct(e,t,i,o,a){if(!o||!i||!this.cashBackResponseStr)return;const r=JSON.parse(this.cashBackResponseStr);let n,s;r?.itemizedCashBackResponse?.offers?.length>0&&(n=r?.itemizedCashBackResponse?.offers[0]?.adsOffer?.name,s=r?.itemizedCashBackResponse?.offers[0]?.adsOffer?.price),await l.ZP.WaitForCondition((async()=>void 0!==i&&void 0!==g.Z.GetFirstVisibleElement(i)),5e3);try{const r=g.Z.GetAllVisibleElements(i),l=g.Z.GetAllVisibleElements(o),d=[];if(r&&l){for(let e=0;e<10;e++)if(e<r.length&&e<l.length){const t={ProductTitle:r[e]?.innerText,ProductPrice:(0,u.K)(l[e]?.innerText)??-1};d.push(t)}if(d.length>0&&n&&s){const i={Domain:e,products:d,QueryKeyword:a,currentPageUrl:this.currentPageUrl,spbTitle:n,spbPrice:s};this.LogCatalogExtractionEvent(i,c.R.CatalogExtractionSearchOffers,"",c.in.Information,t)}}}catch(e){}}LogCatalogExtractionEvent(e,t,i,o,a){T.Z.SendLogEventMessage(e,t,a,i,o)}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 i;for(const t of e){if(t.indexOf("-")>=0)return t.toLowerCase();i||(i=t.toLowerCase())}for(const e of t)if(e.startsWith(`${i}-`))return e}}},82270:function(e,t,i){var o=i(72370),a=i(5144),r=i(29247),n=i(1094),s=i(93209),c=i(12953),l=i(87605),u=i(2388),d=i(84901),h=i(90066),p=i(28219),g=i(27689),C=i(11849),S=i(52056),m=i(54869),A=i(44445),f=i(64865);t.Z=class{constructor(){(0,o.Z)(this,"divIDOverlay","#divOverlayWrapper"),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"isCashbackDomain",void 0),(0,o.Z)(this,"checkoutPageUrlData",void 0),(0,o.Z)(this,"exclusiveMarket",void 0),(0,o.Z)(this,"impressionId",void 0),(0,o.Z)(this,"coupons",void 0),(0,o.Z)(this,"fromPlatformDetection",void 0),(0,o.Z)(this,"applyButtonAvailable",!1),(0,o.Z)(this,"textInput",void 0),(0,o.Z)(this,"cartValue",void 0),(0,o.Z)(this,"startTime",void 0),(0,o.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,o.Z)(this,"ApplyHandler",(async()=>{await this.GetCouponAndDiscount(!0)}))}async Init(){this.localDataService=m.Z.GetLocalDataService();const e=this.localDataService.GetCheckoutPageData(),t=e?.cashback;this.isCashbackDomain=t&&(t.isRebatesSupportedDomain??!0);const i=e?.retailerData?.getCurrentCheckoutPage(n.Z.GetCurrentPathName());i?.manualCouponApplyTrackingEnabled&&this.TryListenForCoupon(i,e.coupons,this.localDataService.GetMarket(),this.localDataService.GetImpressionId())}async PostValidation(){}async TryListenForCoupon(e,t,i,o,a){try{r.ZP.IsValidDataField(e.inputBoxSelector)&&r.ZP.IsValidDataField(e.orderTotalDataElementSelector)&&(this.checkoutPageUrlData=e,this.coupons=t??[],this.exclusiveMarket=i,this.impressionId=o,this.fromPlatformDetection=a??!1,this.TrySetUpCouponListener(!1,!1,!0))}catch(e){this.LogError(e?.message)}}async TrySetUpCouponListener(e,t,i){let o=!1;if(o=e?await r.ZP.WaitUntilCondition((async()=>await this.SetUpCouponListener(e)),5e3):await this.SetUpCouponListener(e,t),!o){let e="Unable to add coupon savings listener";i||(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 r.ZP.Sleep(100);return this.startTime=null,await e()}async GetCouponAndDiscount(e){e&&await r.ZP.Sleep(this.checkoutPageUrlData.waitAfterApplyingCurrentCoupon??2e3);const t=this.textInput;if(t){let i=this.GetCartValue();i.OrderTotal===this.cartValue?.OrderTotal&&e&&(await r.ZP.Sleep(2e3),i=this.GetCartValue());let o=-1,a="";this.cartValue?.OrderTotal&&i.OrderTotal&&(o=this.cartValue.OrderTotal-i.OrderTotal,a=o>0?"Positive":"Negative"),this.isAutoApplyOn()||(0,f.TF)(a)||this.LogCouponSavings(t,a,o,this.cartValue?.OrderTotal??-1,i.OrderTotal,i.Currency,i.PageCurrency)}this.Reset(),await this.TrySetUpCouponListener(!0)}Reset(){this.textInput="",this.cartValue=null,this.startTime=null}async isInputBoxAvailable(e){return!!await r.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,i,o,r,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:i,Domain:(0,g.S8)(),FinalPrice:r,PageCurrency:s,PageUrl:(0,g.Ek)(),Result:t,StartingPrice:o,StatusMessage:C.statusMessage,SuccessMessages:C.successMessages,FailureMessages:C.failureMessages,ProviderId:u?.providerId??"",IsPrivateCoupon:u?.isPrivateCoupon??!1,CartExtractionId:m.Z.GetCartExtractionService().GetLastCartExtractionId()},v=this.fromPlatformDetection?"User applied a coupon from platform detection":"User applied a coupon";if(u)(0,f.TF)(u.offerUrl)||this.isCashbackDomain||S.Z.SendNavigateToUrlMessage(u.offerUrl),S.Z.SendLogEventMessage(A,a.R.ManualCouponApplication,this.impressionId,v,a.in.Information);else{const e=new c.Z(p,h,a.M_.ManuallyAppliedCouponNotInOurCorpus,location.pathname,JSON.stringify(A));S.Z.SendLogEventMessage(e,a.R.CollectedCoupons,this.impressionId,v,a.in.Information)}(i>0||u)&&this.SendEngagementTelemetry(a.$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,i){const o=new s.Z(e,u.r.COUPONS_AVAILABLE,(0,g.S8)());S.Z.SendLogEventMessage(o,a.R.ButtonClick,this.impressionId,"User applied a coupon manually",a.in.Information),A.a.postMessageToHost("recordAsUserAction",[t]),A.a.postMessageToHost("recordAsUserEngagement",[i])}LogError(e){const t={Domain:(0,g.S8)(),PageUrl:(0,g.Ek)(),Status:"Error"};S.Z.SendLogEventMessage(t,a.R.ManualCouponApplication,this.impressionId,e??"Error getting coupon savings",a.in.Information)}}},86743:function(e,t,i){i.d(t,{Kv:function(){return p},XB:function(){return d},sy:function(){return h}});var o=i(4872),a=i(31656),r=i(31714),n=i(73557);const s=190624,c=84541440,l=-809239298,u=-9;function d(){try{return!(!a.R.isExperimentActive(o.H.autoOpenControllerMask)||!a.R.isExperimentActive(o.H.autoOpenControllerScript)||h())}catch(e){return!1}}function h(){const[e,t]=g();return e!==l||u!==t}function p(e){let t=!1,i="";if(e>=63)return t=!0,i="64above",{status:t,reason:i};if(e===n.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK)return t=!0,i="activatedGrocery",{status:t,reason:i};if(e===n.sR.AUTO_SHOW_SPB_CASHBACK_LANDING)return t=!0,i="spbPriority",{status:t,reason:i};const[o,a]=g();let r;return r=e<32?o:a,(1<<e&r)==1<<e?(t=!0,i="variantmaskcheck"):i="variantmaskcheckblocked",{status:t,reason:i}}function g(){const e=a.R.getMultipleVariants(o.H.autoOpenControllerMask);if(e&&e.length>0){const t=e.find((e=>e.key===r.vr.FirstMask)),i=e.find((e=>e.key===r.vr.SecondMask));if(t?.value&&i?.value)return[parseInt(t.value,10),parseInt(i.value,10)]}return[s,c]}},3274:function(e,t,i){function o(e,t,i,o){if("CheckoutPageValidation"===t){window.InitializeExposedMethods();try{const t=performance.now();"interactive"===document.readyState||"complete"===document.readyState?window.TryIsAutoApplyValid(e,i,o,t):window.addEventListener&&window.addEventListener("DOMContentLoaded",(a=>{window.CheckAndIsAutoApplyValid(e,i,o,t)})),i++}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?a(e,!0,o):"OnGenericDealsServiceResponse"===t?window.ProcessClientRequestResponse(e):("BackgroundAutoApplyComplete"===t||"PostPurchaseRewardsNotify"===t||"ShouldAnimateOmniboxText"===t)&&a(e,!1,o,t);return i}function a(e,t,i,o){try{if(window.AOCInitializeExposedMethods(),"interactive"===document.readyState||"complete"===document.readyState){const a=performance.now();"BackgroundAutoApplyComplete"===o?window.CanAutoOpenAfterBGAAComplete(i,a,o):"PostPurchaseRewardsNotify"===o?window.CanAutoOpenAfterPostPurchaseRewards(e):"ShouldAnimateOmniboxText"===o?window.CheckAndAnimateTextOnOmnibox(e):t?window.CanAutoOpenAfterPDPData(e):window.CanAutoOpen(e,i,a)}else window.addEventListener&&window.addEventListener("DOMContentLoaded",(o=>{t?window.CheckAndCanAutoOpenAfterPDPData(e):window.CheckAndCanAutoOpen(e,i)}))}catch(e){return!1}}i.d(t,{U:function(){return o},g:function(){return a}})},7355:function(e,t,i){var o=i(72370),a=i(82315),r=i(44922),n=i(54869);t.Z=class{constructor(){(0,o.Z)(this,"retailerData",void 0)}async Init(){this.retailerData=a.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())?r.S.PinterestDeals:r.S.NoPinterestDeals,void e.SendValidationMessage(!1,t,this.retailerData.domainName)}catch(e){}}}},69442:function(e,t,i){var o=i(4872),a=i(31656),r=i(77776),n=i(82315);t.Z=class{Init(){const e=n.Z.getApiResponse();return a.R.isExperimentActive(o.H.showPaymentOptions)&&r.Z.GetAndSendExpressCheckoutPageGMV(e),Promise.resolve()}PostValidation(){return Promise.resolve()}}},15267:function(e,t,i){i.d(t,{AS:function(){return c},Ae:function(){return g},E:function(){return S},IL:function(){return E},Im:function(){return f},RT:function(){return u},Tb:function(){return d},_B:function(){return v},ql:function(){return p},sB:function(){return A},uv:function(){return P},vU:function(){return s}});var o=i(5144),a=i(3634),r=i(45822),n=i(56577);const s=(e,t)=>{const i=e.split(":")[1];return i&&t.includes(i)?d(i,t):""},c=(e,t)=>{try{const i=e.split(":")[1];if(!i)return"";const o=h(t),r=o?.pathname;if(!r)return"";const[n,s]=i.split(a.P5),c=r.split(n)[1];return s?c.split(s)[0]:c}catch(e){return""}},l=(e,t)=>{try{const i=new RegExp(e.toLowerCase());if(i){const e=t.toLowerCase().match(i),o=e?.groups&&e.groups.orderid||"";if(o)return o}}catch(e){}return""},u=(e,t)=>{try{if(!e||!t)return"";const i=l(e,t);if(i)return i;const o=e.replace("\\","\\\\");return l(o,t)}catch(e){return""}},d=(e,t)=>{const i=t.split("?")[1],o=new URLSearchParams(i);for(const t of o.entries())if(t[0].includes(e))return t[1];return null},h=e=>{try{return new URL(e)}catch(e){return}},p=(e,t)=>{const i=e?.split(",")??[];for(let e of i)if(e.startsWith(a.$S)||e.startsWith(a.js)){const i=s(e,t);if(i)return i}else if(e.startsWith(a.m7)){const i=c(e,t);if(i)return i}return""},g=e=>e.startsWith(a.$S)||e.startsWith(a.m7)||e.startsWith(a.js),C=(e,t)=>{try{if(e.length>0&&t)for(const i of e)if(i.urlRegex&&(0,r.io)(t,i.urlRegex).isMatch){if(i.type!==o.u3.PurchaseConfirmed)return i.type===o.u3.Checkout?o.GV.CheckoutPage:o.GV.UnknownPage;{if(!i.validationSelector)return o.GV.ConfirmationPage;if(document.querySelector(i.validationSelector))return o.GV.ConfirmationPage;const e=A(i);if(u(e,t))return o.GV.ConfirmationPage}}return o.GV.UnknownPage}catch(e){return o.GV.UnknownPage}},S=(e,t,i,a,n,s=!0,c=!1)=>{const l=(0,r.dQ)(e,t,n);if(l!==o.GV.UnknownPage)return{pageType:l,errorMessage:""};let u;if(c&&(u=C(i?.allAutomatedSelectors||[],e),u&&u!==o.GV.UnknownPage))return{pageType:u,errorMessage:""};const d=((e,t,i)=>{let a=[];if(e?.orderConfirmationPageUrl){const n=(0,r.io)(t,e.orderConfirmationPageUrl);if(a.push(n.errorMessage),n.isMatch&&(!i?.confirmationPageValidationSelector||m(i.confirmationPageValidationSelector)))return{pageType:o.GV.ConfirmationPage,errorMessage:a.filter((e=>""!==e?.trim())).join("|")}}if(e?.checkoutPageRegex){const i=(0,r.io)(t,e.checkoutPageRegex);if(a.push(i.errorMessage),i.isMatch)return{pageType:o.GV.CheckoutPage,errorMessage:a.filter((e=>""!==e?.trim())).join("|")}}if(e?.checkoutPageUrl){const i=[...e.allCheckoutPages.filter((e=>e.pageType===o.GV.CheckoutPage||e.pageType===o.GV.NoInputCheckoutPage||!e.pageType)).map((e=>e.checkoutPageUrl)),...e.allFinalCheckoutPages.map((e=>e.checkoutPageUrl))].join(","),n=(0,r.io)(t,e.checkoutPageUrl),s=(0,r.io)(t,i);if(a.push(n.errorMessage),a.push(s.errorMessage),n.isMatch&&s.isMatch)return{pageType:o.GV.CheckoutPage,errorMessage:a.filter((e=>""!==e?.trim())).join("|")}}if(e?.productPageUrlRegex){const i=(0,r.io)(t,e.productPageUrlRegex);if(a.push(i.errorMessage),i.isMatch)return{pageType:o.GV.ProductPage,errorMessage:a.filter((e=>""!==e?.trim())).join("|")}}if(e?.productPageUrl){const i=(0,r.io)(t,e.productPageUrl);if(a.push(i.errorMessage),i.isMatch)return{pageType:o.GV.ProductPage,errorMessage:a.filter((e=>""!==e?.trim())).join("|")}}if(e?.searchQueryUrlRegex){const i=(0,r.io)(t,e.searchQueryUrlRegex);if(a.push(i.errorMessage),i.isMatch)return{pageType:o.GV.SearchPage,errorMessage:a.filter((e=>""!==e?.trim())).join("|")}}return{pageType:o.GV.UnknownPage,errorMessage:a.filter((e=>""!==e?.trim())).join("|")}})(i,e,a);return d.pageType!==o.GV.UnknownPage&&d.pageType!==o.GV.HomePage?d:{pageType:s?o.GV.UnknownPage:u??C(i?.allAutomatedSelectors||[],e),errorMessage:d.errorMessage}},m=e=>"DISABLE_COLLECTION"===e||!!document.querySelector(e),A=e=>f(e?.urlFields),f=e=>e?e[n.Fw.OrderId]??"":"",v=(e,t,i,o=!1)=>{if(e&&e.length>0&&t)for(const a of e)if(a.checkoutPageUrl&&(a.pageType===i||!a.pageType&&!o)&&(0,r.io)(t,a.checkoutPageUrl).isMatch)return a},E=(e,t,i,a=!1)=>{try{if(t.length>0&&i){const n=(e=>{switch(e){case o.GV.CheckoutPage:return o.u3.Checkout;case o.GV.ConfirmationPage:return o.u3.PurchaseConfirmed}})(e);for(const e of t)if(e.urlRegex&&(e.type===n||!e.type&&!a)&&(0,r.io)(i,e.urlRegex).isMatch)return e}return}catch(e){return}},P=(e,t)=>(e.split(",")??[]).filter((e=>t?g(e):!g(e))).join(",")},59368:function(e,t,i){i.d(t,{Ox:function(){return r},Pf:function(){return o},kO:function(){return a}});const o=(e,t)=>{if(!e)return"";if(!t)return e;try{const i=new RegExp(t),o=e.match(i);return o?o[1]:e}catch(t){return e}},a=(e,t,i)=>{if(!e||!t||!i)return!1;if(e!==t)return!1;try{const t=new RegExp(i,"u"),o=e.match(t);return!!(o&&o.length>2)}catch(e){return!1}},r=(e,t,i)=>{const o=new RegExp(i,"u"),a=e.match(o);return a&&a.length>2?[a[1].trim(),a[2].trim()]:[e,t]}},68813:function(e,t,i){i.d(t,{Oh:function(){return h},ZQ:function(){return p},tW:function(){return u}});var o=i(4872),a=i(31656),r=i(73557),n=i(65302);let s=function(e){return e.Vulnerable="Vulnerable",e.Campaign="Campaign",e}({});const c=new Map([[s.Vulnerable,o.H.shoppingCohortsVulnerable],[s.Campaign,o.H.shoppingCohortsReclaimed]]);function l(e){if(!a.R.isExperimentActive(e))return[];try{const t=a.R.getMultipleVariants(e);let i=a.R.getVariantStringValue(t,"allowedCohortIds","");return""===i&&(i=a.R.getVariantName(e)||""),""===i?[]:i.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 i of t.cohortsConfig)if(void 0!==i.enabledPopupOriginations&&void 0!==i.cohortId&&e.has(i.cohortId))return i.enabledPopupOriginations}function h(e,t,i){const o=d(t,i);return void 0===o||o.findIndex((t=>t===e))>-1}function p(e,t,i,o){const a=d(t,o);if(void 0===a)return!0;const s=(void 0===i?[]:i).map((e=>(0,n.Pw)(e)||r.sR.AUTO_SHOW_COUPONS_CHECKOUT));0===s.length&&s.push(r.sR.AUTO_SHOW_COUPONS_CHECKOUT);const c=s.every((e=>a.includes(e)));if(!c){const t={pageValidations:i,popupOriginations:s,userSettings:o};e(JSON.stringify(t))}return c}},11849:function(e,t,i){var o=i(29247),a=i(36493),r=i(52056);class n{static async WaitAndGetCartValue(e,t,i){const r=e;let s={OrderTotal:-1,Currency:(0,a.N6)(t)??"$",PageCurrency:""};return o.ZP.IsValidDataField(r)&&(s=await o.ZP.WaitForCondition((async()=>n.GetCartValue(r,t)?.OrderTotal>0),i??1e4).then((()=>n.GetCartValue(r,t))).catch((()=>s))),s}static async WaitAndGetCartValue2(e,t,i){let r={OrderTotal:-1,Currency:(0,a.N6)(t)??"$",PageCurrency:""};return o.ZP.IsValidDataField(e)&&(r=await o.ZP.WaitForCondition((async()=>n.TrySimpleGetCartValue(e,t)?.OrderTotal>0),i??1e4).then((()=>n.TrySimpleGetCartValue(e,t))).catch((()=>r))),r}static TrySimpleGetCartValue(e,t){const i=document.querySelector(e);let o=-1,r=(0,a.N6)(t)??"$";const n=i?.textContent??"";o=(0,a.K)(n,r);const s=(0,a.cU)(n,!0);return r=(0,a.Cl)(s,t),{OrderTotal:o,Currency:r,PageCurrency:s}}static GetCartValue(e,t){let i=-1,o=(0,a.N6)(t)??"$";const n=r.Z.GetOrderTotalString(e);i=(0,a.K)(n)??-1;const s=(0,a.cU)(n,!0);return o=(0,a.Cl)(s,t),{OrderTotal:i,Currency:o,PageCurrency:s}}}t.Z=n},52056:function(e,t,i){var o=i(72370),a=i(64865),r=i(84830),n=i(5144),s=i(39088),c=i(29247),l=i(71544),u=i(27689),d=i(9448),h=i(79249),p=i(90066),g=i(31024),C=i(49206),S=i(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,a.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 i,o="";if(1===t?.length){const a=(new Date).getDate(),r=new Date;if(r.setHours(0,0,0,0),r.setDate(a+1),i=r,o=t[0].trim().split("-")[1],!o)throw new Error(`Unable to parse date: ${e}`)}else if(2===t?.length){const e=t[1].trim(),o=t[0].trim().split(" "),a=o[1].trim(),r=o[0].trim();i=new Date(`${a} ${r} ${e}`)}else if(3===t?.length){if(t[0].toLowerCase().includes("today"))i=new Date,i.setHours(0,0,0,0);else{const e=(new Date).getFullYear(),o=t[1].trim().split(" "),a=o[1].trim(),r=o[0].trim();i=new Date(`${r} ${a}, ${e}`)}if(o=t[2].trim().split("-")[1],!o)throw new Error(`Unable to parse date: ${e}`)}else i=new Date("");if(!o)return i;try{const e=this.parseHour(o);if(Number.isNaN(e))return i;i.setHours(e)}catch(e){}return i}static parseHour(e){let t=+e?.match(/\d{1,2}/i)[0];const i=e?.match(/(A|P)M/i)[0];return"pm"===i.toLowerCase()&&(t+=12),+t}static SendLogEvent(e,t,i,o,a,r,s,c){const l={Currency:a,Domain:c??(0,u.S8)(),EdgeFlyoutStatus:s?.EdgeFlyoutStatus,Metadata:s?.Metadata,PageUrl:(0,u.Ek)(),StartingPrice:o??-1,Status:i};m.SendLogEventMessage(l,r??n.R.CheckoutPageValidation,e,t,n.in.Information)}static SendLogEventMessage(e,t,i,o,a){const n={};n.JsonData=JSON.stringify(e),n.EventType=t,n.LogLevel=a,n.Message=o,n.ClientContext=new r.Z(l.Z.GetClientName(),s.W1,l.Z.GetBuildVersion(),l.Z.enabledServiceFlights),i&&(n.ImpressionId=i);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 ClosePopupOnDocumentBodyClick(e){this.isFullAOCActive&&document.body.addEventListener("click",(function(){C.f.postMessageToHost("dismissPopup",[]),e&&e()}))}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,i,o,a,r){const s={CartId:a,Currency:r?.Currency,Domain:e,PageCurrency:r?.PageCurrency,PageUrl:(0,u.Ek)(),StartingPrice:r?.OrderTotal??-1,Status:o};m.SendLogEventMessage(s,n.R.PurchaseConfirmation,t,i,n.in.Information)}static GetValidationLogMessage(e,t,i){return e?"Checkout Page is Valid":t?"Checkout Page is disabled or does not exist":i?"Checkout Page is Invalid - Invalid Selectors":"Checkout Page is Invalid"}static GetOrderTotalString(e,t){if(!c.ZP.IsValidDataField(e))return"";const i=e.split(",");for(let e=0;e<i.length;e++){const o=i[e];try{const e=m.GetBoxValuePageQueryUtils(o,t);if(e&&e.match(/[0-9]/))return e}catch(t){if(e===i.length-1)return""}}return""}static IsValidPDPUrlHeuristic(e,t=""){return!(0,a.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(";"),i=p.Z.GetFirstVisibleElement(t[0]);let o=i;if(void 0===o)return"";let a=o.innerText;if(1===t.length)o=p.Z.NormalizeIfSuperscripted(i),a=o.innerText;else{const e=p.Z.GetFirstVisibleElement(t[1]);if(e&&e.innerText){const t="."+e.innerText;if(o.contains(e)){const e=o.cloneNode(!0);e.childNodes.forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&e.removeChild(t)})),a=e?.innerText?e.innerText:a}a+=t}}return p.Z.StripInvalidJSONCharacters(a)}}(0,o.Z)(m,"isFullAOCActive",!1),t.Z=m},54869:function(e,t,i){i.d(t,{Z:function(){return Ze}});var o=i(72370),a=i(23825),r=i(55648),n=i(59518),s=i(98574),c=i(74113),l=i(98011),u=i(43263),d=i(20546),h=i(82960),p=i(5144),g=i(29247),C=i(36493),S=i(33491),m=i(27900),A=i(43686),f=i(14440),v=i(52056);function E(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function P(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?E(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var I=i(39088),T=i(71544),O=i(27689),y=i(69315),D=i(90066),b=class{isCancellationPageValid(e){return!(!e.cancellationPageTelemetry?.cancellationPageUrlRegex||""===e.cancellationPageTelemetry.cancellationPageUrlRegex)&&new RegExp(e.cancellationPageTelemetry.cancellationPageUrlRegex,"i").test((0,O.Ek)())}GetAndSendCancellationPageData(e,t){let i="";e?.cancellationPageTelemetry?.transactionIdSelector&&""!==e?.cancellationPageTelemetry?.transactionIdSelector&&(i=v.Z.GetBoxValue(e.cancellationPageTelemetry.transactionIdSelector));let o="";e?.cancellationPageTelemetry?.totalPriceSelector&&""!==e?.cancellationPageTelemetry?.totalPriceSelector&&(o=v.Z.GetBoxValue(e.cancellationPageTelemetry.totalPriceSelector));let a="";e?.cancellationPageTelemetry?.cancellationTextSelector&&""!==e?.cancellationPageTelemetry?.cancellationTextSelector&&(a=v.Z.GetBoxValue(e.cancellationPageTelemetry.cancellationTextSelector));let r="",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&&(r+=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,O.Ek)(),Domain:(0,O.S8)(),TransactionId:i,CancellationPageText:a,ProductNames:r,QuantityPerItem:n,PricePerItem:s,TotalPrice:o},l={};l.JsonData=JSON.stringify(c),l.EventType="CancellationPageDetails",l.LogLevel="Information",l.Message="Cancellation Page Details",l.ClientContext={AppInfoClientName:T.Z.GetClientName(),JSVersion:I.yJ},t&&(l.ImpressionId=t);const u=[JSON.stringify(l)];y.R.postMessageToHost("LogScriptTelemetry",u)}},N=i(7664),R=i(61241),_=i(49206),k=i(77594),w=i(82270),x=i(91495),U=i(9839),M=i(45822),L=i(11501),B=i(41368),F=class{constructor(){(0,o.Z)(this,"IsBatBeaconFound",!1),(0,o.Z)(this,"personalDataRemover",void 0),(0,o.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,i){if((0,M.$1)())return p.GV.UnknownPage;const o=(0,M.dQ)(t,i,e?.aFDMarket??"");if(o!==p.GV.UnknownPage)return o;const a=(0,M.p_)(e?.retailerData,t);return a!==p.GV.UnknownPage&&a!==p.GV.HomePage?a:(0,M.I2)(e?.retailerData?.allAutomatedSelectors||[],t)}IsCollectionAllowed(e){return"en-us"!==e||this.isPrivacyBadgeShown()}isPrivacyBadgeShown(){return!!x.Q?.PrivacyBadgeViewCount&&parseInt(x.Q.PrivacyBadgeViewCount,10)>=2}CollectFragment(e){const t=(0,M.P4)();if((e.retailerData?.isAOCFragmentCollectionEnabled||t)&&(0,O.Ek)()?.startsWith("https:")&&this.IsCollectionAllowed(e?.aFDMarket)){const i=(0,O.Ek)(),o=t?"1":e.retailerData?.aOCFragmentCollectionRate??"0",a=Math.random();if(o&&a<parseFloat(o)){const t=e.retailerData?.domainName??(0,O.S8)(),a=this.GetPageType(e,i,t),r=(0,M.nY)(),n=!r||r&&(0,M.Ak)(a),s=Ze.GetLocalDataService(),c=s.GetSessionIds()?.retailerSessionId??"",l=s.GetSessionIds()?.pageVisitId??"";this.personalDataRemover=B.Z.getFactory().getPersonalDataRemover();const u=this.personalDataRemover.getPiiRemovalSelector(e.retailerData,a,(0,O.Ek)());if(n){const i=new L.Z(e?.retailerData?.settings).GetFragmentCollectionTimeout(a)??0;"complete"===document.readyState?setTimeout((async()=>{this.sendHtmlFragment(t,"",o,a,e?.impressionId??"",c,l,"",!1,u)}),i):document.onreadystatechange=()=>{"complete"===document.readyState&&setTimeout((async()=>{this.sendHtmlFragment(t,"",o,a,e?.impressionId??"",c,l,"",!1,u)}),i)}}}}}async CollectFragmentOnConfirmationPage(e,t,i,o=!0){try{const a=(0,M.P4)();if(!this.IsCollectionAllowed(t)&&!a)return;const r=p.GV.ConfirmationPage,n=(0,O.Ek)(),s=new L.Z(e?.retailerData?.settings),c=a?1:s.GetCollectionRate(n,r,o)??0;if(c>0&&Math.random()>=c)return;const l=Ze.GetLocalDataService(),u=l.GetSessionIds()?.retailerSessionId??"",d=l.GetSessionIds()?.pageVisitId??"",h=e?.retailerData?.domainName??"",g=e?.retailerData?.confirmationPageTelemetry?.piiRemovalSelector??"";this.sendHtmlFragment(h,"",`${c}`,r,e.impressionId,u,d,i,!0,g)}catch(e){}}async sendHtmlFragment(e,t,i,o,a,r,n,s="",c=!1,l=""){let u=-1,d=null;if(c){d=this.cloneNodeWithPlaceholders(document.documentElement,!1,performance.now());const t=performance.now();this.MaskPiiData(d,e),u=performance.now()-t}else{const e=performance.now();d=this.cloneNodeWithPlaceholders(document.documentElement,!1,performance.now()),this.IsBatBeaconFound=!1,u=performance.now()-e}const h={Domain:e,TimeToMask:u.toString(),PageType:o,PageUrl:(0,O.Ek)(),EncryptionKey:"",HtmlFragment:"",aOCFragmentCollectionRate:i,RetailerSessionId:r,PageVisitId:n,isConfirmationPage:`${c}`};if(!d)return;if(this.personalDataRemover=B.Z.getFactory().getPersonalDataRemover(),this.personalDataRemover.maskDataInADocumentBySelector(d,l),t){const e=await this.getSymmetricEncryptionKey(),i=await this.encryptData(e,d.outerHTML),o=await this.encryptSymmetricKey(t,e);h.EncryptionKey=o,h.HtmlFragment=i}else h.HtmlFragment=btoa(encodeURIComponent(d.outerHTML));if(!h.HtmlFragment)return;let g=c?"[Confirmation] Html Fragment collection":"[AOC] Html Fragment collection";s&&(g=`${g}; ${s}`),c?this.sendConfirmationPageLog(h,g):U.Q.sendLogEventMessageV2(h,p.R.HtmlFragment,a,g,p.in.Information)}sendConfirmationPageLog(e,t,i=!1){const o={};o.JsonData=JSON.stringify(e),o.EventType="HtmlFragment",o.LogLevel=i?"Error":"Information",o.Message=t,o.ClientContext={AppInfoClientName:T.Z.GetClientName(),JSVersion:I.yJ};const a=[JSON.stringify(o)];y.R.postMessageToHost("LogScriptTelemetryV2",a)}MaskPiiData(e,t){const i=e?.getElementsByTagName("*"),o=new Set(["script"]),a=performance.now();try{for(let e=0;e<=i?.length;e++){let r=!1;const n=performance.now();if(n-a>3e5)return void this.sendConfirmationPageHtmlFragmentLogError(window.location.pathname,t,"Masking timeout",(n-a).toString());if(void 0!==i[e]&&null!==i[e]&&null!==i[e].textContent){if("yes"===i[e].getAttribute("data-processed"))continue;(o.has(i[e].tagName?.toLowerCase())||this.DISALLOWED_NAMES.has(i[e].getAttribute("name")))&&(this.maskTextNodes(i[e]),r=!0);const t=i[e].getAttributeNames();for(const o of t)for(const t of this.DISALLOWED_NAMES)if(i[e].getAttribute(o)?.toLowerCase()?.includes(t)){r||(this.maskTextNodes(i[e]),r=!0),i[e].setAttribute("value","****");break}i[e].setAttribute("data-processed","yes")}}}catch(e){this.sendConfirmationPageHtmlFragmentLogError(window.location.pathname,t,"Masking error: "+e,(performance.now()-a).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,i){const o=new URL(window.location.toString());if(performance.now()-i>12e4)return null;if("SCRIPT"===e.tagName?.toLocaleUpperCase())return null;if(e.nodeType===Node.TEXT_NODE){const i=e.cloneNode(!1);return t&&(i.textContent="*****"),i}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 a=!1;const r=e.getAttributeNames();for(const t of r){if(this.DISALLOWED_NAMES.has(t.toLowerCase())){a=!0;break}for(const i of this.DISALLOWED_NAMES)if(e.getAttribute(t)?.toLowerCase()?.includes(i)){a=!0;break}if(a)break}["src","href"].forEach((i=>{this.convertToAbsoluteUrl(e,t,i,o)}));for(const o of e.childNodes){const e=this.cloneNodeWithPlaceholders(o,a,i);e&&t.appendChild(e)}return t}return null}convertToAbsoluteUrl(e,t,i,o){const a=e.getAttribute(i);if(a&&!a.startsWith("http")&&!a.startsWith("//")){const e=new URL(a,o).toString();t.setAttribute(i,e)}}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),i=t.length,o=new Uint8Array(i);for(let e=0;e<i;e++)o[e]=t.charCodeAt(e);return o.buffer}concatArrayBuffers(e,t){const i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer}async encryptData(e,t){const i=(new TextEncoder).encode(t),o=await window.crypto.subtle.importKey("raw",this.base64ToBuffer(e),"AES-GCM",!0,["encrypt","decrypt"]),a=window.crypto.getRandomValues(new Uint8Array(12)),r={iv:a,name:"AES-GCM"},n=await window.crypto.subtle.encrypt(r,o,i),s=this.concatArrayBuffers(a.buffer,n);return this.bufferToBase64(s)}async encryptSymmetricKey(e,t){const i=await crypto.subtle.importKey("spki",this.base64ToBuffer(e),{name:"RSA-OAEP",hash:{name:"SHA-256"}},!1,["encrypt"]),o=await crypto.subtle.encrypt({name:"RSA-OAEP"},i,(new TextEncoder).encode(t));return this.bufferToBase64(o)}sendConfirmationPageHtmlFragmentLogError(e,t,i,o){const a={Domain:t,EncryptionKey:"",HtmlFragment:"",OrderConfirmationPageUrl:e,TimeToMask:o};this.sendConfirmationPageLog(a,i,!0)}},Z=i(11050),G=i(73557),H=i(55590),V=i(8018),W=i(50607),K=i(12714);class z extends K.Z{constructor(...e){super(...e),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"validationMessageService",void 0),(0,o.Z)(this,"cashBackResponse",void 0)}async Init(){this.localDataService=Ze.GetLocalDataService(),this.validationMessageService=Ze.GetValidationMessageService()}GetPopupOriginationList(){return[G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING,G.sR.AUTO_SHOW_SPB_CASHBACK_LANDING]}CanAutoOpen(){const e=this.localDataService.GetCheckoutPageData(),t=e?.retailerData?.domainName||"";if(!this.cashBackResponse)return!1;const{shouldShow:i}=this.ProcessPDPResponse(this.cashBackResponse,t);return i}async CanAutoOpenForFeature(e,t){const i=this.localDataService.GetCheckoutPageData(),o=i?.retailerData?.domainName||"";if(!this.cashBackResponse)return!1;const{isSpb:a,shouldShow:r}=this.ProcessPDPResponse(this.cashBackResponse,o);switch(e){case G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING:return r&&!a;case G.sR.AUTO_SHOW_SPB_CASHBACK_LANDING:return r&&a}return!1}async PostValidation(){}SetCashbackResponse(e){this.cashBackResponse=e}ProcessPDPResponse(e,t){let i=!1;try{const a=Ze.GetLocalDataService().GetSubmittedIds()||[],r=this.localDataService.GetIsClippingSent(),n=this.localDataService.GetUserInfo(),s=this.localDataService.GetImpressionId(),c=x.Q?.ICIsPendingTransactionPresent??!1;if(e.offersType===Z.h.Quotient&&c)return(0,W.LT)(e,n,s,"Pending transaction is present"),{shouldShow:!1,isSpb:i};let l=!1,u=V.c.PDP;if(e.offersType===Z.h.Quotient){l=(0,W.mg)(e,t,a,[],r);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,o.Z)(this,"RelatedOffer",void 0),(0,o.Z)(this,"RelatedOfferShownURL",void 0),this.RelatedOffer=e,this.RelatedOfferShownURL=t}}(p,(0,O.Ek)());this.validationMessageService.SendStringStorageMessage(H.Q.ICRelatedPDPOffer,JSON.stringify(e))}if(!l)return{shouldShow:!1,isSpb:i};u=V.c.PDP,(0,W.iQ)(e,n,s)}else if(e.offersType===Z.h.SPB){if(i=!0,l=(0,W.WL)(e),!l)return{shouldShow:!1,isSpb:i};u=V.c.PdpSPB,(0,W.jV)(e,n,s)}const d={};return d.cashbackData=e,d.currentUrl=(0,O.Ek)(),d.type=u,d.pageTitle=(0,O.AL)(),this.validationMessageService.SendStringStorageMessage(H.Q.ICCurrentPageInfo,JSON.stringify(d)),this.localDataService.SetICNotificationType(u),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,u),{shouldShow:!0,isSpb:i}}catch(t){(0,W.LT)(e,void 0,this.localDataService.GetImpressionId(),"Unknown error",!0)}return{shouldShow:!1,isSpb:i}}}var Q=z,j=i(3634),Y=i(4872),J=i(31656),X=i(18491),q=i(47746),$=class{constructor(e){(0,o.Z)(this,"ShownOffers",void 0),(0,o.Z)(this,"ImpressionId",void 0),e?(this.ShownOffers=e.ShownOffers??[],this.ImpressionId=e.ImpressionId):(this.ShownOffers=[],this.ImpressionId="")}},ee=i(9448),te=i(41310),ie=i(57550),oe=i(82315),ae=i(1094),re=i(93209),ne=i(2388);class se extends K.Z{constructor(...e){super(...e),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"validationMessageService",void 0),(0,o.Z)(this,"cashBackResponseStr","")}async Init(){this.localDataService=Ze.GetLocalDataService(),this.validationMessageService=Ze.GetValidationMessageService()}async PostValidation(){}GetPopupOriginationList(){return[G.sR.AUTO_SHOW_SPB_CASHBACK_LANDING,G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING]}async CanAutoOpenForFeature(e){const{isSpbNotification:t,shouldSendMessage:i}=this.ProcessCashBackResponse(this.cashBackResponseStr);return e===G.sR.AUTO_SHOW_SPB_CASHBACK_LANDING?i&&t:e===G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING&&i&&!t}async CanAutoOpen(){const{shouldSendMessage:e}=this.ProcessCashBackResponse(this.cashBackResponseStr);if(e&&J.R.isExperimentActive(Y.H.closeOnClickAnywhere)){const t=this.localDataService;function i(){const e=new re.Z("SPB search close on click anywhere",ne.r.ITEMIZED_CASHBACK),i=t.GetImpressionId();v.Z.SendLogEventMessage(e,p.R.ButtonClick,i,"Cashback notification button click",p.in.Information)}v.Z.ClosePopupOnDocumentBodyClick(i)}return e}SetCashbackResponseStr(e){this.cashBackResponseStr=e}ProcessCashBackResponse(e){let t=!1,i=!1,o=!1;const a={sentTimeMs:this.localDataService.GetSearchApiRequestSentTimestamp(),receivedTimeMs:(new Date).getTime()};this.localDataService.SetSearchApiRequestSentTimestamp(0);try{if(e){const r=JSON.parse(e);let n=this.localDataService.GetICNotificationType();if(this.HasCashbackOffers(r)){const e=this.GetOffersType(r)===Z.h.Quotient,s=this.localDataService.GetDomainName(),c={};c.query=this.localDataService.GetData("query");let l="";if(e){const e=this.GetQtShouldShow(r,s);e.categoryName&&(c.categoryName=e.categoryName),e.addressBarTemplate&&(l=e.addressBarTemplate),e.notificationType&&e.shouldSendMessage&&(n=e.notificationType,i=e.shouldSendMessage)}else{const e=this.GetSpbShouldShow(r,s);e.notificationType&&e.shouldSendMessage&&(n=e.notificationType,i=e.shouldSendMessage,o=!0)}if(c.cashbackData=r,c.currentUrl=(0,O.Ek)(),c.type=n,c.latencyData=a,J.R.isExperimentActive(Y.H.spbCheckoutAutoActivation)&&"amazon.com"===s&&this.IsCheckoutPage()){const e=new CustomEvent(j.fU,{detail:{jsonResponse:c}});window.dispatchEvent(e),i=!1,o=!1}this.validationMessageService.SendStringStorageMessage(H.Q.ICCurrentPageInfo,JSON.stringify(c)),this.validationMessageService.SendMessage(ee.H.UpdateAddressBar,[JSON.stringify({type:l})]),t=!0,this.validationMessageService.SendMessage(ee.H.UpdateLoadTimeData,[this.localDataService.GetTraceId()])}}}catch(e){}return t||this.validationMessageService.SendStringStorageMessage(H.Q.ICCurrentPageInfo,""),{shouldSendMessage:i,isSpbNotification:o}}LogSPBTelemetry(e,t,i,o={}){const a=this.localDataService.GetImpressionId(),r=this.localDataService.GetUserInfo();te.Z.LogSPBTelemetry(e,t,i,r,a,o)}GetSecondsSince(e){return(Date.now()-e)/1e3}IsCheckoutPage(){const e=oe.Z.getApiResponse(),t=ae.Z.CreateCheckoutPageData(e).retailerData.getCurrentCheckoutPage(location.pathname);return t&&t.pageType===p.GV.CheckoutPage}GetQtShouldShow(e,t){let i,a=!1,r="",n="";const s=this.GetActivatedOfferIds(t),c=this.GetShownOffers(t),l=this.GetSubmittedOffersSet(),u=e.itemizedCashBackResponse.queryType;if(u===X.x.Search){const t=q.Z.CreateFromUAPIList(e.itemizedCashBackResponse.offers);r="SearchGeneric",this.ShouldAutoshow(e)&&this.ContainsOffersNotShownNonActivatedNotSubmitted(t,c,s,l)&&(this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.Search),a=!0,i=V.c.Search)}else if(u===X.x.Category){const s=q.Z.CreateFromUAPIList(e.itemizedCashBackResponse.offers);r="CategoryGeneric",s[0].cashbackProducts&&s[0].cashbackProducts.length>0&&(n=s[0].cashbackProducts[0].displayCategory);const c=te.Z.GetTotalCashback(s),l=this.localDataService.GetData("categoryCooldown");if(l&&c&&c>0){const e=x.Q.GroceryCategoryAutoShowData?(0,O.BQ)(x.Q.GroceryCategoryAutoShowData):new class{constructor(){(0,o.Z)(this,"AutoShowTimestampsMap",void 0),this.AutoShowTimestampsMap={}}},r=e.AutoShowTimestampsMap;(!r[t]||this.GetSecondsSince(r[t])>Number(l))&&(e.AutoShowTimestampsMap[t]=Date.now(),this.validationMessageService.SendStringStorageMessage(H.Q.GroceryCategoryAutoShowData,JSON.stringify(e)),this.localDataService.SetICNotificationType(V.c.CategoryAutoshow),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.CategoryAutoshow),a=!0,i=V.c.CategoryAutoshow)}}else if(u===X.x.Offers){const o=x.Q.GroceryCashbackActivated;let r={};o&&(r=(0,O.BQ)(x.Q.GroceryCashbackActivated)),(!r[t]||r[t]&&!r[t].fullItems)&&(r[t]={fullItems:{}});const n=q.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(r[t].fullItems).forEach((e=>{const i=r[t].fullItems[e],o=i.id;s[o]=i})),r[t].fullItems=s;let c=0;const l=[];Object.keys(s).forEach((e=>{const t=s[e],i=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+=i})),this.validationMessageService.SendStringStorageMessage(H.Q.ICActivatedCashbackTotal,c.toFixed(2)),this.validationMessageService.SendStringStorageMessage(H.Q.ICActivatedCashbackImages,JSON.stringify({images:l})),this.validationMessageService.SendStringStorageMessage(H.Q.GroceryCashbackActivated,JSON.stringify(r)),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.ActivatedOffers),this.validationMessageService.SendBoolStorageMessage(H.Q.ICActivationMigrationPending,!0),a=!0,i=V.c.ActivatedOffers}return{shouldSendMessage:a,notificationType:i,addressBarTemplate:r,categoryName:n}}GetSpbShouldShow(e,t){let i,o=!1;if(J.R.isExperimentActive(Y.H.disableSPBNotification))return this.LogSPBTelemetry(p.xu.ICSPBOffersNoShow,"SPB notification disabled by experiment disableSPBNotification",e),{notificationType:i,shouldSendMessage:o};const a=(0,ie.Sq)(e);let r=a.find((e=>e.source===Z.h.SPB));if(e?.itemizedCashBackResponse?.offersType!==Z.h.SPB||r||(r=a.length>0?a[0]:void 0),r){const t=e?.itemizedCashBackResponse?.shouldAutoshow??!1,n=this.localDataService.GetPersonalizedAdsResponse(),s=(0,ie.rP)(a,n),c=(0,ie.wu)(e),l=this.containsOfferToAutoShow(a);r.visibilityFeedbackUrlBase=c,t&&l&&s?.length>0?(this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.SearchSPB),this.localDataService.SetICNotificationType(V.c.SearchSPB),o=!0,i=V.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:i,shouldSendMessage:o}}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,i,o){let a=!1;const r=this.localDataService.GetDomainName(),n=this.localDataService.GetData("variations"),s=n?JSON.parse(n):{},c=!!s.searchIgnoreAlreadyShown&&"enabled"===s.searchIgnoreAlreadyShown;try{let n="";for(const r of e)if((c||!t.has(r.id))&&!i.has(r.id)&&!o.has(r.id)){a=!0,n=r.id;break}if(a){t.add(n);const e={},i=new $(void 0);i.ShownOffers=Array.from(t),i.ImpressionId=this.localDataService.GetImpressionId(),e[r]=i,this.validationMessageService.SendStringStorageMessage(H.Q.ICAutoShownOffers,JSON.stringify(e))}}catch(e){a=!1}return a}GetActivatedOfferIds(e){const t=x.Q?.GroceryCashbackActivated,i=((0,O.BQ)(t)??{})[e]??void 0;return i?.fullItems?new Set(Object.keys(i.fullItems)):new Set}GetShownOffers(e){const t=(0,O.BQ)(x.Q?.ICAutoShownOffers)??{},i=this.localDataService.GetImpressionId();t&&t[e]&&t[e].ImpressionId!==i&&delete t[e];const o=new $(t[e]).ShownOffers;return new Set(o)}}var ce=se,le=i(41865),ue=i(95457),de=i(47594),he=i(21488),pe=class{constructor(){(0,o.Z)(this,"AutoShowEventsMap",void 0),(0,o.Z)(this,"ActiveAutoShowType",void 0),(0,o.Z)(this,"TotalCashbackAmount",0),this.AutoShowEventsMap={},this.ActiveAutoShowType=null}};class ge extends K.Z{constructor(...e){super(...e),(0,o.Z)(this,"localDataService",void 0),(0,o.Z)(this,"validationMessageService",void 0),(0,o.Z)(this,"domainData",void 0),(0,o.Z)(this,"apiResponse",void 0)}async Init(){this.apiResponse=oe.Z.getApiResponse(),this.localDataService=Ze.GetLocalDataService(),this.validationMessageService=Ze.GetValidationMessageService();const e=le.Z.Create(this.apiResponse),t=he.Z.Create(this.apiResponse);this.domainData=ue.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 i=x.Q?.ICIsPendingTransactionPresent??!1;this.localDataService.SetIsPendingTransactionPresent(i),this.apiResponse?.itemLevelCashBack?.isCashBackEnabled&&this.localDataService.SetItemLevelCashbackData(this.apiResponse.itemLevelCashBack)}CanAutoOpen(e){const t=this.localDataService.GetItemLevelCashbackData();if(!t?.isCashBackEnabled)return!1;let i=this.ValidateGroceryCashback(e);if(i)if(this.localDataService.GetICNotificationType()===V.c.Search||this.localDataService.GetICNotificationType()===V.c.Category||this.localDataService.GetICNotificationType()===V.c.ActivatedOffers){let e=!1;const t=this.apiResponse.retailerData.getCurrentCheckoutPage();if(t){const o=ae.Z.GetInitialFields(this.apiResponse);(t?.orderTotalDataElementSelector||o.length>0)&&(e=!0,i=!1)}if(!e)return!1}else this.localDataService.GetICNotificationType()!==V.c.GroceryAutoShow&&this.localDataService.GetICNotificationType()!==V.c.AddedToCartPDP||te.Z.IsVariationString(this.localDataService,`gcbAutoshow-${this.localDataService.GetICNotificationType()}`,"disabled")&&(v.Z.SendStringStorageMessage(H.Q.ICNotificationType,""),i=!1);return i}PostValidation(){return Promise.resolve()}GetPopupOriginationList(){return[G.sR.AUTO_SHOW_SPB_CASHBACK_LANDING,G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING,G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK]}async CanAutoOpenForFeature(e){const t=this.localDataService.GetItemLevelCashbackData();if(!t?.isCashBackEnabled)return Promise.resolve(!1);const i=this.ValidateGroceryCashback(),o=this.localDataService.GetICNotificationType();switch(e){case G.sR.AUTO_SHOW_SPB_CASHBACK_LANDING:return!1;case G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING:return i&&(o===V.c.GroceryAutoShow||o===V.c.AddedToCartPDP);case G.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK:return Boolean(i&&o===V.c.Activated&&x.Q?.GroceryCashbackItem)}return!1}IsSearchPage(e,t){const i={isSerp:!1,searchKey:""};if(t&&t.SearchData){const o=te.Z.IsUrlMatchAll(e,t.SearchData);i.isSerp=o.isMatch,i.searchKey=o.matchKey}return i}IsCategoryPage(e,t){const i={isCategory:!1,categoryId:""};if(t&&t.CategoryData){const o=te.Z.IsUrlMatchAll(e,t.CategoryData);i.isCategory=o.isMatch,i.categoryId=o.matchKey}return i}SendGetCashbackMessage(e,t,i,o){const a=[];i===X.x.Search?a.push({keyword:t}):i===X.x.Category?a.push({category:t}):i===X.x.Offers&&t.split(",").forEach((e=>{a.push({offerId:e})}));const r=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:r.ageGroup,clientContext:o,consentCanPrompt:u,domainName:e,isAADSignedIn:r.isAADSignedIn,isAnonymousFlowEnabled:r.isAnonymousFlowEnabled,isPendingTransaction:d,isEdgeProfileRebatesUser:l,isOffTheRecord:n.isOffTheRecord,isPersonalizationDataConsentChanged:r.isPersonalizationDataConsentChanged,isPersonalizationDataConsentEnabled:r.isPersonalizationDataConsentEnabled,isPersonalizationDataConsentEnabledV2:c,isRebatesEnabled:s,isRebatesUser:r.isRebatesUser,jsVersion:I.W1,pageUrl:(0,O.Ek)(),queries:a,queryType:i};this.localDataService.SetSearchApiRequestSentTimestamp((new Date).getTime()),this.validationMessageService.SendMessage(ee.H.GetCashBack,[JSON.stringify(h)])}ValidateGroceryCashback(e){try{const t=new URL((0,O.Ek)()),i=this.localDataService.GetItemLevelCashbackData(),o=this.localDataService.GetCheckoutPageData(),a=this.localDataService.GetClientInfo(),r=this.localDataService.GetUserInfo(),n=this.domainData;if(this.validationMessageService.SendStringStorageMessage(H.Q.ICCurrentPageInfo,""),!this.IsAddedToCartPage(t,n)&&x.Q.ICRelatedPDPOffer){const e=JSON.parse(x.Q.ICRelatedPDPOffer),i=new URL(e.RelatedOfferShownURL);t&&i&&t.hostname===i.hostname&&t.pathname===i.pathname||this.validationMessageService.SendStringStorageMessage(H.Q.ICRelatedPDPOffer,"")}if(this.HandleActivatedAutoNotification()){const e=x.Q?.GroceryInstantAddToCart;return!e}const s=o?.retailerData?.domainName??"",c={appName:T.Z.GetClientName(),buildVersion:a.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(V.c.GroceryAutoShow);const e=x.Q?.GroceryAutoShowData?(0,O.BQ)(x.Q.GroceryAutoShowData):new pe;return e.ActiveAutoShowType="ShowCashbackOffers",this.validationMessageService.SendStringStorageMessage(H.Q.GroceryAutoShowData,JSON.stringify(e)),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.GroceryAutoShow),!0}if(i.isSearchEnabled){const o=this.IsApplicableForSearchAndCategoryScenario(e),a=this.IsSearchPage(t,n);if(a.isSerp&&o&&this.HandleSearchPage(a.searchKey,s,c))return!0;const l=this.IsCategoryPage(t,n);if(l.isCategory&&o&&this.HandleCategoryPage(l.categoryId,s,c,n.categoryAutoShowCooldownInSeconds))return!0;if(r.isRebatesUser){const e=this.IsCustomAutoShowPage(t,n);if(e.isMatch&&this.HandleCustomAutoShowPage(s,e.autoShowType,e.cooldownInSeconds,i))return!0}}if(this.IsAddedToCartPage(t,n)&&x.Q.ICRelatedPDPOffer)return this.localDataService.SetICNotificationType(V.c.AddedToCartPDP),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.AddedToCartPDP),!0;if(o?.retailerData?.getCurrentCheckoutPage()?.pageType===p.GV.HomePage){J.R.isExperimentActive(Y.H.contextualCashback)&&this.HandleHomePage(s,c);const e=i.spbHomePageOffers,t=e?.find((e=>e.shouldAutoshow&&e.offersType===Z.h.SPB&&e.offers?.length>0));if(e&&t){const e=x.Q.ICSpbHomePageShownTimestamp||"0",t=Number(e),i=isNaN(t)?0:t,o=(new Date).getTime(),a=o-i,r=216e5;if(J.R.isTestFlagActive(de.t.msShoppingTestExp11)||0===i||a>r)return this.localDataService.SetICNotificationType(V.c.SpbHomePage),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.SpbHomePage),this.validationMessageService.SendStringStorageMessage(H.Q.ICSpbHomePageShownTimestamp,`${o}`),!0}}}catch(e){return!1}return!1}IsAddedToCartPage(e,t){return!!(t&&t.AddedToCartData&&te.Z.IsUrlMatchAll(e,t.AddedToCartData).isMatch)}IsApplicableForSearchAndCategoryScenario(e){return!e||e==G.sR.AUTO_SHOW_SPB_CASHBACK_LANDING}IsCustomAutoShowPage(e,t){const i={isMatch:!1,autoShowType:"",cooldownInSeconds:0};if(t&&t.CustomAutoShowData)for(const o of t.CustomAutoShowData){const t=te.Z.IsUrlMatchAll(e,o.matchData);if(t?.isMatch)return i.isMatch=t.isMatch,i.autoShowType=o.autoShowType,i.cooldownInSeconds=o.coolDownInSeconds,i}return i}HandleActivatedAutoNotification(){return!(!x.Q?.GroceryCashbackItem||!x.Q?.ICActivatedPending||(this.localDataService.SetICNotificationType(V.c.Activated),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.Activated),this.validationMessageService.SendBoolStorageMessage(H.Q.ICActivatedPending,!1),0))}HandleHomePage(e,t){this.SendGetCashbackMessage(e,"",X.x.Contextual,t)}HandleSearchPage(e,t,i){return!!e&&(this.SendGetCashbackMessage(t,e,X.x.Search,i),this.localDataService.SetICNotificationType(V.c.Search),this.localDataService.SetData("query",e),!0)}HandleCategoryPage(e,t,i,o){return!!e&&(this.SendGetCashbackMessage(t,e,X.x.Category,i),this.localDataService.SetICNotificationType(V.c.Category),o&&this.localDataService.SetData("categoryCooldown",o.toString()),!0)}HandleCustomAutoShowPage(e,t,i,a){try{const r=x.Q?.GroceryAutoShowData?(0,O.BQ)(x.Q.GroceryAutoShowData):new pe,n=r?.AutoShowEventsMap[e]?r.AutoShowEventsMap[e]:[],s=n?.filter((e=>e.AutoShowType===t));s?.sort(((e,t)=>e.AutoShowTimestamp-t.AutoShowTimestamp));const c=te.Z.GetTotalCashbackFromOffers(a?.itemizedCashback);if(c&&c>0&&(0===s?.length||this.GetSecondsSince(s[0].AutoShowTimestamp)>i)){const a=n?.filter((e=>e.AutoShowType!==t));return a?.push(new class{constructor(e,t,i){(0,o.Z)(this,"AutoShowType",void 0),(0,o.Z)(this,"AutoShowTimestamp",void 0),(0,o.Z)(this,"CooldownInSeconds",void 0),this.AutoShowTimestamp=t,this.AutoShowType=e,this.CooldownInSeconds=i}}(t,Date.now(),i)),r.AutoShowEventsMap[e]=a,r.ActiveAutoShowType=t,r.TotalCashbackAmount=c,this.validationMessageService.SendStringStorageMessage(H.Q.GroceryAutoShowData,JSON.stringify(r)),this.validationMessageService.SendStringStorageMessage(H.Q.ICNotificationType,V.c.GroceryAutoShow),this.localDataService.SetICNotificationType(V.c.GroceryAutoShow),!0}return!1}catch(e){return!1}}GetSecondsSince(e){return(Date.now()-e)/1e3}HandleActivatedOffers(e,t,i){this.localDataService.SetICNotificationType(V.c.ActivatedOffers),this.localDataService.SetData("domain",t),this.SendGetCashbackMessage(t,e,X.x.Category,i)}}var Ce=ge;class Se{constructor(){(0,o.Z)(this,"pageVisitId",void 0),(0,o.Z)(this,"retailerSessionId",void 0),(0,o.Z)(this,"sessionId",void 0)}static Create(e){const t=new Se;return t.pageVisitId=e?.pageVisitId,t.retailerSessionId=e?.retailerSessionId,t.sessionId=e?.sessionId,t}}var me=Se,Ae=i(33408);function fe(e){const t=e?.confirmationDetails;return!!(t&&t.transactionId&&t.purchaseTotal&&t.productNames)}var ve=i(64865),Ee=i(34802),Pe=i(50978);function Ie(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function Te(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ie(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Oe=class{constructor(){(0,o.Z)(this,"isPersonalizationDataConsentEnabled",void 0),(0,o.Z)(this,"cartExtractionSuccessful",void 0),(0,o.Z)(this,"mutationObserver",void 0)}async Init(){const e=Ze.GetLocalDataService(),t=e.GetCheckoutPageData(),i=e.GetImpressionId(),o=e.GetDomainName();if(!t.retailerData)return;this.isPersonalizationDataConsentEnabled=t.userInfo?.isPersonalizationDataConsentEnabled??e.IsP13nEnabled()??!1;const a=t.retailerData.getAutomatedSelectorsPageByRegex(location.href);a&&(a?.type!==p.u3.Checkout&&a?.type!==p.u3.Cart||(this.AddPersonalizedPromotionsButtonListeners(o,i,a),this.TryCheckAndCollectPersonalizedPromotionsRawInformation(o,i,a)))}async PostValidation(){}GetLastPersonalizedPromotionsCartData(){const e=(0,S.Mw)(Pe.Vj);return e&&!(0,ve.TF)(e)?JSON.parse(e):null}async TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,i,o){i&&this.CollectPersonalizedPromotionsCartData(e,t,i,o).catch((i=>{const o={domain:e,cartUrl:location.pathname};this.LogCartExtractionEvent(o,p.R.PersonalizedPromotionsExtractionError,i?.message,p.in.Error,t)}))}async ShouldCollectPersonalizedPromotionsCartData(e,t){const i=Date.now();return!(e&&!(0,ve.TF)(t)&&t===e.OrderTotal&&!(0,ve.TF)(e.RandomId)&&e.PageUrl===(0,O.Ek)()&&i-e.CartDataCreationTime<=m.l$)}async CollectPersonalizedPromotionsCartData(e,t,i,o){if(!i?.details)return;const a=new Ee.Z;a.domain=e,a.pageType=i.type,a.pageUrl=(0,O.Ek)(),a.orderId=v.Z.GetBoxValue(i.details.orderId),a.randomId=h.Z.uuidv4();const r=i.details.orderTotalPrice;let n="";g.ZP.IsValidDataField(r)&&(n=await g.ZP.WaitForCondition((async()=>D.Z.RunQuerySelectorAll(r).length>0),5e3).then((async()=>v.Z.GetBoxValue(r))).catch((i=>{const o={cartId:a.randomId??"",cartUrl:location.pathname,domain:e};return this.LogCartExtractionEvent(o,p.R.PersonalizedPromotionsExtractionError,i?.message,p.in.Error,t),""})));const s=this.GetLastPersonalizedPromotionsCartData();if(!s||this.ShouldCollectPersonalizedPromotionsCartData(s,n)){try{const a=new URL(window.location.href);this.AddPageMonitor(e,t,a,i,o)}catch(e){}try{if(a.orderTotal=n,a.orderSubtotal=v.Z.GetBoxValue(i.details.orderSubTotalPrice),a.productName=await this.GetItemizedProductData(i.details.productName),a.productItemPrice=await this.GetItemizedProductData(i.details.productItemPrice),a.productTotalPrice=await this.GetItemizedProductData(i.details.productTotalPrice),a.productPrice=await this.GetItemizedProductData(i.details.productPrice),a.productQuantity=await this.GetItemizedProductData(i.details.productQuantity),a.productId=await this.GetItemizedProductData(i.details.productId),g.ZP.IsValidDataField(i.details.productImgSelector)){const e=D.Z.RunQuerySelectorAll(i.details.productImgSelector);let t="";for(const i of e){const e=i?.getAttribute("alt");e&&(t+=e+"<SEP>")}a.productNameFromImg=t}this.LogPersonalizedPromotionsCartInfo(a,e,t)}catch(e){}}}LogPersonalizedPromotionsCartInfo(e,t,i){const o=h.Z.uuidv4();this.LogCartExtractionEvent(e,p.R.ShoppingPersonalizedPromotionsRawTable,"Successfully extracted Personalized Promotions Cart Information",p.in.Information,i,o,!0);const a=new Pe.JR;a.Domain=e.domain,a.OrderTotal=e.orderTotal,a.PageType=e.pageType,a.PageUrl=e.pageUrl,a.OrderId=e.orderId,a.OrderSubtotal=e.orderSubtotal,a.ProductName=e.productName,a.ProductTotalPrice=e.productTotalPrice,a.ProductItemPrice=e.productItemPrice,a.ProductQuantity=e.productQuantity,a.ProductId=e.productId,a.ExtractionId=h.Z.uuidv4(),a.CartDataCreationTime=Date.now(),a.ProductPrice=e.productPrice,a.ProductNameFromImg=e.productNameFromImg,a.RandomId=e.randomId,(0,S.NN)()||this.LogCartExtractionEvent(e,p.R.PersonalizedPromotionsExtractionError,"No access to local storage",p.in.Error,i),(0,S.Xo)(Pe.Vj,JSON.stringify(a)),this.SendPersistentPersonalizedPromotionsCartMessage(t,a,i)}async GetItemizedProductData(e,t=5e3){if(!e||(0,ve.TF)(e))return"";let i;return await g.ZP.WaitForCondition((async()=>(i=D.Z.GetFirstVisibleElement(e??""),void 0!==i)),t),D.Z.GetItemizedData(e??"","<SEP>")}async AddPageMonitor(e,t,i,o,a){const r="true"===o.details?.addCartMonitor,n=o.details?.cartMonitorSelector;if(r){const i={attributes:!0,characterData:!0,childList:!0,subtree:!0};this.mutationObserver||(this.mutationObserver=new MutationObserver((async i=>{this.TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,o,a)})));const r=n??o?.details?.orderTotalPrice;if(r){await g.ZP.WaitForCondition((async()=>void 0!==D.Z.GetFirstVisibleElement(r)),5e3);const e=D.Z.GetFirstVisibleElement(r);e&&(this.mutationObserver?.disconnect(),this.mutationObserver?.observe(e,i))}}else this.mutationObserver?.disconnect()}SendPersistentPersonalizedPromotionsCartMessage(e,t,i){try{const i=x.Q?.PersonalizedPromotionsCartData??"",o=(0,O.BQ)(i)??{};o[e]={cartDataStorageInfo:t,timestamp:new Date};const a=JSON.stringify({value:JSON.stringify(o)});v.Z.SendStorageMessage("PersonalizedPromotionsCartData",a)}catch(e){this.LogCartExtractionEvent(t,p.R.PersonalizedPromotionsExtractionError,"Could not send cart data to storage:  "+e?.message,p.in.Error,i)}}async AddPersonalizedPromotionsButtonListeners(e,t,i){if(i?.details?.addToCartButton){const o=i.details.addToCartButton,a=await g.ZP.WaitForCondition((async()=>D.Z.HasVisibleElement(o)),5e3).then((async()=>D.Z.GetFirstVisibleElement(o)));a?.addEventListener("click",(async()=>{this.TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,i,!0)}))}else if(i?.details?.placeOrderButton){const o=i.details.placeOrderButton,a=await g.ZP.WaitForCondition((async()=>D.Z.HasVisibleElement(o)),5e3).then((async()=>D.Z.GetFirstVisibleElement(o)));a?.addEventListener("click",(async()=>{this.TryCheckAndCollectPersonalizedPromotionsRawInformation(e,t,i,!1)}))}}ShouldSendTelemetryData(e){return this.isPersonalizationDataConsentEnabled||e!==p.R.CartExtraction&&e!==p.R.TravelCheckoutExtraction&&e!==p.R.ShoppingPersonalizedPromotionsRawTable}LogCartExtractionEvent(e,t,i,o,a,r,n){let s={};this.ShouldSendTelemetryData(t)&&(s=e),n||(void 0===this.cartExtractionSuccessful&&(t===p.R.CartExtraction?this.cartExtractionSuccessful=!0:this.cartExtractionSuccessful=!1),s=Te(Te({},s),{},{isPersonalizationDataConsentEnabled:this.isPersonalizationDataConsentEnabled,extractionId:r??null})),v.Z.SendLogEventMessage(s,t,a,i,o)}},ye=i(7355),De=i(57176),be=i(29853),Ne=class{constructor(){(0,o.Z)(this,"noMatchYet",void 0),(0,o.Z)(this,"passedStorageValues",void 0),(0,o.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,O.S8)(),PageUrl:"",Status:"Error"};v.Z.SendLogEventMessage(t,p.R.PlatformDetection,"",e?.message??"Error detecting platform",p.in.Information)}SendPlatformFoundMessage(e){v.Z.SendMessage(ee.H.PlatformExpansionDomain,[e])}TriggerSuggestedCouponService(){this.passedStorageValues&&(Ze.GetSuggestedCouponService(!0).Init(),Ze.GetSuggestedCouponService(!0).Update(De.s3.CheckoutPage,[]))}TriggerCouponSavingsService(e){const t=[...e[0].split(","),e[1]],i=this.CreateCheckoutPageUrlData(t);Ze.GetCouponSavingsService().TryListenForCoupon(i,[],"","",!0)}CreateCheckoutPageUrlData(e){const t=new be.Z;return t.inputBoxSelector=e[0],t.orderTotalDataElementSelector=e[e.length-1],t.applyButtonSelector=e.length>=3?e[1]:"",t}},Re=i(71951),_e=i(46261),ke=i(90650),we=i(87869),xe=i(93970),Ue=class{constructor(e,t){(0,o.Z)(this,"validator",void 0),(0,o.Z)(this,"CEService",void 0),(0,o.Z)(this,"domainName",void 0),this.validator=e,this.CEService=t}async SetUpPurchaseConfirmation(e,t,i,o,a){try{this.domainName=i;const r=await this.IsFinalCheckoutPage(e),n=e.retailerData.getCurrentFinalCheckoutPage(),s=(0,O.uf)(e?.market,e.retailerData?.exclusiveMarket);let c=await ae.Z.GetOrderTotal(n,s,t,i);xe.ZP.sendFinalCheckoutValidationLog(this.domainName,r,t,"",c);const l=this.CEService.GetLastCartData();r?this.ListenForPurchaseConfirmation(e,c,t,l?.CartId??"",o,a):n?.domMutationEnabled&&g.ZP.ObserveUntil((()=>D.Z.HasVisibleElement(n.finalCheckoutButtonSelector)),(async()=>{c=await ae.Z.GetOrderTotal(n,s,t,i),xe.ZP.sendFinalCheckoutValidationLog(this.domainName,!0,t,"",c),this.ListenForPurchaseConfirmation(e,c,t,l?.CartId??"",o,a)}))}catch(e){const i=e?.message??"checkoutpage purchase confirmation error.";v.Z.SendPurchaseConfirmationLog(this.domainName,t,i,"error","",void 0)}}async IsFinalCheckoutPage(e){const t=e.retailerData.getCurrentFinalCheckoutPage();return!(!t||(0,ve.TF)(t.finalCheckoutButtonSelector))&&(await g.ZP.WaitForCondition((async()=>D.Z.HasVisibleElement(t.finalCheckoutButtonSelector)),5e3),D.Z.HasVisibleElement(t.finalCheckoutButtonSelector))}ListenForPurchaseConfirmation(e,t,i,o,a,r){const n=e.retailerData.getCurrentFinalCheckoutPage();if(n&&!(0,ve.TF)(n.finalCheckoutButtonSelector)){const s=D.Z.GetAllVisibleElements(n.finalCheckoutButtonSelector);for(const c of s)c.addEventListener("click",(async()=>{this.validator.SendPurchaseConfirmationMessage(),v.Z.SendPurchaseConfirmationLog(this.domainName,i,"User completed purchase","completed",o,t);try{const t=B.Z.getFactory()?.getDynamicTransactionId(),i=t?.isEnabledDynamicTransactionId(e?.retailerData?.settings);!i||e?.retailerData.settings?.other?.isPurchaseRefactorExpEnabled&&"True"===e?.retailerData.settings?.other?.isPurchaseRefactorExpEnabled||t.setDynamicTransactionId()}catch{}this.ConfirmPurchase(n,o,i,t);try{const t=(0,O.uf)(e?.market,e.retailerData?.exclusiveMarket),o=e.retailerData?.getCurrentAutomatedSelectorsPage(location.href);this.CEService.TryCheckAndCollectCartInformation(e.retailerData.domainName,i,n,t,r,o,a)}catch{}try{J.R.isExperimentActive(Y.H.injectConfirmationScriptUponPurchaseCompletion)&&v.Z.SendStorageMessage("CompletedPurchase",JSON.stringify({value:!0})),v.Z.SendStorageMessage("CompletedPurchaseConf",JSON.stringify({value:!0}))}catch(e){}}))}}async ConfirmPurchase(e,t,i,o){const a=new _e.GA;a.CheckoutButtonClicked=!0,a.CheckoutTime=Date.now(),a.CartId=t,a.CartValue=o,(0,S.Xo)(_e.Wi,JSON.stringify(a)),await g.ZP.Sleep(5e3);let r=new we.L;g.ZP.WaitForCondition((async()=>(r=this.DidPurchaseSucceed(e),r.indicators.length>0)),5e3).then((()=>{this.LogPurchaseStatusAndCleanUp(r.purchaseFailed,i,t,o,r.indicators),r.purchaseFailed||(0,S.UZ)(m.OY)})).catch((e=>{v.Z.SendPurchaseConfirmationLog(this.domainName,i,e?.message??"Error evaluating purchase status on checkout script","error",t,o)}))}DidPurchaseSucceed(e){const t=new we.L;if(t.indicators=[],t.purchaseFailed=!1,D.Z.GetAllVisibleElements(e.finalCheckoutButtonSelector).length>0)return t.purchaseFailed=!0,t.indicators.push(we.c.finalCheckoutButtonVisible),t;const i=D.Z.GetFirstVisibleElement("body");return ke.ZP.PageIncludesPaymentKeyWords(i?.innerText.toLocaleLowerCase(),ke.lD)?(t.indicators.push(we.c.successfulPaymentKeywordsFound),t.purchaseFailed=!1,t):(ke.ZP.PageIncludesPaymentKeyWords(i?.innerText.toLocaleLowerCase(),ke.si)&&(t.purchaseFailed=!0,t.indicators.push(we.c.failurePaymentKeywordsFound)),D.Z.GetAllVisibleElements("input").length>0&&(t.purchaseFailed=!0,t.indicators.push(we.c.inputFieldsFound)),t)}LogPurchaseStatusAndCleanUp(e,t,i,o,a){(0,S.UZ)(_e.Wi),e||(0,S.Mw)(Re.y$.autoApplyStorageKey)===Re.M4.ActionDetected&&(v.Z.SendStringStorageMessage(Re.y$.completedPurchaseStorageKey,Re.M4.ActionDetected),(0,S.Xo)(Re.y$.completedPurchaseStorageKey,Re.M4.ActionDetected));const r=e?"Failed":"Succeeded";v.Z.SendPurchaseConfirmationLog(this.domainName,t,JSON.stringify(a),r,i,o)}};class Me{async QueryWebAssistUrls(e,t,i){return Me.waiting=!0,Me.mojomResponse=void 0,k.p.postMessageToHost("QueryWebAssistUrls",[e,...t]),await g.ZP.WaitForCondition((async()=>!Me.waiting),7e3),Me.mojomResponse}ProcessWebAssistResponse(e){try{Me.mojomResponse=JSON.parse(e)}catch(e){Me.mojomResponse=void 0}finally{Me.waiting=!1}}}(0,o.Z)(Me,"waiting",void 0),(0,o.Z)(Me,"mojomResponse",void 0);var Le=Me,Be=i(69442);class Fe{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,N.X)()}static GetPersonalizedPromotionsCartExtractionService(){return this.personalizedPromotionsCartExtractionService||(this.personalizedPromotionsCartExtractionService=new Oe),this.personalizedPromotionsCartExtractionService}static GetPinterestService(){return this.pinterestService||(this.pinterestService=new ye.Z),this.pinterestService}static GetCatalogExtractionService(){return this.catalogExtractionServie||(this.catalogExtractionServie=new R.Z),this.catalogExtractionServie}static GetPlatformDetectionService(){return this.platformDetectionService||(this.platformDetectionService=new Ne),this.platformDetectionService}static GetAutoApplyService(){return this.autoApplyService||(this.autoApplyService=new n.Z),this.autoApplyService}static GetHtmlFragmentCollectionService(){return this.htmlFragmentCollectionService||(this.htmlFragmentCollectionService=new F),this.htmlFragmentCollectionService}static GetCancellationPageDataExtractionService(){return this.cancellationPageDataExtractionService||(this.cancellationPageDataExtractionService=new b),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,o.Z)(this,"webAssistQueryService",void 0),this.webAssistQueryService=e}async TryCollectCartInformation(e,t,i,o,a,r,n){try{await this.CollectCartInformation(e,t,i,o,a,r,n)}catch(t){const i={cartId:n??"",cartUrl:location.pathname,domain:e};this.LogCartExtractionEvent(i,p.R.CartExtraction,t?.message,p.in.Error,o)}}async CollectCartInformation(e,t,i,o,a,r,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,o)}else{for(const t of c){if(!this.isVisible(t))continue;if(this.isAtTopOfPage(t))continue;if(0===l&&!this.isInViewPort(t))continue;const i=this.findProductContainer(t);if(0===l&&t.offsetHeight>0){const o=this.isPotentialCartItem(t,i,e);if(!o||!i)continue;l=t.offsetHeight,u=i,s.products.push(o)}else if(l===t.offsetHeight){const o=this.isPotentialCartItem(t,i,e);if(!o||!i)continue;if(null==d){if(!u)continue;if(d=this.getCommonParent(u,i),null==d)continue}const a=Node.DOCUMENT_POSITION_CONTAINED_BY;if(!(d.compareDocumentPosition(i)&a))continue;s.products.push(o)}}if(await this.augmentWithWebAssist(s.products,e,a,r),s.products=[],s.products?.length>0){const e="Successfully automatically extracted Cart Information";this.LogCartExtractionEvent(s,p.R.CartExtraction,e,p.in.Information,o),this.StoreCartInfoInLocalStorage(s,t)}else{const i=this.scrapeCandidateUrls(e),n=await this.generateWebassistProducts(i,a,r);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,o),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,o)}}}}async augmentWithWebAssist(e,t,i,o){if(!e||0===e.length)return;const a=e.map((e=>this.normalizeUrl(e.productUrl,t))),r=await this.webAssistQueryService.QueryWebAssistUrls(i,a,o);r&&e.forEach((e=>{if(e?.productUrl){const i=this.normalizeUrl(e.productUrl,t);if(this.HasValidWebAssistEntry(r,i)){const t=r[i];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(),i=t.left,o=t.top;return!0===document.elementFromPoint(i,o)?.isSameNode(e)}isPotentialCartItem(e,t,i){if(null==t)return null;const o=t.tagName.toLocaleLowerCase();if("html"===o||"body"===o)return null;const a=[...t.querySelectorAll("a")].filter((e=>v.Z.IsValidPDPUrlHeuristic(e.href,i)));if(a.length<=0)return null;const r=a[0],n=r.href,s=new f.Z;s.productUrl=n;let c=r.innerText??r.getAttribute("title");if(""===c&&a.length>1)for(let e=1;e<a.length&&""===c;e++)c=a[e].innerText??a[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 i=new RegExp("("+(0,C.So)(t)+"[0-9,]+(?:.[0-9]{1,2}){0,1})","g");return e.innerText.match(i)}return[]}getCommonParent(e,t){let i=e.parentElement;if(e===t)return i;if(null==i)return null;const o=Node.DOCUMENT_POSITION_CONTAINED_BY;let a=i.compareDocumentPosition(t);for(;!(a&o);){if(i=i.parentElement,null==i)return null;a=i.compareDocumentPosition(t)}const r=i.tagName.toLocaleLowerCase();return"html"===r||"body"===r?null:i}HasValidWebAssistEntry(e,t){return e.hasOwnProperty(t)}AugmentProductWithWebAssistProduct(e,t){const i=t.entity;e.foundInWebAssist=!0,e.webAssistTitle=t.title??i.name,e.webAssistImg=i.image;const o=this.CleanWebAssistPrice(i.price_value);o&&(e.webAssistPrice=o)}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=>v.Z.IsValidPDPUrlHeuristic(t,e)));return[...new Set(t)]}async generateWebassistProducts(e,t,i){const o=await this.webAssistQueryService.QueryWebAssistUrls(t,e,i),a=[];if(o)for(const e in o)if(o[e].entity){const t=new f.Z;t.productUrl=e,this.AugmentProductWithWebAssistProduct(t,o[e]),a.push(t)}return a}LogCartExtractionEvent(e,t,i,o,a){const r=Ze.GetLocalDataService(),n=r.GetSessionIds()?.retailerSessionId??"",s=r.GetSessionIds()?.pageVisitId??"";e=P(P({},e),{},{PageVisitId:s,RetailerSessionId:n}),v.Z.SendLogEventMessage(e,t,a,i,o)}StoreCartInfoInLocalStorage(e,t){const i=new m.Vr;i.OrderTotal=t.OrderTotal,i.CartDataCreationTime=Date.now(),i.CartId=e.cartId,(0,S.Xo)(m.OY,JSON.stringify(i))}CleanWebAssistPrice(e){if(e)try{const t=(e=e.replace(/\s/g,"")).split("-");return(0,C.K)(t[0])}catch(e){}}}(Fe.GetWebAssistQueryService())),this.automaticCartExtractionService}static GetPurchaseDetectionService(){return this.purchaseDetectionService||(this.purchaseDetectionService=new Ue(Fe.GetValidatorModule(),Fe.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 GetWebAssistQueryService(){return this.webAssistQueryService||(this.webAssistQueryService=new Le),this.webAssistQueryService}static GetSuggestedCouponService(e=!1){return this.suggestedCouponsService||(this.suggestedCouponsService=new a.Z(v.Z.SendStorageMessage.bind(v.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,o.Z)(Fe,"localDataService",new class{constructor(){(0,o.Z)(this,"impressionId",void 0),(0,o.Z)(this,"icNotificationType",void 0),(0,o.Z)(this,"mapData",void 0),(0,o.Z)(this,"userInfo",void 0),(0,o.Z)(this,"clientInfo",void 0),(0,o.Z)(this,"isRebatesEnabled",void 0),(0,o.Z)(this,"isP13nEnabled",void 0),(0,o.Z)(this,"isEdgeProfileRebatesUser",void 0),(0,o.Z)(this,"consentCanPrompt",void 0),(0,o.Z)(this,"itemLevelCashBackDta",void 0),(0,o.Z)(this,"domainName",void 0),(0,o.Z)(this,"traceId",void 0),(0,o.Z)(this,"isClippingSent",void 0),(0,o.Z)(this,"submittedIds",void 0),(0,o.Z)(this,"personalizedCashbackData",void 0),(0,o.Z)(this,"isPendingTransactionPresent",!1),(0,o.Z)(this,"searchApiRequestSentTimestamp",0),(0,o.Z)(this,"merchantData",void 0),(0,o.Z)(this,"coupons",void 0),(0,o.Z)(this,"isFinalCheckoutPage",void 0),(0,o.Z)(this,"isAOCActive",void 0),(0,o.Z)(this,"market",void 0),(0,o.Z)(this,"isExpressCheckoutPage",void 0),(0,o.Z)(this,"muid",void 0),(0,o.Z)(this,"params",void 0),(0,o.Z)(this,"isAADSignedIn",void 0),(0,o.Z)(this,"hasValidLinkedAccount",void 0),(0,o.Z)(this,"sessionIds",void 0),(0,o.Z)(this,"ConfirmationPageData",void 0),(0,o.Z)(this,"autoApplyStatus",!1),(0,o.Z)(this,"userSettingsData",void 0),this.mapData=new Map,this.userInfo=new he.Z,this.clientInfo=new le.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 i=await(0,Ae._p)(e.confirmationPageTelemetry,e.domainName);return i?.confirmationDetails?{confirmationDetails:i.confirmationDetails,canNotifyOnConfirmationPage:fe(i)}:void 0}(e,(0,O.Ek)())}async GetConfirmationPageData(e){return this.ConfirmationPageData||this.EarlyFetchConfirmationPageData(e),await this.ConfirmationPageData}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=me.Create(e)}SetUserSettingsData(e,t,i){if(i&&!(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,o.Z)(Fe,"validationMessageService",new class{SendMessage(e,t){v.Z.SendMessage(e,t)}SendStringStorageMessage(e,t){v.Z.SendStringStorageMessage(e,t)}SendBoolStorageMessage(e,t){v.Z.SendStorageMessage(e,JSON.stringify({value:t}))}}),(0,o.Z)(Fe,"validator",new xe.ZP(Fe.GetLocalDataService())),(0,o.Z)(Fe,"personalizedPromotionsCartExtractionService",new Oe),(0,o.Z)(Fe,"zipCardService",new Be.Z),(0,o.Z)(Fe,"groceryCBService",void 0),(0,o.Z)(Fe,"catalogExtractionServie",new R.Z),(0,o.Z)(Fe,"automaticCartExtractionService",void 0),(0,o.Z)(Fe,"purchaseDetectionService",new Ue(Fe.GetValidatorModule(),Fe.GetCartExtractionService())),(0,o.Z)(Fe,"platformDetectionService",new Ne),(0,o.Z)(Fe,"htmlFragmentCollectionService",new F),(0,o.Z)(Fe,"cancellationPageDataExtractionService",new b),(0,o.Z)(Fe,"couponSavingsService",new w.Z),(0,o.Z)(Fe,"icValidatorService",new Ce),(0,o.Z)(Fe,"autoApplyService",new n.Z),(0,o.Z)(Fe,"icSearchProcessorService",new ce),(0,o.Z)(Fe,"icPDPProcessorService",new Q),(0,o.Z)(Fe,"suggestedCouponsService",void 0),(0,o.Z)(Fe,"webAssistQueryService",void 0),(0,o.Z)(Fe,"otherSellersService",new u.Z),(0,o.Z)(Fe,"clippingService",new c.Z),(0,o.Z)(Fe,"aaConsentService",new r.Z),(0,o.Z)(Fe,"productBestCouponConsentService",new d.Z),(0,o.Z)(Fe,"pinterestService",void 0),(0,o.Z)(Fe,"clientRequestsService",new class{constructor(){(0,o.Z)(this,"MaxWaitTime",7e3),(0,o.Z)(this,"responseMap",{})}async Init(){}async PostValidation(){}async SendRequest(e,t,i){const o=h.Z.uuidv4(),a=JSON.stringify({serviceName:e,methodName:t,requestBody:JSON.stringify(i)});this.responseMap[o]=void 0,_.f.postMessageToHost("FireGenericDealsRequest",[o,a]),k.p.postMessageToHost("FireGenericDealsRequest",[o,a]),await g.ZP.WaitForCondition((async()=>void 0!==this.responseMap[o]),this.MaxWaitTime);const r=this.responseMap[o];if(delete this.responseMap[o],void 0!==r&&r.length>=3&&"200"===r[2]){const e=JSON.parse(r[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,o.Z)(Fe,"pageDetectionService",new class{constructor(){(0,o.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 i of this.regexList)if(i.test(t))return void this.LogUrlAndMatchedRegex(t,i,e)}UrlNotInRetailerData(e,t){const i=e.retailerData?.getCurrentCheckoutPage(t);return!i||"/"===i.checkoutPageUrl}LogUrlAndMatchedRegex(e,t,i){const o={Domain:i.retailerData?.domainName,PageUrl:e,Regex:t.source};v.Z.SendLogEventMessage(o,p.R.PageDetectionRegexMatched,i.impressionId,"Url not in retailer data matched regex",p.in.Information)}}),(0,o.Z)(Fe,"backgroundAAService",new s.Z);var Ze=Fe},93970:function(e,t,i){i.d(t,{EI:function(){return T},J6:function(){return I},OE:function(){return P}});var o=i(72370),a=i(59645),r=i(40843),n=i(5144),s=i(73557),c=i(29247),l=i(36493),u=i(91495),d=i(8553),h=i(9448),p=i(90066),g=i(43916),C=i(1094),S=i(44922),m=i(86743),A=i(68813),f=i(52056),v=i(4872),E=i(31656);let P=function(e){return e.CouponClipping="18",e.BellIconNotifClick="25",e}({}),I=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.AnimateTextInOmnibox="AnimateTextInOmnibox",e.AnimateOutOmnibox="AnimateOutOmnibox",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,i,o,a){const r=a?.OrderTotal;t?f.Z.SendPurchaseConfirmationLog(e,i,"Valid Final Checkout Page","true",o,a):r&&-1!==r&&f.Z.SendPurchaseConfirmationLog(e,i,"Invalid Final Checkout Page","false",o,a),r&&-1!==r&&C.Z.SendGMVMessage(r,a?.Currency??"$",O.traceId)}static async ValidateProductOutOfStock(e,t,i,o){if(!E.R.isExperimentActive(v.H.ptOutOfStock))return!1;if(!t?.productOutOfStockSelector)return!1;const s=window.location.href;if((o=new r.Z(o)).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 o,r,d,g="$";if(t?.productImageSelector){const e=p.Z.GetFirstMatchingElement(t?.productImageSelector);r=e?.src}if(t?.productTitleSelector){const e=p.Z.GetFirstMatchingElement(t?.productTitleSelector);o=e?.innerText}if(t?.productPriceSelector){const i=p.Z.GetFirstMatchingElement(t?.productPriceSelector),o=i?.innerText;o&&o.length&&(g=(0,l.cU)(o)||(0,l.N6)(e.exclusiveMarket||"en-us")||"$",d=(0,l.K)(o))}const C=JSON.stringify({currency:g,productImage:r,productPrice:d,productTitle:o,productUrl:s,status:"OUT_OF_STOCK"});if(o&&s&&(h=!0),!o||!r){const t=new a.Z(n.xu.ProductTrackingDebug);t.Metadata=JSON.stringify({productTitle:o,productImage:r,productUrl:s}),t.Domain=e.domainName,f.Z.SendLogEvent(i,"Product Tracking: Invalid OOS product, missing title or image","error",void 0,g,n.R.EdgeFlyoutStatus,t,e.domainName)}return f.Z.SendStorageMessage("ProductTrackingData",JSON.stringify({value:C})),!await u&&h}catch(e){return f.Z.SendLogEvent(i,`Product Tracking: Validating OOS product check" ${e?.message}\n\n${e}`,"error"),!1}return!1}constructor(e){(0,o.Z)(this,"impressionId",""),(0,o.Z)(this,"merchantData",void 0),(0,o.Z)(this,"isAutoOpenControllerActive",void 0),(0,o.Z)(this,"isRuleBasedTriggerControllerActive",void 0),(0,o.Z)(this,"aocValidatorUtilities",void 0),(0,o.Z)(this,"ruleBasedTriggerController",void 0),(0,o.Z)(this,"scriptRunNum",0),(0,o.Z)(this,"validationMsgNum",0),(0,o.Z)(this,"validationStartTime",performance.now()),(0,o.Z)(this,"initializeStartTime",void 0),(0,o.Z)(this,"scriptStartTime",void 0),(0,o.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,i){this.SendValidationMessage(!1,e,t,[i],!1,!0)}SendValidationMessage(e,t,i,o,a=!0,r=!1,n){n||(n={auto_apply_status:e,express_checkout_status:this.localDataService.IsExpressCheckoutPage(),open_micro_notifcation:!1,page_validations:o??[],page_validations_auto_open:[],auto_open_reasons:[]});const s=(e&&a||r)&&(0,A.ZQ)((e=>{f.Z.SendLogEvent(this.impressionId,e,"Blocked notification based on User Cohort")}),(0,A.tW)(),o,this.localDataService.GetUserSettingsData());this.sendValidationMessage(n,i,"AAController: "+t,s),!s&&this.aocValidatorUtilities&&this.aocValidatorUtilities.cleanLocalStorage()}SendStorageMessage(e,t){f.Z.SendStorageMessage(e,t)}SendPurchaseConfirmationMessage(){f.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 i="error";f.Z.SendLogEvent(e,t,i,void 0,void 0,void 0),f.Z.SendMessage(h.H.CheckoutPageValidationError,[i,O.traceId])}catch(e){}}async RetrieveGuestDomain(e){if(f.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 i;await c.ZP.WaitForCondition((async()=>(i=p.Z.GetFirstVisibleElement(e.pinterestSelectors.productLinkSelector),void 0!==i)),5e3);let o=t.innerText;const a=i?.getAttribute("href");if(o&&a)return o.includes("www.")||(o=`www.${o}`),o.includes("http")||(o=`http://${o}`),f.Z.SendStorageMessage("pinterestProductLink",JSON.stringify({value:a})),f.Z.SendMessage(h.H.GuestDomain,[o]),Promise.resolve(!0)}}return Promise.resolve(!1)}DeleteKeyFromPersistentStorage(e){this.SendStorageMessage(e,JSON.stringify({value:null}))}sendValidationMessage(e,t,i,o){const a=e.auto_apply_status?"true":"false",r=JSON.stringify(e);if((0,m.sy)())try{this.SendPerfLog(t,i,r)}catch(e){}f.Z.SendMessage(h.H.PageStatus,[O.traceId,r]),(0,m.sy)()?f.Z.SendMessage(h.H.CheckoutPageValidationStatus,[a,O.traceId,`${o}`]):this.localDataService.SetAutoApplyStatus(e.auto_apply_status),this.validationMsgNum++}SendPerfLog(e,t,i){const o=performance.now(),a=new S.Z;a.domain=e,a.initializeTime=this.scriptStartTime-this.initializeStartTime,a.preValidationTime=this.validationStartTime-this.scriptStartTime,a.time=o-this.validationStartTime,a.scriptRunNum=this.scriptRunNum,a.validationMsgNum=this.validationMsgNum,a.validationReason=t,a.path=C.Z.GetCurrentPathName(),a.pageStatus=i,f.Z.SendLogEventMessage(a,n.R.CheckoutValidationPerf,this.impressionId,"",n.in.Information)}}(0,o.Z)(O,"traceId",void 0),t.ZP=O},27775:function(e,t,i){i(23582)},21650:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"boolValue",void 0)}static Create(e){const t=new a;return t.boolValue=e.boolValue,t}static CreateFromBool(e){const t=new a;return t.boolValue=e,t}}t.Z=a},96834:function(e,t,i){var o=i(72370);class a{constructor(){(0,o.Z)(this,"stringValue",void 0)}static Create(e){const t=new a;return t.stringValue=e.stringValue,t}static CreateFromString(e){const t=new a;return t.stringValue=e,t}}t.Z=a},28060:function(e,t,i){i.d(t,{E:function(){return o}});let o=function(e){return e.ICNotification="icnotification",e}({})},4724:function(e,t,i){var o=i(72370),a=i(47746);class r{constructor(){(0,o.Z)(this,"displayCategory",void 0),(0,o.Z)(this,"image",void 0),(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"productId",void 0),(0,o.Z)(this,"retailerIdentifier",void 0),(0,o.Z)(this,"title",void 0),(0,o.Z)(this,"upc",void 0),(0,o.Z)(this,"url",void 0),(0,o.Z)(this,"discountedPrice",void 0),(0,o.Z)(this,"productReviewsCount",void 0),(0,o.Z)(this,"productRatings",void 0),(0,o.Z)(this,"productShortTitle",void 0),(0,o.Z)(this,"variation",void 0)}static Create(e){const t=new r;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 r;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 r;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=r.CreateFromUAPI(e),i=new a.Z;return i.cashbackProducts.push(t),i}static CreateFromAdsOffer(e,t){const i=new r;return i.displayCategory="",i.image=t,i.price=`$${e.price}`,i.productId="",i.retailerIdentifier="",i.title=e.name??"",i.upc="",i.url=e.url??"",i.discountedPrice=e.discountedPrice?`$${e.discountedPrice.toFixed(2)}`:"",i}}t.Z=r},47746:function(e,t,i){var o=i(72370),a=i(4724);class r{static Create(e){const t=new r;if(t.cashbackProducts=[],e.cashbackProducts)for(const i of e.cashbackProducts)t.cashbackProducts.push(a.Z.Create(i));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 r;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=>a.Z.CreateFromGroceryApi(e))),t}static CreateFromUAPI(e){const t=new r;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=>a.Z.CreateFromUAPI(e))),t}static CreateFromUAPIList(e){const t=[];return e.forEach((e=>{const i=new r;i.imageUrl=e.imageUrl,i.offerValue=e.value,i.id=e.id,i.description=e.description,i.brand=e.brand,i.disclaimer="",i.expiryDate=e.expiryDate,i.minQty=e.minQty,i.source=e.source,i.cashbackProducts=e.cashbackProducts.map((e=>a.Z.CreateFromUAPI(e))),t.push(i)})),t}constructor(){(0,o.Z)(this,"imageUrl",void 0),(0,o.Z)(this,"offerValue",void 0),(0,o.Z)(this,"id",void 0),(0,o.Z)(this,"description",void 0),(0,o.Z)(this,"brand",void 0),(0,o.Z)(this,"disclaimer",void 0),(0,o.Z)(this,"expiryDate",void 0),(0,o.Z)(this,"minQty",void 0),(0,o.Z)(this,"source",void 0),(0,o.Z)(this,"cashbackProducts",void 0),(0,o.Z)(this,"addedTimestamp",void 0),(0,o.Z)(this,"expAfterActivatingDate",void 0),(0,o.Z)(this,"quotientTimestamp",void 0),this.cashbackProducts=[]}}t.Z=r},69698:function(e,t,i){i.d(t,{Op:function(){return u}});var o=i(72370),a=i(11127);let r=a.DesignToken.create("cb-background-colour").withDefault("#FFFFFF"),n=a.DesignToken.create("cb-font").withDefault("#000000"),s=a.DesignToken.create("cb-background").withDefault("#FEFEFE"),c=a.DesignToken.create("cb-price-tag").withDefault("#0078D4"),l=a.DesignToken.create("linkColor").withDefault("#235CCF");class u{setCashbackUIService(e){this.cashbackUIService=e}constructor(e){(0,o.Z)(this,"cashbackUIService",void 0),this.cashbackUIService=e}initializeTokens(){this.cashbackUIService.isDarkMode()&&(l.setValueFor(document.documentElement,"#63ADE5"),c.setValueFor(document.documentElement,"#0078D4"),r.setValueFor(document.documentElement,"#FFFFFF"),n.setValueFor(document.documentElement,"#FFFFFF"),s.setValueFor(document.documentElement,"#3B3B3B"))}async init(){}}},49259:function(e,t,i){i.d(t,{Z:function(){return F}});var o=i(72370),a=i(71544),r=i(81687),n=i(12265),s=i(87605),c=i(84901),l=i(29247),u=i(75434),d=i(55590),h=i(31656),p=i(4872),g=i(5144),C=i(93209),S=i(2388),m=class{constructor(){(0,o.Z)(this,"cashbackState",void 0),(0,o.Z)(this,"cashbackType",void 0),(0,o.Z)(this,"domain",void 0),(0,o.Z)(this,"cashbackProductTitle",void 0),(0,o.Z)(this,"cashbackAmount",void 0),(0,o.Z)(this,"productPrice",void 0),(0,o.Z)(this,"imageUrl",void 0),(0,o.Z)(this,"productBingUrl",void 0),(0,o.Z)(this,"productRetailerUrl",void 0),(0,o.Z)(this,"description",void 0),(0,o.Z)(this,"isBlossom",!1),(0,o.Z)(this,"is3xIncentive",!1),(0,o.Z)(this,"shouldAutoshow",void 0),(0,o.Z)(this,"expireTimeEpoch",void 0),(0,o.Z)(this,"globalOfferId",void 0),(0,o.Z)(this,"minPurchaseValue",void 0),(0,o.Z)(this,"visibilityFeedbackUrl",void 0),(0,o.Z)(this,"cashbackCategories",[])}},A=class{constructor(e,t){(0,o.Z)(this,"price",void 0),(0,o.Z)(this,"currency",void 0),this.price=e,this.currency=t}},f=i(3634);let v=function(e){return e.EligibleUser="EligibleUser",e.OfferClaimed="OfferClaimed",e.PayoutCompleted="PayoutCompleted",e.FailedToFetch="FailedToFetch",e.NotEligibleUser="NotEligibleUser",e}({});var E=i(88767),P=i(56764),I=i(96148),T=i(22801),O=i(59645),y=i(28060),D=i(42544),b=i(15255),N=i(4238),R=i(11501),_=class{constructor(e,t,i,a){(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"sessionIds",void 0),(0,o.Z)(this,"anid",""),(0,o.Z)(this,"esf",""),(0,o.Z)(this,"settings",void 0),this.apiResponse=e,this.sessionIds=t,this.esf=a||"",this.anid=i||"",this.settings=new R.Z(e?.retailerData?.settings)}getLatencyData(){throw new Error("Method not implemented.")}saveActivatedCashback(e){throw new Error("Method not implemented.")}getRecentActivatedCashback(){throw new Error("Method not implemented.")}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 i of e)if(i?.ruleName&&i?.ruleValue&&i?.maskType){const e=new N.Z(i?.ruleName,i?.maskType,i?.ruleValue);t.push(e)}return t}};class k{constructor(e,t){(0,o.Z)(this,"cashbackItems",void 0),(0,o.Z)(this,"requestedForSearchUrl",void 0),this.cashbackItems=e,this.requestedForSearchUrl=t}}class w extends _{constructor(e,t,i,a){const r=w.parseApiWithErrorCatch(e);super(r),(0,o.Z)(this,"RECENT_ACTIVATED_CASHBACK_KEY","RecentActivatedCashbackProductTitle"),(0,o.Z)(this,"dataLoader",void 0),(0,o.Z)(this,"storageHandler",void 0),(0,o.Z)(this,"loggerService",void 0),(0,o.Z)(this,"apiResponse",void 0),(0,o.Z)(this,"highestCashbackCategoryData",void 0),(0,o.Z)(this,"pageHandler",void 0),(0,o.Z)(this,"cachedIsBingAdRefered",!1),this.pageHandler=t,this.dataLoader=e,this.storageHandler=i,this.loggerService=a,this.apiResponse=r}saveActivatedCashback(e){this.storageHandler.setStorageString(this.RECENT_ACTIVATED_CASHBACK_KEY,e.cashbackProductTitle)}getRecentActivatedCashback(){return this.storageHandler.getStorageString(this.RECENT_ACTIVATED_CASHBACK_KEY)}isPane(){return this.dataLoader.GetLoadTimeDataValue("is_hub",!1)}getAffiliateExclusions(){return this.apiResponse?.cashback?.exclusions}async getLatencyData(){const e=await this.storageHandler.getStorageString(d.Q.NotificationLatency);if((0,l.UE)(e)){return(0,u.rm)(e)||new Map}return new Map}async GetBlossomUserStatus(e){if(!(0,l.UE)(e))return Promise.resolve(v.FailedToFetch);const t=await this.storageHandler.getStorageString(d.Q.BlossomCampaignUserStatus),i=Number(await this.storageHandler.getStorageString(d.Q.BlossomCampaignUserStatusTimestamp));if(t&&!isNaN(i)&&(new Date).getTime()-i<3e5)return Promise.resolve(v[t]);{const t={headers:{"Content-Type":"application/json",Origin:"chrome-untrusted://shopping"},method:"GET"},i=`https://www.bing.com/api/shopping/v1/grocery/campaigns/projectBlossom022024/status?anid=${e}`;try{const e=await fetch(i,t),o=await e.json();if(200===e.status){const e=o?.userStatus??"";return this.storageHandler.setStorageString(d.Q.BlossomCampaignUserStatus,e),this.storageHandler.setStorageString(d.Q.BlossomCampaignUserStatusTimestamp,(new Date).getTime().toString()),e}return Promise.resolve(v.FailedToFetch)}catch(e){return Promise.resolve(v.FailedToFetch)}}}getSessionIds(){}getESF(){return""}isSignedIn(){return Boolean(this.isAadSignedIn())}async getAnid(){try{return await(0,u.H)(this.pageHandler)}catch(e){return}}getMuid(){return this.dataLoader.GetLoadTimeDataValue("muid","")}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(b.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 m,i=(e?.value||[]).find((e=>e.position===E.zE.SPB_OFFERS)),o=i?.offer.itemOffered;if(o?.image?.contentUrl&&i?.promotionInformation?.rebateValue&&i?.offer?.price&&i?.offer?.priceCurrency&&e?.visibilityFeedbackUrl)return t.imageUrl=o.image?.contentUrl,t.cashbackProductTitle=o.name,t.productPrice=new A(i.offer.price,i?.offer?.priceCurrency),t.cashbackAmount=new A(i.offer.price,i?.offer?.priceCurrency),t.productBingUrl=i?.offer?.url,t.visibilityFeedbackUrl=`${e.visibilityFeedbackUrl}&tids=${i.impressionToken}`,t.globalOfferId=String(i?.globalOfferId),t.cashbackAmount=new A(i.promotionInformation.rebateValue,i.offer.priceCurrencySymbol),t}async getSearchSpbOffers(){const e=await this.storageHandler.getStorageString(d.Q.ICCurrentPageInfo),t=[];if(!e||void 0===e)return new k([],void 0);try{const i=JSON.parse(e),o=i.cashbackData;if(o&&o.itemizedCashBackResponse&&o.itemizedCashBackResponse.offers&&o.itemizedCashBackResponse.offers.length>0){const e=o.itemizedCashBackResponse.offers,i=o.itemizedCashBackResponse.adsMetadata?.visibilityFeedbackUrl;if(!i)return this.loggerService.LogError("No visibility feedback url"),new k([],void 0);e.forEach((e=>{if(e.adsOffer.name&&e.adsOffer.price&&e.adsOffer.promotionInformation?.rebateValue){const o=new m,a=e.adsOffer.impressionToken;o.productBingUrl=e.adsOffer.url,o.shouldAutoshow=e.shouldAutoshow,o.imageUrl=e.imageUrl,o.cashbackProductTitle=e.adsOffer.name,o.description=e.description,o.productPrice=new A(e.adsOffer.price,"$"),o.cashbackAmount=new A(e.adsOffer.promotionInformation.rebateValue,"$"),o.visibilityFeedbackUrl=`${i}&tids=${a}`,o.globalOfferId=e?.id,t.push(o)}else this.loggerService.LogError("Failed to parse spb data",{spbCashback:e})}))}return new k(t,i.currentUrl)}catch(e){return new k([],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 D.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(){const e=this.apiResponse?.personalizedAdsResponse?.personalizedCashback?.adsCashback;return e&&e.length>0?e.map((e=>this.convertToItemCashbacData(e))):[]}async loadCashbackResponse(){const e=await this.storageHandler.getStorageString(d.Q.ICCurrentPageInfo);if(e){const t=JSON.parse(e);return t.cashbackData?.itemizedCashBackResponse}}async getContextualOffers(){const e=await this.loadCashbackResponse();return"contextual"===e?.queryType?e.offers:[]}async getContextualCashbackImpressionBeacon(){const e=await this.loadCashbackResponse();if("contextual"===e?.queryType){const t=e.adsMetadata?.impressionFeedbackUrl;return t||void this.loggerService.LogError("[getContextualCashbackImpressionBeacon] No ads metadata in contextual offers")}this.loggerService.LogError("[getContextualCashbackImpressionBeacon] Contextual offers not available")}async getContextualCashbackVisibilityBeacon(){const e=await this.loadCashbackResponse();if("contextual"===e?.queryType){const t=e.adsMetadata?.visibilityFeedbackUrl;return t||void this.loggerService.LogError("[getContextualCashbackVisibilityBeacon] No ads metadata in contextual offers")}this.loggerService.LogError("[getContextualCashbackVisibilityBeacon] Contextual offers not available")}async getPendingOffers(){const e=await this.storageHandler.getStorageString(d.Q.PendingOffers);return e?JSON.parse(e):[]}setPendingOffers(e){this.storageHandler.setStorageString(d.Q.PendingOffers,JSON.stringify(e))}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=E.FA.NOT_ACTIVATING;return null!=e&&(t=E.FA[E.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 m;return t.productBingUrl=e.productUrl,t.productRetailerUrl=e.destinationUrl,t.imageUrl=e.imageUrl,t.domain=e.domain,"Storewide"===e.scope||"LdClickDataStorewide"===e.scope||"LdClickData"===e.scope?t.cashbackType=n.hB.PCBStorewide:(t.cashbackProductTitle=e.scope,t.cashbackType=n.hB.SPBorPPCashback),t.minPurchaseValue=e.minPurchaseValue,t.cashbackAmount=new A(Number.parseFloat(e.commissionValue),e.adsCurrencySymbol),t.expireTimeEpoch=e.expireTimeEpoch,t.productPrice=void 0,t.description=void 0,t.visibilityFeedbackUrl=void 0,t}}var x=w;class U{constructor(e,t){(0,o.Z)(this,"currentUrlMasked",void 0),(0,o.Z)(this,"cashbackDAO",void 0),(0,o.Z)(this,"personalDataRemover",void 0),(0,o.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(),i=this.cashbackDAO.isAADLinkedAccountValid(),o=this.cashbackDAO.isEdgeRebateUser();return t&&e?i?n.qx.LinkedAAD:n.qx.LinkableAAD:o?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 M=i(12727),L=i(69698);class B{constructor(e,t,i){(0,o.Z)(this,"logModule",void 0),(0,o.Z)(this,"flyoutData",void 0),(0,o.Z)(this,"pageHandlerModule",void 0),(0,o.Z)(this,"stateManagement",void 0),(0,o.Z)(this,"storageHandler",void 0),(0,o.Z)(this,"utilities",void 0),(0,o.Z)(this,"cashbackContext",void 0),(0,o.Z)(this,"cashbackAvailableScenarioService",void 0),(0,o.Z)(this,"cashbackDAO",void 0),(0,o.Z)(this,"personalDataRemover",void 0),(0,o.Z)(this,"cashbackUIService",void 0),(0,o.Z)(this,"cashbackFastInitializer",void 0),this.logModule=i.logModule,this.pageHandlerModule=i.pageHandlerModule,this.stateManagement=e,this.flyoutData=t,this.utilities=i,this.storageHandler=i.storageHandler,this.stateManagement.addEventListener(r.e1.StyleProcessingState,(e=>{}))}getActivationService(){return new class{constructor(e,t,i,a,r,n,s){(0,o.Z)(this,"pageHandlerModule",void 0),(0,o.Z)(this,"storageHandler",void 0),(0,o.Z)(this,"localizedStringsData",void 0),(0,o.Z)(this,"loggerService",void 0),(0,o.Z)(this,"cashbackContext",void 0),(0,o.Z)(this,"stateManagement",void 0),(0,o.Z)(this,"cashbackDao",void 0),this.pageHandlerModule=e,this.storageHandler=t,this.localizedStringsData=i,this.loggerService=a,this.cashbackContext=r,this.cashbackDao=n,this.stateManagement=s}listenForCashbackStateChange(e,t){new Map([[r.e1.rebatesNotActivating,n.VS.NonActivated],[r.e1.rebatesSignInPendingSuccess,n.VS.Activating],[r.e1.onRebatesTelemetrySuccess,n.VS.Activated],[r.e1.rebatesSignInFail,n.VS.Failed],[r.e1.rebatesFetchUserInfoFail,n.VS.FetchUserInfoFailed],[r.e1.activatingSPBPDPCashback,n.VS.Activating],[r.e1.spbPdpCashbackActivated,n.VS.Activated]]).forEach(((i,o)=>{this.stateManagement.addEventListener(o,(()=>{e.cashbackState=i,t(),this.loggerService.Log(`Cashback state changed - ${i}`,g.xu.CashbackInfo,void 0)}))}))}getActivateCashbackLocalizedText(e){let t;const i=this.cashbackContext.getCurrentUserType();if(e.cashbackState===n.VS.Activated?t=i===n.qx.LinkableAAD?this.localizedStringsData.pcbLinkMsaActivateButton:e.cashbackType===n.hB.Storewide?this.localizedStringsData.cbActivatedButton:e.cashbackType===n.hB.PCBStorewide?i===n.qx.NonRebateUser?this.localizedStringsData.gcbSigninToClaim:this.localizedStringsData.cbActivatedButton:h.R.isExperimentActive(p.H.spbShortNotification)&&e.cashbackType===n.hB.SPBSearchCashback||e.cashbackType===n.hB.SPBPDPCashback?this.localizedStringsData.cbActivatedButton:this.localizedStringsData.cbCashbackButtonActivated:e.cashbackState===n.VS.Activating&&e.cashbackType===n.hB.SPBPDPCashback?t=this.localizedStringsData.cbPdpProcessing:e.cashbackState===n.VS.Activating?t=this.localizedStringsData.cbProcessing:e.cashbackState===n.VS.Failed&&(a.Z.IsMobile()||h.R.isExperimentActive(p.H.enableAffiliateActivationStatusUpdate))||e.cashbackState===n.VS.FetchUserInfoFailed&&(a.Z.IsMobile()||h.R.isExperimentActive(p.H.enableAffiliateActivationStatusUpdate))?t=this.localizedStringsData.cbFailedRetry:e.cashbackState===n.VS.NonActivated&&(i===n.qx.LinkableAAD?t=this.localizedStringsData.pcbLinkMsaActivateButton:i===n.qx.NonRebateUser?t=e.cashbackType===n.hB.PCBStorewide?this.localizedStringsData.gcbSigninToClaim:this.localizedStringsData.cbBingActivateButton:i!==n.qx.Rebate&&i!==n.qx.LinkedAAD||(e.cashbackType===n.hB.SPBSearchCashback||e.cashbackType===n.hB.SPBPDPCashback?t=h.R.isExperimentActive(p.H.spbShortNotification)||e.cashbackType===n.hB.SPBPDPCashback?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}async activateCashback(e,t,i){const o=this.cashbackContext.getCurrentUserType();if(this.logUserClick(e,t,i),o===n.qx.NonRebateUser)this.pageHandlerModule.RecordAsUserAction(s.bS.ACTIVATE_CASHBACK_NEW),this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CASHBACK_NEW,i),this.pageHandlerModule.ActivateRebates(!0);else if(o===n.qx.LinkableAAD)this.linkUser();else if(t.cashbackState===n.VS.FetchUserInfoFailed&&(a.Z.IsMobile()||h.R.isExperimentActive(p.H.enableAffiliateActivationStatusUpdate)))this.pageHandlerModule.RetryFetchUserInfo(!0);else if(t.cashbackType===n.hB.Storewide)await this.activateStorewideCashback(t,i);else if(t.cashbackType===n.hB.PCBStorewide);else if(t.cashbackType===n.hB.SPBPDPCashback||t.cashbackType===n.hB.SPBSearchCashback){const e=t.cashbackType===n.hB.SPBSearchCashback;await this.activateOffer(t,i,e);const o=new Date;t.expireTimeEpoch=o.getTime()/1e3+86400}}logUserClick(e,t,i){const o=this.cashbackContext.getCurrentUserType(),a=this.getActivateCashbackLocalizedText(t).replace(" ","").toLowerCase();let r="";t?.isBlossom&&(r+="bloossom;"),t?.is3xIncentive&&(r+="3xIncentive;");const n=this.cashbackContext.getCurrentPageType(),s=this.cashbackContext.getCurrentUrl(),c=this.cashbackDao.isPane()?"Cashback shoreline button click":"Cashback notification button click",l=e,u=new C.Z(l,S.r.ITEMIZED_CASHBACK);u.Metadata=JSON.stringify({viewName:e,buttonName:a,cashBack:t,userType:o,additionalInfo:r,pageType:n,pageUrl:s}),this.loggerService.LogInfoWithEvenType(c,g.R.ButtonClick,u)}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 i=!!t;this.storageHandler.setStorageBool(d.Q.GroceryInstantAddToCartSpb,i),this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CLICK_SPB_CASHBACK,t),this.activateOffer(e,t,!1)}async activateOffer(e,t,i){if(!e.productBingUrl)return;const o=!this.cashbackDao.getFeatureFlagEnabledByDefault("spbBackgroundActivation");await(0,l._R)(10),i||o?(e.cashbackState=n.VS.Activated,this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CLICK_SPB_CASHBACK,t),this.pageHandlerModule.NavigateToUrl(e.productBingUrl)):this.makeBackgroundActivation(e,t)}async activateStorewideCashback(e,t){const i=this.cashbackContext.getCurrentUserType();i===n.qx.Rebate||i===n.qx.LinkedAAD?(this.pageHandlerModule.RecordAsUserAction(s.bS.ACTIVATE_CASHBACK),this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CASHBACK,t),a.Z.IsMobile()||h.R.isExperimentActive(p.H.enableAffiliateActivationStatusUpdate)||(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),a.Z.IsMobile()||h.R.isExperimentActive(p.H.enableAffiliateActivationStatusUpdate)||(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.cashbackState=n.VS.Activating,!e.productBingUrl)return;const i=new CustomEvent(r.e1.activatingSPBPDPCashback);this.stateManagement.dispatchEvent(i);const o=this.pageHandlerModule.NavigateToUrlBackgroundWithResult(e.productBingUrl,e.productBingUrl,!0),a=this.cashbackDao;o.then((async i=>{const o=i.result,s=(0,u.rm)(o);if(s){if(!e.productBingUrl)return void this.loggerService.LogError("Failed to make background activation probuct url is absent "+JSON.stringify(e));const i=this.getValueFromUrl(s.destinationUrl,"msclkid"),o=this.getValueFromUrl(e.productBingUrl,"ld");a.saveActivatedCashback(e),this.pageHandlerModule.RefreshDealsResponse(o,i,!1),this.pageHandlerModule.UpdateLoadTimeData(),this.pageHandlerModule.RecordAsUserEngagement(c.FV.ACTIVATE_CLICK_SPB_CASHBACK,t),e.cashbackState=n.VS.Activated;const l=new CustomEvent(r.e1.spbPdpCashbackActivated);this.stateManagement.dispatchEvent(l)}else this.loggerService.LogError("Failed to make background activation server response is absent")})).catch((e=>{this.loggerService.LogError("Failed to make background activation "+e)}))}getValueFromUrl(e,t){const i=e.split("?");if(i.length<=1)return"";const o=[];i.forEach((e=>{const t=e.split("&");o.push(...t)}));for(const e of o){const i=e.split("=");if(2===i.length&&i[0]===t)return i[1]}return""}}(this.pageHandlerModule,this.storageHandler,this.flyoutData.strings,this.getCashbackLogger(),this.getCasbackContext(),this.getCashbackDAO(),this.getStateManagementModule())}getCashbackFastInitializer(){return this.cashbackFastInitializer||(this.cashbackFastInitializer=new L.Op(this.getCashbackUIService())),this.cashbackFastInitializer}getPersonalDataRemover(){return this.personalDataRemover||(this.personalDataRemover=new M.Z(this.getCashbackDAO())),this.personalDataRemover}getCashbackUIService(){return this.cashbackUIService||(this.cashbackUIService=new class{constructor(e,t,i){(0,o.Z)(this,"utilities",void 0),(0,o.Z)(this,"flyoutData",void 0),(0,o.Z)(this,"loggerService",void 0),this.utilities=e,this.flyoutData=t,this.loggerService=i}applyStylesToShoppingSection(e){this.utilities.applyStyles(this.flyoutData.common.shopping,e,y.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(e){const t=this.utilities.getFavIconSrc(this.flyoutData.common.domain,e);if(!t||""===t){const e={domain:this.flyoutData.common.domain};this.loggerService.LogError("Icon not found",e)}return t}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 i="0h 00m";if(t>0){const e=t/1e3/60,o=e/60,a=Math.floor(o/24),r=a>0?` ${a} days `:"",n=Math.floor(o-24*a),s=Math.floor(e-24*a*60-60*n);return i=`${r} ${n>0?n:0}h ${s>0?s:"00"}m`,i}return this.loggerService.LogError("Unable to calc expire time "),"Expires soon"}querySelector(e){return document.querySelector(e)}querySelectorAll(e){return document.querySelectorAll(e)}getMerchantFullName(){const e=this.flyoutData.dataStoreModule.CashBackData?.merchantFullName?this.flyoutData.dataStoreModule.CashBackData?.merchantFullName:this.flyoutData.common.domain;return e?e[0].toUpperCase()+e.substr(1).toLowerCase():e}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 x(this.flyoutData.dataLoader,this.pageHandlerModule,this.storageHandler,this.getCashbackLogger())),this.cashbackDAO}getCasbackContext(){return this.cashbackContext||(this.cashbackContext=new U(this.getCashbackDAO(),this.getPersonalDataRemover())),this.cashbackContext}getCashbackAvailableScenarious(){return this.cashbackAvailableScenarioService||(this.cashbackAvailableScenarioService=new class{constructor(e,t,i,a,r){(0,o.Z)(this,"validBlossomStatus",new Set([v.OfferClaimed,v.EligibleUser,v.PayoutCompleted])),(0,o.Z)(this,"cashback",void 0),(0,o.Z)(this,"cashbackActivated",!1),(0,o.Z)(this,"loggerService",void 0),(0,o.Z)(this,"cashbackDAO",void 0),(0,o.Z)(this,"cashbackContext",void 0),(0,o.Z)(this,"pageHandler",void 0),(0,o.Z)(this,"popupOrigination",void 0),(0,o.Z)(this,"viewName",void 0),(0,o.Z)(this,"scenariosRendered",new Set),(0,o.Z)(this,"date",void 0),this.loggerService=e,this.cashbackDAO=t,this.cashbackContext=i,this.pageHandler=a,this.popupOrigination=this.pageHandler.PopupOrigination,this.date=r}async LogNotificationPopupLatency(e){if(this.cashbackDAO.isPane())return;let t="general";const i=this.cashbackContext.getCurrentUserType(),o=this.cashbackContext.getCurrentPageType(),a=this.cashbackContext.getCurrentUrl();"SpbPDPV2"!==e&&"OldArchitecturePDPUX"!==e||(t="cpsSPBPDPLatency");const r=this.date.getTime();let n=(await this.cashbackDAO.getLatencyData())[t];if(n){n=new T.Z(n.requestSentTime,n.requestReceivedTime,n.notificationTriggeredTime,r);const t={viewName:e,latencyData:n,buttonName:"none",userType:i,pageType:o,pageURL:a};this.loggerService.Log("Notification latency data",g.xu.UnifiedCashBackNotificationLatency,P.g.CouponImpressionId,t)}}notifyScenarioRendered(e){this.scenariosRendered.add(e)}getStorewideCashbackExclusions(){return this.cashbackDAO.getAffiliateExclusions()}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,i){this.LogButtonClick(e,t,void 0,"button was clicked"),this.cashbackDAO.setShouldExpandDetails(i),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 i=e[t];if(i.category?.toLowerCase().includes(f.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,P.g.CouponImpressionId),e)return this.cashbackDAO.ResetBlossomNotificationFlag(),!0}return!1}changeToJSformatUrl(e){try{if(e&&(0,l.UE)(e)){const t=new URL(e);t.searchParams.sort();let i=t.toString();return i=i.replace(/\#/gi,"%23"),i}return e}catch(t){return this.loggerService.LogError(`Failed to chage format for url ${e}`,{url:e}),e}}async getSPBPDPOffer(){const e=this.cashbackDAO.getSpbPdpOffer();if(e){e.cashbackType=n.hB.SPBPDPCashback,e.cashbackState=n.VS.NonActivated;const i=this.cashbackDAO.getActivatedOffers();for(var t of i)t.cashbackProductTitle===e?.cashbackProductTitle&&(e.cashbackState=n.VS.Activated,e.expireTimeEpoch=t.expireTimeEpoch);const o=await this.cashbackDAO.getRecentActivatedCashback();if(!e?.expireTimeEpoch&&(0,l.UE)(e?.cashbackProductTitle)&&(0,l.UE)(o)&&o===e?.cashbackProductTitle){const t=new Date;e.cashbackState=n.VS.Activated,e.expireTimeEpoch=t.getTime()/1e3+86400}}return 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 i=this.cashbackContext.getCurrentUserType();"confirmationPage"===e?this.loggerService.Log("User saw confirmation notification, new UX",g.xu.RebatesConfirmationNotification,P.g.CouponImpressionId):"PCBconfirmationPage"===e&&this.loggerService.Log("User saw confirmation notification, new UX",g.xu.PersonalizedCashbackConfirmationNotification,P.g.CouponImpressionId);let o="";t?.isBlossom&&(o+="bloossom;"),t?.is3xIncentive&&(o+="3xIncentive;");const a=this.cashbackContext.getCurrentPageType(),r=this.cashbackContext.getCurrentUrl(),n=this.cashbackDAO.isPane()?g.xu.UnifiedCashBackShorelineModule:g.xu.UnifiedCashBackNotificationModule,s={viewName:e,buttonName:"none",cashback:t,userType:i,additionalInfo:o,pageType:a,pageUrl:r};this.loggerService.Log("Cashback was shown",n,P.g.CouponImpressionId,s)}LogComponentView(e,t){const i=`${t} was viewed`,o=this.cashbackContext.getCurrentUserType(),a=this.cashbackContext.getCurrentPageType(),r=this.cashbackContext.getCurrentUrl(),n=this.cashbackDAO.isPane()?g.xu.UnifiedCashBackShorelineModule:g.xu.UnifiedCashBackNotificationModule,s={viewName:e,componentName:t,userType:o,pageType:a,pageUrl:r,popupOrigination:this.pageHandler.PopupOrigination};this.loggerService.Log(i,n,P.g.CouponImpressionId,s)}async getPersonalizedOfferHero(){const e=this.cashbackDAO.getRecentActivatedOffer(),t=await this.getSPBPDPOffer();if(t?.cashbackProductTitle!==e?.cashbackProductTitle){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(),i=this.storewideOfferAvailable()||t&&t.length>0||e;return this.loggerService.LogDebugInfo(`Any scenario avaiable ${i}`),i}storewideOfferAvailable(){return void 0!==this.cashbackDAO.highestCashbackCategory()}getStoreWideOffer(){if(!this.cashbackDAO.getFeatureFlagEnabledByDefault("edge.affiliateoffer.module"))return;if(this.scenariosRendered.has("CouponPlusCashback"))return;const e=new m,t=this.cashbackDAO.highestCashbackCategory(),i=this.cashbackDAO.storewideCategories(),o=this.cashbackDAO.isStorewideCashBackActivated(),a=this.cashbackDAO.getActivateRebateStatus();return i&&t?(e.cashbackType=n.hB.Storewide,o||a===E.FA.ACTIVATED||a===E.FA.PENDING_ACTIVATION_IN_PROFILE?e.cashbackState=n.VS.Activated:e.cashbackState=n.VS.NonActivated,t&&(e.cashbackCategories=i,e.cashbackAmount=new A(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}}}getCurrentPageActivatedOffers(){let e=this.cashbackDAO.getActivatedOffers();e.forEach((e=>{e.cashbackState=n.VS.Activated}));const t=this.cashbackDAO.getSpbPdpOffer();return e=e.filter((e=>e.cashbackProductTitle!==t?.cashbackProductTitle)),e}async callContextualCashbackVisibilityBeacon(){const e=await this.cashbackDAO.getContextualCashbackVisibilityBeacon();if(e){const t=new Image(1,1);t.src=e,t.onload=t.onerror=()=>document.body.removeChild(t),document.body.appendChild(t)}}async pushActivationPendingOffer(e){const t=await this.cashbackDAO.getPendingOffers(),i=new Set(t);i.add(e),this.cashbackDAO.setPendingOffers([...i])}async getAllActivatedOffers(){const e=this.cashbackDAO.getMuid(),t=I.v.getInstance(),i=await t.FetchCashbackTransactions(e,!1,this.pageHandler);return i?.activatedOffers??[]}async getContextualOffers(){const[e,t,i,o]=await Promise.all([this.getAllActivatedOffers(),this.cashbackDAO.getPendingOffers(),this.cashbackDAO.getContextualOffers(),this.cashbackDAO.getContextualCashbackImpressionBeacon()]);if(o){const e=new Image(1,1);e.src=o,e.onload=e.onerror=()=>document.body.removeChild(e),document.body.appendChild(e)}const a=t?.filter((t=>{const i=new URL(t).searchParams.get("rlink"),o=decodeURIComponent(i??"");return!e.some((e=>e.productUrl===o))}))??[];return this.cashbackDAO.setPendingOffers(a),(i?.filter((t=>{const i=new URL(t.adsOffer.url??"").searchParams.get("rlink"),o=decodeURIComponent(i??"");return!e.some((e=>e.productUrl===o))}))??[]).map((({imageUrl:e,adsOffer:i,expiryDate:o,id:a,brand:r})=>({imageUrl:e,productUrl:i.url??"",scope:`${r} - ${i.name??""}`,commissionValue:i.promotionInformation?.rebateValue.toString()??"",commissionType:"flat",expireTimeEpoch:Number(o),domain:i.url??"",minPurchaseValue:i.promotionInformation?.minPurchaseValue.toString()??"",destinationUrl:i.url??"",globalOfferId:a,adsCurrencySymbol:i.currencySymbol??"$",merchantName:r,isActivated:t.includes(i.url??"")})))}async getSearchSpbOffersForCurrentPage(){const e=this.cashbackContext.getCurrentUrl(),t=this.changeToJSformatUrl(e),i=await this.cashbackDAO.getSearchSpbOffers(),o=this.changeToJSformatUrl(i.requestedForSearchUrl);return i.cashbackItems&&i.cashbackItems.length>0&&o!==t?(this.loggerService.LogDebugInfo(`spb search not shown due to diffrent url ${i.requestedForSearchUrl} and ${t}`),Promise.resolve([])):(i.cashbackItems.forEach((e=>{e.cashbackState=n.VS.NonActivated,e.cashbackType=n.hB.SPBSearchCashback})),i.cashbackItems)}getCashbackTransactions(){return this.cashbackDAO.getCashbackTransactions()}async spbSearchScenarioAvailable(){const e=await this.getSearchSpbOffersForCurrentPage();return!!(e&&e.length>0)}LogButtonClick(e,t,i,o="",a){const r=this.cashbackContext.getCurrentUserType(),n=this.cashbackDAO.isPane()?"Cashback shoreline button click":"Cashback notification button click",s=this.cashbackContext.getCurrentUrl(),c=e,l=new C.Z(c,S.r.ITEMIZED_CASHBACK);l.Metadata=JSON.stringify({viewName:e,buttonName:t,message:o,cashback:i,userType:r,pageUrl:s,componentName:a}),this.loggerService.LogInfoWithEvenType(n,g.R.ButtonClick,l)}}(this.getCashbackLogger(),this.getCashbackDAO(),this.getCasbackContext(),this.pageHandlerModule,new Date)),this.cashbackAvailableScenarioService}getCashbackLogger(){return new class{constructor(e){(0,o.Z)(this,"logModule",void 0),this.logModule=e}Log(e,t,i,o){const a=new O.Z(t);a.Metadata=JSON.stringify(o),this.logModule.LogInfoEvent(g.R.EdgeFlyoutStatus,e,a,i)}LogButtonClick(e,t,i,o,a,r){const n=new C.Z(t,this.GetShoppingContentType(i,o));n.Metadata=JSON.stringify(r),this.logModule.LogInfoEvent(g.R.ButtonClick,e,n,a)}LogDebugInfo(e,t){const i=new O.Z(g.xu.UnifiedCashBackDebugLog);i.Metadata=JSON.stringify(t),this.logModule.LogInfoEvent(g.R.EdgeFlyoutStatus,e,i)}LogError(e,t){const i=new O.Z(g.xu.UnifiedCashBackDebugLog);i.Metadata=JSON.stringify({user:void 0,componentData:t}),this.logModule.LogErrorEvent(g.R.EdgeFlyoutStatus,e,i)}LogInfo(e,t){throw new Error("Method not implemented.")}LogInfoWithEvenType(e,t,i){this.logModule.LogInfoEvent(t,e,i)}GetShoppingContentType(e,t){return"SPBSearchV1"===e||"SPBSearchV2"===e||"SpbPDPV2"===e||"SpbPDP"===e?S.r.ITEMIZED_CASHBACK:"CASHBACK_DASHBOARD"==e?S.r.CASHBACK_DASHBOARD:"NonActivated"===t?S.r.REBATES_ACTIVATE_CASHBACK:"Activated"===t?S.r.CASHBACK_RETAILER:S.r.UNIFIED_SHOPPING_NOTIFICATION}}(this.logModule)}static didBaseURLChange(e,t){return e!==t&&(!e||!t||new URL(e).origin!==new URL(t).origin)}static initFactory(e,t,i){const o=this.instance?.cashbackContext?.getCurrentUrl(),a=t.dataStoreModule.CashBackData?.lastCommittedURL,r=this.didBaseURLChange(o,a),n=this.instance?.flyoutData.dataLoader.GetLoadTimeDataValue("couponsApiResponse",""),s=n!==t.dataLoader.GetLoadTimeDataValue("couponsApiResponse","");return(!this.instance||r||s)&&(this.instance=new B(e,t,i)),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,o.Z)(B,"instance",void 0);var F=B},42544:function(e,t,i){var o=i(72370);t.Z=class{constructor(e){(0,o.Z)(this,"category",void 0),(0,o.Z)(this,"commissionType",void 0),(0,o.Z)(this,"commissionValue",void 0),(0,o.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,i){var o=i(72370),a=i(4872),r=i(31656),n=i(93209),s=i(59645),c=i(11232),l=i(40843),u=i(19384),d=i(5144),h=i(88767),p=i(55590),g=i(36493),C=i(33491),S=i(91495),m=i(91897),A=i(27689),f=i(81687);function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function E(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}const P=["ja-jp","de-de","en-gb","en-ca","en-in","fr-fr","it-it","es-es","es-mx"];class I{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("."),i=t.length<3?t[0]:t[1];return`${i[0].toUpperCase()}${i.substring(1)}`}catch(t){return e}}static GetStrippedTitle(e,t){const i=new RegExp(`[\\s\\W]*${t}[\\s\\W]*`,"gi");return e?.replace(i,"")}static GetStrippedUrl(e){const t=I.getDomainFromUrl(e)?.toLocaleLowerCase();return"amazon"===t?e.replace(/\/ref=[A-z0-9_]+/,""):e}static isSameUrl(e,t){return(e=I.GetStrippedUrl(e))===I.GetStrippedUrl(t)}static isSameUrlByPathName(e,t){if(I.isSameUrl(e,t))return!0;try{const i=new URL(I.GetStrippedUrl(e.toLowerCase())),o=new URL(I.GetStrippedUrl(t.toLowerCase()));return i.origin===o.origin&&i.pathname===o.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 i=new URL(e.ProductUrl??e.productUrl);return new URL(t.ProductUrl??t.productUrl).hostname===i.hostname}catch{}return!1}static async IsTrackedProductForAOC(e){const t=I.getUrlAndProductToMap(S.Q.UrlToProductMap)?.[e];let i=[];const o=(0,A.Ad)(S.Q.TrackedProductsData??"{}");if(i=o?.trackedProducts??[],t)return i?.find((e=>I.IsSameProduct(e,t)));if(i){let t=!0;for(const o of i){if(I.isSameUrl(o.ProductUrl,e))return o;I.isSameUrlByPathName(o.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,i=new Date(e.expirationDate??"");return"Invalid Date"===i.toString()||(e.expirationDate?.endsWith("Z")||i.setMinutes(i.getMinutes()-t.getTimezoneOffset()),+i<+t)}static getUrlAndProductToMap(e){if(!e)return{};let t={};return t=(0,A.Ad)(e),t||(t={}),t}constructor(e,t,i){this.flyoutData=t,this.stateManagement=i,(0,o.Z)(this,"pageHandlerModule",void 0),(0,o.Z)(this,"logModule",void 0),(0,o.Z)(this,"telemetryUtilities",void 0),(0,o.Z)(this,"utilities",void 0),(0,o.Z)(this,"storageHandler",void 0),(0,o.Z)(this,"anid",void 0),(0,o.Z)(this,"dealsEndpoint","https://www.bing.com/api/shopping/v1/savings"),(0,o.Z)(this,"trackedProductsCachePeriod",12e5),(0,o.Z)(this,"anidTrackingDataCachePeriod",864e5),(0,o.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 r.R.isExperimentActive(a.H.PTEmail)&&!e}async shouldRenderProductCollections(e){let t=!1;const i=r.R.isExperimentActive(a.H.productTracking),o=this.flyoutData.common.market?.toLowerCase()??"",n="en-us"===o||!o,s=await this.GetLocalProductTrackingData(),c=e?.toLocaleLowerCase().includes("amazon."),l=c&&P.includes(o);return s&&s?.trackedProducts?.length>0&&(t=!0),Promise.resolve((i||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 i="";if(this.pageHandlerModule.IsMessageAllowed("getEdgeAnid")&&(i=(await this.pageHandlerModule.GetEdgeAnid(!0))?.anid,!i))return!1;if(t&&t.IsAnidTrackingConsented)return!0;const o=await this.GetAnidProductTrackingData(i),a=o?.trackingPreferences?.IsAnidTrackingConsented,r=await this.GetLocalProductTrackingData();o?.trackingPreferences&&this.storageHandler.setStorageString(p.Q.ProductTrackingConsentStatus,JSON.stringify({IsAnidTrackingConsented:!!a,timestamp:Date.now()}));const n=a||void 0===a&&0===r?.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),i=t?.trackingPreferences?.IsAnidTrackingConsented,o=await this.GetLocalProductTrackingData();return e&&!i&&o?.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),i=(0,A.Ad)(t);return i?.banner===e&&Date.now()-i.timestamp<2*m.nQ}static isSupportedDomainForPrice(e,t,i){const o=t?.isUnsupportedDomain;if(!0===o)return!1;i=i?.toLowerCase();const n=r.R.isExperimentActive(a.H.productTracking),s="en-us"===i||!i,c=e?.toLocaleLowerCase().includes("amazon."),l=c&&P.includes(i);return n||s||l}static isSupportedDomainAOC(e,t,i){return this.isSupportedDomainForPrice(e,t,i)}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"),i=new l.Z(t?.productTrackingData);return i.timestamp=Date.now().toString(),this.storageHandler.setStorageString(p.Q.ProductTrackingAnidData,JSON.stringify(i)),i}async TrackProduct(e,t,i,o){const a=await this.createTrackProductBody(e,this.flyoutData.common,t,i,o);if(!a){const a=new s.Z(d.xu.ProductTrackingDebug);return a.Metadata=JSON.stringify({product:e,isOutOfStock:t,duration:i,priceDrop:o}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,"Failed to track product. Invalid product data",a),null}try{const t=await this.createRequest("track",a);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 i=new s.Z(d.xu.ProductTrackingNetworkError);i.Metadata=JSON.stringify({product:e,err:t,productRequest:a}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Track product request failed: ${t}`,i)}return null}async TrackProductLocal(e){if(!e)return[];let t=await this.GetLocalProductTrackingData();if(t&&Array.isArray(t.trackedProducts)){const i=t.trackedProducts.findIndex((t=>I.IsSameProduct(t,e)));-1===i?t.trackedProducts.push(e):t.trackedProducts[i]=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 i=await this.createRequest("untrack",t);if(this.GetLocalProductTrackingDataFromEndpoint(),!i.success)throw new Error(i.errorCode||i.errorMessage);return await this.removeProductFromUrlProductsMap(e.ProductUrl),i.success}catch(i){const o=new s.Z(d.xu.ProductTrackingNetworkError);o.Metadata=JSON.stringify({product:e,err:i,productRequest:t}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Untrack product request failed: ${i}`,o)}return!1}async UntrackProductLocal(e){if(!e)return[];const t=await this.GetLocalProductTrackingData();return t?(t.trackedProducts=(t?.trackedProducts||[]).filter((t=>!I.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,i=(await this.pageHandlerModule.GetEmailForMSA(!0))?.email,o={Muid:t,Anid:e,Email:i};try{const t=await this.createRequest("roam-products",o);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,i,o){if(!e||!t)return!1;try{let a;a=o?{Muid:e,ProductUrl:t,IdenticalProduct:o}:{Muid:e,ProductUrl:t};const r=await this.createRequest("log-notification",a,"POST",i);if(!r.success)throw new Error(r.errorCode||r.errorMessage);return!0}catch(i){const o=new s.Z(d.xu.ProductTrackingNetworkError);o.Metadata=JSON.stringify({Url:t,Muid:e,err:i}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,`Log notification request failed: ${i}`,o)}return!1}async GetTrackedProductFromApi(e){const t=await this.getAnid(),i=this.flyoutData.common.muid;try{let o={Muid:i,Url:e};await this.canUseAnidForRequest(t)&&(o={Anid:t,Url:e});const a=await this.createRequest("is-tracked",o);if(!a.success)throw new Error(a.errorCode||a.errorMessage);return a.product}catch(o){const a=new s.Z(d.xu.ProductTrackingNetworkError);return a.Metadata=JSON.stringify({Url:e,Muid:i,Anid:t,err:o}),this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,"Is tracked product request failed",a),null}}async GetTrackedProductsBySource(e){const t=await this.getProductTrackingData(),i=t?.trackedProducts.filter((t=>t.trackingSource===e));return i}async getProductTrackingData(){const e=await this.GetLocalProductTrackingData();return!e||await this.isStaleTrackedProducts(e)?await this.GetLocalProductTrackingDataFromEndpoint():e}async SetProductTrackingData(e,t){const i=e.trackedProducts,o=e.trackingPreferences;if(!i)return[];let a;return a&&Array.isArray(a.trackedProducts)?a.trackedProducts=i:a={trackedProducts:i},o&&(a.trackingPreferences=o),t?a._anid=await this.getAnid():a._muid=this.flyoutData.common.muid,a.timestamp=(new Date).toString(),this.storageHandler.setStorageString(p.Q.ProductTrackingTrackedProducts,JSON.stringify(a)),a.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 i=I.getUrlAndProductToMap(t);if(this.AnidTrackingAvailable()){const e=await this.getAnid();!e&&i.anid&&(i={},this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify({muid:this.flyoutData.common.muid}))),await this.canUseAnidForRequest(e)&&i.muid&&(i={},this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify({anid:e})))}const o=i?.[e];if(o)return o;const a=await this.GetLocalProductTrackingData();let r=!0;if(a?.trackedProducts){for(const t of a.trackedProducts){if(I.isSameUrl(t.ProductUrl,e))return t;I.isSameUrlByPathName(t.ProductUrl,e)&&(r=!1)}if(r)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&&(I.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,i,o,a){const{strings:r}=this.flyoutData;if(!e){const e=new s.Z(d.xu.ProductTrackingDebug);return e.Metadata=JSON.stringify({url:this.flyoutData.common.lastCommittedURL,isOutOfStock:i}),void this.logModule.LogErrorEvent(d.R.EdgeFlyoutStatus,"Product unavailable, unable to track or untrack",e)}const n=new CustomEvent(f.e1.ProductTrackingUpdate);if(t){const t=await this.TrackProduct(e,i,o,a);if(await this.TrackProductLocal(t),t){const e=i?r.productTrackingStockTrackAlert:r.productTrackingPriceTrackAlert;this.stateManagement.dispatchEvent((0,f.eT)({text:e}))}else this.stateManagement.dispatchEvent((0,f.eT)({text:r.productTrackingTrackFailed}))}else{const t=await this.GetTrackedProduct(e.ProductUrl);this.UntrackProductLocal(t),await this.UntrackProduct(e)||this.stateManagement.dispatchEvent((0,f.eT)({text:r.productTrackingUntrackFailed}))}this.stateManagement.dispatchEvent(n)}recordTrackingToggleChange(e,t,i,o,a,r,s){const c=Object.assign({},t,{base64ProductImage:void 0}),l=this.flyoutData.common.openedWith===h.Te.Auto,u=JSON.stringify(E(E({duration:r,priceDropValue:s},c),{},{source:a,isOutOfStock:o,isNotification:l,isPriceFromShoreline:t?.isPriceFromShoreline})),p=new n.Z(e,this.telemetryUtilities.setContentViewed(a),this.flyoutData.common.domain,u),g=`Product ${i?"":"un"}tracked from ${a}`;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[i,o]=e.split("-",2);isNaN(Number(i))||(t.priceDropValue=Number(i)),isNaN(Number(o))||(t.durationValue=Number(o))}return t}resetAlertSettingsPrefs(){(0,C.TJ)("ptAlertSettingsPrefs")}extractExtractedEntityData(e,t,i,o=!1){if(!e)return null;const a=e?.entity??e.product_og_entity,r=a?.image||e.image_url,n=I.GetStrippedTitle(a?.name||e?.title,this.flyoutData.common.domain);let s=a?.price_value||a?.["offers/price"]?.substring(1);if(s||(s=this.flyoutData.dataLoader.GetLoadTimeDataValue("price",void 0)?.toString()??i),n&&(s||t)){const e=new c.Z(n,r,a?.price_currency??"$");return e.price=s||"",e.ProductUrl=this.flyoutData.common.lastCommittedURL,e.isPriceFromShoreline=o,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,i=`tracked-products?muid=${this.flyoutData.common.muid}&trackingSource=5`;await this.canUseAnidForRequest(e)&&(i=`tracked-products?anid=${e}&trackingSource=5`,t=!0);const o=await this.createRequest(i,void 0,"GET"),a=new l.Z(o?.productTrackingData);return a&&this.SetProductTrackingData(a,t),a}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 i=await this.storageHandler.getStorageString(p.Q.ProductTrackingUrlProductCache),o=E(E({},I.getUrlAndProductToMap(i)),{},{[e]:t});this.AnidTrackingAvailable()?o.anid=await this.hasUserConsented()?await this.getAnid():void 0:o.muid=this.flyoutData.common.muid,this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify(o))}async removeProductFromUrlProductsMap(e){const t=await this.storageHandler.getStorageString(p.Q.ProductTrackingUrlProductCache),i=I.getUrlAndProductToMap(t);this.storageHandler.setStorageString(p.Q.ProductTrackingUrlProductCache,JSON.stringify(E(E({},i),{},{[e]:void 0})))}async createRequest(e,t,i="POST",o){const a=this.flyoutData.dataLoader.GetLoadTimeDataValue("enabledservicefeatures",{}),r=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:o??"Extension/UX",EnabledServiceFeatures:JSON.stringify(a),EnabledServiceFeaturesv2:JSON.stringify(r)},method:i});return await n.json()}async createUntrackProductBody(e,t){const i={Currency:e.currency??e.CurrencySymbol,Domain:t.domain,Market:t.market??t.afdMarket,Muid:t.muid,Url:e.ProductUrl},o=await this.getAnid();return await this.canUseAnidForRequest(o)&&(i.Anid=await this.getAnid()),i}async createTrackProductBody(e,t,i,o,a){const r={Currency:e.currency||"$",Domain:t.domain,ImageUrl:e.imageUrl,Market:t.market??t.afdMarket,Muid:t.muid,ProductStockStatus:i?2:1,TrackingType:i?"OutOfStock":"PriceDrop",Title:I.GetStrippedTitle(e.title,t.domain),Url:I.GetStrippedUrl(e.ProductUrl??t.lastCommittedURL)},n=await this.getAnid();await this.canUseAnidForRequest(n)&&(r.Anid=n,r.Muid=t.muid);const s=(0,g.K)(e?.price?.toString()??"");return Number.isNaN(s)||(r.Price=s),o&&(r.DurationInWeeks=o),a&&!i&&(r.DropPercentage=a),r}async isStaleTrackedProducts(e){if(!e)return!0;const{timestamp:t}=e,i=await this.hasUserConsented();if(!i&&e._anid)return!0;if(i&&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=I},56764:function(e,t,i){i.d(t,{g:function(){return o}});let o=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,i){i.d(t,{bS:function(){return o}});let o=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_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_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.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.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,i){i.d(t,{r:function(){return o}});let o=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.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_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.ZERO_STATE="ZERO_STATE",e.UNIFIED_SHOPPING_NOTIFICATION="UNIFIED_SHOPPING_NOTIFICATION",e.CONTEXTUAL_CASHBACK="CONTEXTUAL_CASHBACK",e}({})},84901:function(e,t,i){i.d(t,{FV:function(){return o}});let o=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.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.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.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,i){},33105:function(e,t,i){i.d(t,{q:function(){return o}});let o=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,i){i.d(t,{a:function(){return o}});let o=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}({})},96148:function(e,t,i){i.d(t,{v:function(){return c}});var o=i(72370),a=i(5144),r=i(75434),n=i(59645),s=i(56764);class c{constructor(){(0,o.Z)(this,"CASHBACK_TRANSACTIONS_API_URL","https://www.bing.com/api/shopping/v1/savings/cashback/userTransactions"),(0,o.Z)(this,"API_CALL_TIMEOUT_MS",1e3),(0,o.Z)(this,"cache",void 0),this.cache=null}static getInstance(){return c.instance||(c.instance=new c),c.instance}async FetchCashbackTransactions(e,t,i,o,n=!1){if(n&&(this.cache=null),this.cache)return this.cache;try{const o=i.IsMessageAllowed("getEdgeAnid")?(await i.GetEdgeAnid(!0))?.anid??"":await(0,r.H)(i),a={};let n=!1;if(o)n=!0,a.Anid=o,e&&(a.Muid=e);else{if(t)return null;e&&(a.Muid=e)}const s=await fetch(this.CASHBACK_TRANSACTIONS_API_URL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a),signal:AbortSignal.timeout(this.API_CALL_TIMEOUT_MS)}),c=await s.json();if(!s.ok)throw new Error(`${s.status} - ${s.statusText}: ${JSON.stringify(c,null,2)}`);if(c){c.profile&&(c.profile.availableBalance=Math.max(c.profile.availableBalance,0));const e={isSignedIn:n,profile:c.profile,enrolled:c.enrolled,formattedTransactions:c.formatted_Transactions,activatedOffers:c.activatedOffers?.adsCashback,totalTransactions:c.totalTransactions,topCashbackOffers:c.topCashbackOffers};return this.cache=e,e}}catch(e){o&&this.logError(o,"Visual search failed",this.CASHBACK_TRANSACTIONS_API_URL,"",a.xu.CashbackDataFetchError,e)}return null}logError(e,t,i,o,r,c){const l=this.createErrorMessage(t,i,o,c);e.LogErrorEvent(a.R.EdgeFlyoutStatus,l,new n.Z(r),s.g.EdgeImpressionId)}createErrorMessage(e,t,i,o){return JSON.stringify({message:o?`${e} | ${o}`:e,url:t,requestBody:i})}}(0,o.Z)(c,"instance",void 0)},64106:function(e,t,i){i(5144),i(88767)},21908:function(e,t,i){var o=i(72370),a=i(88767),r=i(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,o.Z)(this,"container",void 0),(0,o.Z)(this,"currentFocusElement",void 0),(0,o.Z)(this,"isEdgeDriver",!1),(0,o.Z)(this,"flyoutData",void 0),(0,o.Z)(this,"initialize",((e,t,i)=>{this.container=e,this.isEdgeDriver=t,this.flyoutData=i,this.container.addEventListener("keydown",this.trapFocus)})),(0,o.Z)(this,"removeListeners",(()=>{this.container.removeEventListener("keydown",this.trapFocus)})),(0,o.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 i=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,i),this.flyoutData&&this.flyoutData.common.openedWith===a.Te.Auto&&this.flyoutData.common.popupOrigination===r.sR.AUTO_SHOW_PRICE_HISTORY&&(n+=", #divPriceHistorySection");let o=Array.prototype.slice.call(this.container.querySelectorAll(n));o=o.filter((e=>!i.includes(e))),t.push.apply(t,o),this.isEdgeDriver&&(t=t.filter((e=>"fluent-accordion"!==e.nodeName.toLowerCase()&&e.offsetHeight>0))),this.flyoutData&&this.flyoutData.common.openedWith===a.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 i=t[0];let o=t[t.length-1];for(const e of t)e.classList.contains("checkoutButton")&&(o=e);let a=document.activeElement;if(a){if("divOverlayWrapper"===a.id){const e=a.shadowRoot;e&&(a=e.activeElement)}if(a===i&&e.shiftKey){let t=o?.parentElement?.shadowRoot;if("previousCashBackSection"===o.parentElement?.id){const e=o.parentElement?.parentElement?.shadowRoot;if(e){const i=e.querySelector("fluent-accordion-item");if(i&&!i.classList.contains("expanded")){const e=i.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 o.focus()}else"previousCashBackSection"!==o.parentElement?.id&&(o.focus(),e.preventDefault())}else a!==o||e.shiftKey||(i.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,o.Z)(s,"currentInstance",null),t.Z=s},57549:function(e,t,i){i(4872),i(31656),i(31714),i(12710),i(5144),i(88767),i(73557),i(27689),i(86743),i(27775),i(56764),i(87605),i(2388),i(84901),i(86127),i(81687),i(65302),i(79710)},11542:function(e,t,i){var o=i(88767),a=i(73557);class r{static GetProductIdsFromUrl(e){let t;const i=[];try{t=new URL(e)}catch(e){return i}const o=r.IsPDPURL(t);return o.IsPDP&&0!==o.ProductIds.length?(i.push(...o.ProductIds),i):i}static IsGroceryCashbackNotification(e,t){const i=e===a.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK||e===a.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING;return t===o.Te.Auto&&i}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]+)($|#|\\?)"),i=[];if(t&&t.length>1&&i.push(t[1]),e.searchParams.has("preselect")&&i.push(e.searchParams.get("preselect")||""),i.length>0)return{IsPDP:!0,ProductIds:i}}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=r},75434:function(e,t,i){i.d(t,{F0:function(){return p},H:function(){return h},rm:function(){return g}});var o=i(72370),a=i(4872),r=i(31656),n=i(59645),s=i(5144),c=(i(55590),i(64641),i(56764)),l=(i(87605),i(11542),i(49259));function u(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function d(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?u(Object(i),!0).forEach((function(t){(0,o.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}async function h(e){const t=await e.GetAnid(!0);return t?.anid??""}function p(e,t,i,o,u,h={},p){const g=new n.Z(p||s.xu.GroceryCashbackError),C=function(e,t){const i=void 0!==e?.dataStoreModule?.ICVariations?Object.fromEntries(e.dataStoreModule.ICVariations):{},o=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:o?.getCurrentUrl(),domain:e.common.domain,variations:i,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:r.R.isExperimentActive(a.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:o?JSON.stringify(o):""},C),h),{},{message:i})),t&&t.LogInfoEvent(s.R.EdgeFlyoutStatus,i,g,c.g.CouponImpressionId)}function g(e){try{if(!e)return;return JSON.parse(e)}catch(e){return}}},64550:function(e,t,i){i(5144)},93978:function(e,t,i){i.d(t,{YE:function(){return o}}),new Set(["ar-sa","da-dk","de-de","de-at","de-ch","de-li","el-gr","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,new Set(["da-dk","de-de","de-at","de-ch","de-li","el-gr","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-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"]);const o=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,i){i.d(t,{e1:function(){return c},eT:function(){return l}});var o=i(72370),a=i(59645),r=i(5144),n=i(88767),s=i(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.activatingSPBPDPCashback="activatingSPBPDPCashback",e.spbPdpCashbackActivated="spbPdpCashbackActivated",e.PDPUpdate="PDPUpdate",e.PriceUpdate="PriceUpdate",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.ProductTrackingUpdate="ProductTrackingUpdate",e.ProductTrackingClientUpdate="ProductTrackingClientUpdate",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.WaitingForPDPDataTimeout="WaitingForPDPDataTimeout",e}({});const l=e=>new CustomEvent(c.ToastNotification,{detail:e});class u{constructor(e,t){(0,o.Z)(this,"logModule",void 0),(0,o.Z)(this,"shopping",void 0),(0,o.Z)(this,"renderedModules",void 0),this.logModule=e,this.shopping=t,this.renderedModules=new Set,this.cleanStateMapping(),this.cleanShoppingEventListeners()}clearRefreshTimers(){u.refreshTimers.forEach((e=>{clearTimeout(e)})),u.refreshTimers=new Set}addRefreshTimeout(e){u.refreshTimers.add(e)}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 i=s.g.EdgeImpressionId,o=new a.Z(r.xu.OnErrorInvoked);this.logModule.LogErrorEvent(r.R.EdgeFlyoutStatus,`addEventListener exception: ${e} ${t}`,o,i)}}removeEventListener(e,t){try{this.shopping.removeEventListener(e,t),this.removeShoppingEventListener(e,t)}catch(t){const i=s.g.EdgeImpressionId,o=new a.Z(r.xu.OnErrorInvoked);this.logModule.LogErrorEvent(r.R.EdgeFlyoutStatus,`removeEventListener exception: ${e} ${t}`,o,i)}}dispatchEvent(e){try{this.shopping.dispatchEvent(e)}catch(t){const i=s.g.EdgeImpressionId,o=new a.Z(r.xu.OnErrorInvoked);this.logModule.LogErrorEvent(r.R.EdgeFlyoutStatus,`dispatchEvent exception: ${e?.type} ${t}`,o,i)}}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 a.Z(r.xu.RefreshError),r.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,o.Z)(u,"stateMapping",new Map),(0,o.Z)(u,"wrapperEventListener",new Map),(0,o.Z)(u,"refreshTimers",new Set)},23582:function(e,t,i){var o=i(72370);let a=!1;const r=e=>!!(e instanceof Array&&Object.isFrozen(e)),n=(e,t)=>(e=>{if(r(e)&&e.raw&&r(e.raw)&&e.length===e.raw.length&&1===e.length)return e.join("");if(a)return e.join("");throw new TypeError("Static Types only allows static Template literals")})(t),s={createHTML:n,createScript:n,createScriptURL:n};class c{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(){a=!0}}(0,o.Z)(c,"staticPolicy",window.trustedTypes?window.trustedTypes.createPolicy("shopping-static",s):s),t.Z=c},91221:function(e,t,i){i.d(t,{Z:function(){return S}});var o=i(72370),a=i(64865),r=i(59645),n=i(5144),s=i(91495),c=i(27689),l=i(21650);class u{constructor(){(0,o.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,o.Z)(this,"nullValue",void 0)}static Create(e){const t=new h;return t.nullValue=e.nullValue,t}}var p=h,g=i(96834);class C{static hasNotificationBeenShownRecently(e,t){try{if(void 0===C.storage)return!1;const i=C.storage[e];if(i&&""!==i){const e=(new Date).toUTCString();return new Date(e).getTime()-new Date(i).getTime()<t}return!1}catch(e){return!1}}constructor(e,t,i){let a;(0,o.Z)(this,"pageHandlerModule",void 0),(0,o.Z)(this,"logModule",void 0),(0,o.Z)(this,"storageEmpty",void 0),(0,o.Z)(this,"autoClearedKeySubstrings",void 0),(0,o.Z)(this,"customCleaningKeys",void 0),(0,o.Z)(this,"storageCleanerKey","StorageCleaner"),(0,o.Z)(this,"cleaningSchedule",6048e5),t&&(a=t.GetLoadTimeDataValue("storage",void 0)),this.logModule=i,this.storageEmpty=!1,a?(s.Q.setRawStorageObject(a),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 i=C.storage[e];return(this.storageEmpty||t&&(!i||""===i||null===i))&&(i=await this.pageHandlerModule.GetStorageValue(e),i=i?.value?.stringValue,C.storage[e]=i),i?.value?"string"!=typeof i.value?JSON.stringify(i.value):i.value:"string"!=typeof i?JSON.stringify(i):i||""}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 r.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,i){if(!e||!t)return;let o;if(i)o=i;else{const t=await this.getStorageString(e);if(!(0,a.TF)(t))try{o=JSON.parse(t)??{}}catch(e){}}o&&(o[t]=null,this.setStorageString(e,JSON.stringify(o)))}}(0,o.Z)(C,"storage",[]);var S=C},65302:function(e,t,i){i.d(t,{YU:function(){return r},H6:function(){return s},Pw:function(){return n}}),i(4872),i(31656),i(5144);var o=i(93190),a=i(73557);function r(e){return`${e?.name??""} ${e?.message??""} ${e?.stack??""}`}function n(e){switch(e){case o.p.ATTAINABLE_COUPONS:return a.sR.AUTO_SHOW_ATTAINABLE_COUPONS;case o.p.COUPONS_CLIPPING:return a.sR.AUTO_SHOW_COUPONS_CLIPPING;case o.p.EXCLUSIVE_COUPONS:return a.sR.AUTO_SHOW_SOCIAL_COUPONS;case o.p.GROCERY_ITEMIZED_CASHBACK:return a.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK;case o.p.SPB_CASHBACK_LANDING:return a.sR.AUTO_SHOW_SPB_CASHBACK_LANDING;case o.p.GROCERY_ITEMIZED_CASHBACK_LANDING:return a.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING;case o.p.OTHER_SELLERS_CONFIRMATION:return a.sR.AUTO_SHOW_ITEM_ADDED_TO_CART_FROM_OTHER_SELLER;case o.p.OTHER_SELLERS:case o.p.OTHER_SELLERS_TRIGGER:return a.sR.AUTO_SHOW_OTHER_SELLERS;case o.p.PRINT_GROCERY:return a.sR.AUTO_SHOW_RECOMMENDATIONS;case o.p.PRODUCT_TRACKING_OUT_OF_STOCK:return a.sR.AUTO_PRODUCT_TRACKING_OUT_OF_STOCK;case o.p.REWARDS_GIFT_CARD:return a.sR.AUTO_SHOW_GIFT_CARD;case o.p.AA_CONSENT:return a.sR.AA_CONSENT;default:return null}}function s(e){switch(e){case a.sR.AUTO_SHOW_COUPONS_CHECKOUT:case a.sR.AA_CONSENT:case a.sR.AUTO_SHOW_BING_SEARCH:return a.Ke.COUPONS_CHECKOUT;case a.sR.AUTO_SHOW_URL_PARAM_REBATES:return a.Ke.REBATES_BING;case a.sR.AUTO_SHOW_COUPONS_CLIPPING:return a.Ke.COUPONS_CLIPPING;case a.sR.AUTO_SHOW_LOWER_PRICE_FOUND:case a.sR.AUTO_SHOW_URL_PARAM_PRICE_COMPARISON:return a.Ke.PRICE_COMPARE;case a.sR.AUTO_SHOW_PRICE_HISTORY:case a.sR.AUTO_SHOW_URL_PARAM_PRICE_HISTORY:return a.Ke.PRICE_HISTORY;case a.sR.AUTO_SHOW_REBATES_CONFIRMATION:return a.Ke.REBATES_CONFIRMATION;case a.sR.AUTO_SHOW_REBATES:return a.Ke.REBATES_BING;case a.sR.AUTO_SHOW_REBATES_ORGANIC:case a.sR.AUTO_SHOW_REBATES_ORGANIC_NEW:return a.Ke.REBATES_ORGANIC;case a.sR.AUTO_SHOW_REBATES_CHECKOUT:return a.Ke.REBATES_CHECKOUT;case a.sR.AUTO_SHOW_PERSONALIZED_CASHBACK||a.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_ADDRESSBAR:return a.Ke.PERSONALIZED_CASHBACK;case a.sR.AUTO_SHOW_PERSONALIZED_CASHBACK_CONFIRMATION:return a.Ke.PERSONALIZED_CASHBACK_CONFIRMATION;case a.sR.AUTO_SHOW_EXPRESS_CHECKOUT:return a.Ke.EXPRESS_CHECKOUT;case a.sR.AUTO_SHOW_SERVER_DRIVEN_REWARDS:return a.Ke.REWARDS;case a.sR.AUTO_SHOW_OTHER_SELLERS:case a.sR.AUTO_SHOW_ITEM_ADDED_TO_CART_FROM_OTHER_SELLER:return a.Ke.OTHER_SELLER;case a.sR.AUTO_SHOW_PROFESSIONAL_REVIEWS:return a.Ke.REVIEWS;case a.sR.AUTO_SHOW_SOCIAL_COUPONS:return a.Ke.EXCLUSIVE_COUPONS;case a.sR.AUTO_SHOW_GUEST_DOMAIN_COUPONS:return a.Ke.GUEST_COUPONS;case a.sR.AUTO_SHOW_SUSTAINABILITY_LANDING:return a.Ke.SUSTAINABILITY_LANDING;case a.sR.AUTO_SHOW_SUSTAINABILITY_PURCHASE:return a.Ke.SUSTAINABILITY_PURCHASE;case a.sR.AUTO_SHOW_PACKAGE_TRACKING:return a.Ke.PACKAGE_TRACKING;case a.sR.AUTO_SHOW_ATTAINABLE_COUPONS:return a.Ke.ATTAINABLE_COUPONS;case a.sR.AUTO_SHOW_GIFT_CARD:return a.Ke.REWARDS_GIFT_CARD;case a.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK:return a.Ke.GROCERY_ITEMIZED_CASHBACK;case a.sR.AUTO_PRODUCT_TRACKING_OUT_OF_STOCK:return a.Ke.OUT_OF_STOCK;case a.sR.AUTO_SHOW_VIRTUAL_CARD:return a.Ke.VIRTUAL_CARD;case a.sR.AUTO_SHOW_GROCERY_ITEMIZED_CASHBACK_LANDING:return a.Ke.GROCERY_ITEMIZED_CASHBACK_LANDING;case a.sR.AUTO_SHOW_SPB_CASHBACK_LANDING:return a.Ke.SPB_CASHBACK_LANDING;case a.sR.OPEN_FLYOUT_FROM_EDGE_DRIVER_EC:return a.Ke.EXPRESS_CHECKOUT;case a.sR.AUTO_SHOW_RECOMMENDATIONS:return a.Ke.RECOMMENDATIONS;default:return a.Ke.NONE}}i(56764),i(21597),i(56372),i(29247),i(17675),i(13018),i(12710),i(88767),i(84901),i(86743),i(36493),i(64106),i(79710),i(57549),i(91221),i(1583),i(55590),i(18549),i(91495),i(2388),i(75434),i(64550),i(54380),i(46357),i(87605),i(3960)},79710:function(e,t,i){function o(e,t,i){const o=document.createElement(e);if(t)for(const e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return i&&(o.innerText=i),o}i.d(t,{Ux:function(){return o}}),i(5144),i(27689),i(27775),i(87605)},3960:function(e,t,i){i(5144),i(88767),i(73557),i(81687),i(79710),i(4872),i(31656),i(36493),i(27689),i(23582),i(21908),i(65302)},46357:function(e,t,i){var o;!function(e){e.Right="0",e.Left="1",e.Top="2",e.Bottom="3"}(o||(o={}))},45908:function(e,t,i){function o(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}i.d(t,{gn:function(){return o}})},72370:function(e,t,i){i.d(t,{Z:function(){return a}});var o=i(39316);function a(e,t,i){return(t=(0,o.Z)(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}},82387:function(e,t,i){i.d(t,{Z:function(){return a}});var o=i(25039);function a(e,t){if("object"!==(0,o.Z)(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var a=i.call(e,t||"default");if("object"!==(0,o.Z)(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},39316:function(e,t,i){i.d(t,{Z:function(){return r}});var o=i(25039),a=i(82387);function r(e){var t=(0,a.Z)(e,"string");return"symbol"===(0,o.Z)(t)?t:String(t)}},25039:function(e,t,i){function o(e){return o="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},o(e)}i.d(t,{Z:function(){return o}})},5597:function(e,t,i){i.d(t,{so:function(){return c}});var o=i(2907),a=i(98557),r=i(18438);const n=Object.freeze({locate:(0,r.j8)()}),s={toView(e){return e?"true":"false"},fromView(e){return null!=e&&"false"!==e&&!1!==e&&0!==e}};class c{constructor(e,t,i=t.toLowerCase(),o="reflect",a){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=i,this.mode=o,this.converter=a,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===o&&void 0===a&&(this.converter=s)}setValue(e,t){const i=e[this.fieldName],o=this.converter;void 0!==o&&(t=o.fromView(t)),i!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](i,t),e.$fastController.notify(this.name))}getValue(e){return o.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,i=this.guards;i.has(e)||"fromView"===t||a.SO.queueUpdate((()=>{i.add(e);const o=e[this.fieldName];switch(t){case"reflect":const t=this.converter;a.SO.setAttribute(e,this.attribute,void 0!==t?t.toView(o):o);break;case"boolean":a.SO.setBooleanAttribute(e,this.attribute,o)}i.delete(e)}))}static collect(e,...t){const i=[];t.push(n.locate(e));for(let o=0,a=t.length;o<a;++o){const a=t[o];if(void 0!==a)for(let t=0,o=a.length;t<o;++t){const o=a[t];"string"==typeof o?i.push(new c(e,o)):i.push(new c(e,o.property,o.attribute,o.mode,o.converter))}}return i}}},72171:function(e,t,i){i.d(t,{W:function(){return u}});var o=i(18438),a=i(2907),r=i(2681),n=i(5597);const s={mode:"open"},c={},l=o.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 i=n.so.collect(e,t.attributes),o=new Array(i.length),a={},l={};for(let e=0,t=i.length;e<t;++e){const t=i[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t}this.attributes=i,this.observedAttributes=o,this.propertyLookup=a,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)?r.XL.create(t.styles):t.styles instanceof r.XL?t.styles:r.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,i=t.prototype;for(let t=0,o=e.length;t<o;++t)a.y$.defineProperty(i,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,i){i.d(t,{H:function(){return h}});var o=i(98557),a=i(55208),r=i(2907),n=i(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 a.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 i=t.shadowOptions;if(void 0!==i){const t=e.attachShadow(i);"closed"===i.mode&&s.set(e,t)}const o=r.y$.getAccessors(e);if(o.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,a=o.length;i<a;++i){const a=o[i].name,r=e[a];void 0!==r&&(delete e[a],t[a]=r)}}}get isConnected(){return r.y$.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,r.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 i=e.behaviors;e.addStylesTo(t),null!==i&&this.addBehaviors(i)}}removeStyles(e){const t=l(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.removeChild(e);else if(e.isAttachedTo(t)){const i=e.behaviors;e.removeStylesFrom(t),null!==i&&this.removeBehaviors(i)}}addBehaviors(e){const t=this.behaviors||(this.behaviors=new Map),i=e.length,o=[];for(let a=0;a<i;++a){const i=e[a];t.has(i)?t.set(i,t.get(i)+1):(t.set(i,1),o.push(i))}if(this._isConnected){const e=this.element;for(let t=0;t<o.length;++t)o[t].bind(e,r.Wp)}}removeBehaviors(e,t=!1){const i=this.behaviors;if(null===i)return;const o=e.length,a=[];for(let r=0;r<o;++r){const o=e[r];if(i.has(o)){const e=i.get(o)-1;0===e||t?i.delete(o)&&a.push(o):i.set(o,e)}}if(this._isConnected){const e=this.element;for(let t=0;t<a.length;++t)a[t].unbind(e)}}onConnectedCallback(){if(this._isConnected)return;const e=this.element;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(e,r.Wp);const t=this.behaviors;if(null!==t)for(const[i]of t)i.bind(e,r.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[i]of t)i.unbind(e)}}onAttributeChangedCallback(e,t,i){const o=this.definition.attributeLookup[e];void 0!==o&&o.onAttributeChangedCallback(this.element,i)}emit(e,t,i){return!!this._isConnected&&this.element.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},c),i)))}finishInitialization(){const e=this.element,t=this.boundObservables;if(null!==t){const i=Object.keys(t);for(let o=0,a=i.length;o<a;++o){const a=i[o];e[a]=t[a]}this.boundObservables=null}const i=this.definition;null===this._template&&(this.element.resolveTemplate?this._template=this.element.resolveTemplate():i.template&&(this._template=i.template||null)),null!==this._template&&this.renderTemplate(this._template),null===this._styles&&(this.element.resolveStyles?this._styles=this.element.resolveStyles():i.styles&&(this._styles=i.styles||null)),null!==this._styles&&this.addStyles(this._styles),this.needsInitialization=!1}renderTemplate(e){const t=this.element,i=l(t)||t;null!==this.view?(this.view.dispose(),this.view=null):this.needsInitialization||o.SO.removeChildNodes(i),e&&(this.view=e.render(t,i,t))}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const i=n.W.forType(e.constructor);if(void 0===i)throw new Error("Missing FASTElement definition.");return e.$fastController=new u(e,i)}}function d(e){return class extends e{constructor(){super(),u.forCustomElement(this)}$emit(e,t,i){return this.$fastController.emit(e,t,i)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(e,t,i){this.$fastController.onAttributeChangedCallback(e,t,i)}}}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,i){i.d(t,{SO:function(){return u}});var o=i(18438);const a=o.P3.FAST.getById(1,(()=>{const e=[],t=[];function i(){if(t.length)throw t.shift()}function a(e){try{e.call()}catch(e){t.push(e),setTimeout(i,0)}}function r(){let t=0;for(;t<e.length;)if(a(e[t]),t++,t>1024){for(let i=0,o=e.length-t;i<o;i++)e[i]=e[i+t];e.length-=t,t=0}e.length=0}return Object.freeze({enqueue:function(t){e.length<1&&o.P3.requestAnimationFrame(r),e.push(t)},process:r})})),r=o.P3.trustedTypes.createPolicy("fast-html",{createHTML:e=>e});let n=r;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!==r)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:a.enqueue,processUpdates:a.process,nextUpdate(){return new Promise(a.enqueue)},setAttribute(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i)},setBooleanAttribute(e,t,i){i?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,i){i.d(t,{A:function(){return a},q:function(){return o}});class o{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 i=t.indexOf(e);-1!==i&&t.splice(i,1)}}notify(e){const t=this.spillover,i=this.source;if(void 0===t){const t=this.sub1,o=this.sub2;void 0!==t&&t.handleChange(i,e),void 0!==o&&o.handleChange(i,e)}else for(let o=0,a=t.length;o<a;++o)t[o].handleChange(i,e)}}class a{constructor(e){this.subscribers={},this.sourceSubscribers=null,this.source=e}notify(e){var t;const i=this.subscribers[e];void 0!==i&&i.notify(e),null===(t=this.sourceSubscribers)||void 0===t||t.notify(e)}subscribe(e,t){var i;if(t){let i=this.subscribers[t];void 0===i&&(this.subscribers[t]=i=new o(this.source)),i.subscribe(e)}else this.sourceSubscribers=null!==(i=this.sourceSubscribers)&&void 0!==i?i:new o(this.source),this.sourceSubscribers.subscribe(e)}unsubscribe(e,t){var i;if(t){const i=this.subscribers[t];void 0!==i&&i.unsubscribe(e)}else null===(i=this.sourceSubscribers)||void 0===i||i.unsubscribe(e)}}},2907:function(e,t,i){i.d(t,{LO:function(){return s},Wp:function(){return u},y$:function(){return n}});var o=i(98557),a=i(18438),r=i(55208);const n=a.Bo.getById(2,(()=>{const e=/(:|&&|\|\||if)/,t=new WeakMap,i=o.SO.queueUpdate;let n,s=e=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function c(e){let i=e.$fastController||t.get(e);return void 0===i&&(Array.isArray(e)?i=s(e):t.set(e,i=new r.A(e))),i}const l=(0,a.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 i=this.field,o=e[i];if(o!==t){e[i]=t;const a=e[this.callback];"function"==typeof a&&a.call(e,o,t),c(e).notify(this.name)}}}class d extends r.q{constructor(e,t,i=!1){super(e,t),this.binding=e,this.isVolatileBinding=i,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 i=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const o=this.binding(e,t);return n=i,o}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 i=this.last,o=c(e),a=null===i?this.first:{};if(a.propertySource=e,a.propertyName=t,a.notifier=o,o.subscribe(this,t),null!==i){if(!this.needsRefresh){let t;n=void 0,t=i.propertySource[i.propertyName],n=this,e===t&&(this.needsRefresh=!0)}i.next=a}this.last=a}handleChange(){this.needsQueue&&(this.needsQueue=!1,i(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,i=this.isVolatileBinding(e)){return new d(e,t,i)},isVolatileBinding(t){return e.test(t.toString())}})}));function s(e,t){n.defineProperty(e,t)}const c=a.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,i){i.d(t,{Bo:function(){return r},P3:function(){return o},j8:function(){return n}});const o=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===o.trustedTypes&&(o.trustedTypes={createPolicy:(e,t)=>t});const a={configurable:!1,enumerable:!1,writable:!1};void 0===o.FAST&&Reflect.defineProperty(o,"FAST",Object.assign({value:Object.create(null)},a));const r=o.FAST;if(void 0===r.getById){const e=Object.create(null);Reflect.defineProperty(r,"getById",Object.assign({value(t,i){let o=e[t];return void 0===o&&(o=i?e[t]=i():null),o}},a))}function n(){const e=new WeakMap;return function(t){let i=e.get(t);if(void 0===i){let o=Reflect.getPrototypeOf(t);for(;void 0===i&&null!==o;)i=e.get(o),o=Reflect.getPrototypeOf(o);i=void 0===i?[]:i.slice(0),e.set(t,i)}return i}}Object.freeze([])},85888:function(e,t,i){i.d(t,{v:function(){return o}});class o{createCSS(){return""}createBehavior(){}}},2681:function(e,t,i){i.d(t,{XL:function(){return a}});var o=i(98557);class a{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 r(e){return e.map((e=>e instanceof a?r(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}function n(e){return e.map((e=>e instanceof a?e.behaviors:null)).reduce(((e,t)=>null===t?e:(null===e&&(e=[]),e.concat(t))),null)}a.create=(()=>{if(o.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(o.SO.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),s=(e,t)=>{e.adoptedStyleSheets.push(...t)},c=(e,t)=>{for(const i of t){const t=e.adoptedStyleSheets.indexOf(i);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}class l extends a{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=r(e).map((e=>{if(e instanceof CSSStyleSheet)return e;let i=t.get(e);return void 0===i&&(i=new CSSStyleSheet,i.replaceSync(e),t.set(e,i)),i}))}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 a{constructor(e){super(),this.styles=e,this.behaviors=null,this.behaviors=n(e),this.styleSheets=r(e),this.styleClass="fast-style-class-"+ ++u}addStylesTo(e){const t=this.styleSheets,i=this.styleClass;e=this.normalizeTarget(e);for(let o=0;o<t.length;o++){const a=document.createElement("style");a.innerHTML=t[o],a.className=i,e.append(a)}super.addStylesTo(e)}removeStylesFrom(e){const t=(e=this.normalizeTarget(e)).querySelectorAll(`.${this.styleClass}`);for(let i=0,o=t.length;i<o;++i)e.removeChild(t[i]);super.removeStylesFrom(e)}isAttachedTo(e){return super.isAttachedTo(this.normalizeTarget(e))}normalizeTarget(e){return e===document?document.body:e}}},11127:function(e,t,i){i.d(t,{DesignToken:function(){return y}});var o=i(45908),a=i(85888),r=i(2907),n=i(2816),s=i(98584),c=i(98557),l=i(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),r.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:i}=this.style;if(i){const e=i.insertRule(":host{}",i.cssRules.length);this.target=i.cssRules[e].style}else this.target=null}}(0,o.gn)([r.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 i of S.roots.values())f.getOrCreate(S.normalizeRoot(i)).setProperty(e,t)}removeProperty(e){delete S.properties[e];for(const t of S.roots.values())f.getOrCreate(S.normalizeRoot(t)).removeProperty(e)}static registerRoot(e){const{roots:t}=S;if(!t.has(e)){t.add(e);const i=f.getOrCreate(this.normalizeRoot(e));for(const e in S.properties)i.setProperty(e,S.properties[e])}}static unregisterRoot(e){const{roots:t}=S;if(t.has(e)){t.delete(e);const i=f.getOrCreate(S.normalizeRoot(e));for(const e in S.properties)i.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,f=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 v extends a.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=v.uniqueId(),v.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new v({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 v.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=O.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 v&&(t=this.alias(t)),O.getOrCreate(e).set(this,t),this}deleteValueFor(e){return this._appliedTo.delete(e),O.existsFor(e)&&O.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(u,e),this}subscribe(e,t){const i=this.getOrCreateSubscriberSet(t);t&&!O.existsFor(t)&&O.getOrCreate(t),i.has(e)||i.add(e)}unsubscribe(e,t){const i=this.subscribers.get(t||this);i&&i.has(e)&&i.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)}}v.uniqueId=(()=>{let e=0;return()=>(e++,e.toString(16))})(),v.tokensById=new Map;class E{constructor(e,t,i){this.source=e,this.token=t,this.node=i,this.dependencies=new Set,this.observer=r.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,r.Wp))}}class P{constructor(){this.values=new Map}set(e,t){this.values.get(e)!==t&&(this.values.set(e,t),r.y$.getNotifier(this).notify(e.id))}get(e){return r.y$.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}}const I=new WeakMap,T=new WeakMap;class O{constructor(e){this.target=e,this.store=new P,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(e,t)=>{const i=v.getTokenById(t);if(i&&(i.notify(this.target),v.isCSSDesignToken(i))){const t=this.parent,o=this.isReflecting(i);if(t){const a=t.get(i),r=e.get(i);a===r||o?a===r&&o&&this.stopReflectToCSS(i):this.reflectToCSS(i)}else o||this.reflectToCSS(i)}}},I.set(e,this),r.y$.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof n.H?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return I.get(e)||new O(e)}static existsFor(e){return I.has(e)}static findParent(e){if(u!==e.target){let t=(0,s.T)(e.target);for(;null!==t;){if(I.has(t))return I.get(t);t=(0,s.T)(t)}return O.getOrCreate(u)}return null}static findClosestAssignedNode(e,t){let i=t;do{if(i.has(e))return i;i=i.parent?i.parent:i.target!==u?O.getOrCreate(u):null}while(null!==i);return null}get parent(){return T.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 i=this.getRaw(e);return void 0!==i?(this.hydrate(e,i),this.get(e)):void 0}getRaw(e){var t;return this.assignedValues.has(e)?this.assignedValues.get(e):null===(t=O.findClosestAssignedNode(e,this))||void 0===t?void 0:t.getRaw(e)}set(e,t){v.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,t),v.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=O.findParent(this);e&&e.appendChild(this);for(const e of this.assignedValues.keys())e.notify(this.target)}unbind(){this.parent&&T.get(this).removeChild(this)}appendChild(e){e.parent&&T.get(e).removeChild(e);const t=this.children.filter((t=>e.contains(t)));T.set(e,this),this.children.push(e),t.forEach((t=>e.appendChild(t))),r.y$.getNotifier(this.store).subscribe(e);for(const[t,i]of this.store.all())e.hydrate(t,this.bindingObservers.has(t)?this.getRaw(t):i)}removeChild(e){const t=this.children.indexOf(e);return-1!==t&&this.children.splice(t,1),r.y$.getNotifier(this.store).unsubscribe(e),e.parent===this&&T.delete(e)}contains(e){return function(e,t){let i=t;for(;null!==i;){if(i===e)return!0;i=(0,s.T)(i)}return!1}(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),O.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),O.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,t){const i=v.getTokenById(t);i&&this.hydrate(i,this.getRaw(i))}hydrate(e,t){if(!this.has(e)){const i=this.bindingObservers.get(e);v.isDerivedDesignTokenValue(t)?i?i.source!==t&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,t)):this.setupBindingObserver(e,t):(i&&this.tearDownBindingObserver(e),this.store.set(e,t))}}setupBindingObserver(e,t){const i=new E(t,e,this);return this.bindingObservers.set(e,i),i}tearDownBindingObserver(e){return!!this.bindingObservers.has(e)&&(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0)}}O.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:i}=e;this.add(t,i)}add(e,t){f.getOrCreate(t).setProperty(e.cssCustomProperty,this.resolveCSSValue(O.getOrCreate(t).get(e)))}remove(e,t){f.getOrCreate(t).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&"function"==typeof e.createCSS?e.createCSS():e}},(0,o.gn)([r.LO],O.prototype,"children",void 0);const y=Object.freeze({create:function(e){return v.from(e)},notifyConnection(e){return!(!e.isConnected||!O.existsFor(e)||(O.getOrCreate(e).bind(),0))},notifyDisconnection(e){return!(e.isConnected||!O.existsFor(e)||(O.getOrCreate(e).unbind(),0))},registerRoot(e=u){S.registerRoot(e)},unregisterRoot(e=u){S.unregisterRoot(e)}})},98584:function(e,t,i){function o(e){const t=e.parentElement;if(t)return t;{const t=e.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}i.d(t,{T:function(){return o}})},64865:function(e,t,i){function o(e){return!e||!e.trim()}i.d(t,{TF:function(){return o}})}},t={};function i(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,i),r.exports}i.d=function(e,t){for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e=i(5144),t=i(44445),o=i(93078),a=i(72370),r=i(27689),n=i(58474);let s=function(e){return e.Injected="Injected",e.Error="Error",e}({});class c extends n.Z{constructor(e){super(),(0,a.Z)(this,"domain",void 0),(0,a.Z)(this,"path",void 0),(0,a.Z)(this,"status",void 0),this.domain=(0,r.S8)(),this.path=location.pathname,this.status=e}}var l=c;let u=function(e){return e.LogScriptTelemetry="LogScriptTelemetry",e.ActivateCashback="ActivateRebates",e.AutoApplyStart="AutoApplyStart",e.AutoApplyComplete="AutoApplyComplete",e.AutoApplyClosed="AutoApplyClosed",e.AutoApplyError="AutoApplyError",e.SetAutoApplyState="SetAutoApplyState",e.ImportWhileCheckout="ImportWhileCheckout",e.AutoApplyOptionsStatus="AutoApplyOptionsStatus",e.ExpressCheckoutStart="ExpressCheckoutStart",e.ExpressCheckoutComplete="ExpressCheckoutComplete",e.ExpressCheckoutError="ExpressCheckoutError",e.ExpressCheckoutClosed="ExpressCheckoutClosed",e.SetExpressCheckoutState="SetExpressCheckoutState",e.SetStorageValue="SetStorageValue",e.OtherSellerComplete="OtherSellerComplete",e.OtherSellerError="OtherSellerError",e.OtherSellerClosed="OtherSellerClosed",e.OtherSellerStart="OtherSellerStart",e.SequenceSupported="SequenceSupported",e.ImportCheckboxShown="ImportCheckboxShown",e.TriggerImportFeature="TriggerImportFeature",e.SubscribedToBroadcastChannel="SubscribedToBroadcastChannel",e.ReleaseBackgroundAutoApply="ReleaseBackgroundAutoApply",e.ContinueToZip="ContinueToZip",e.ShoppingIframeRunner="ShoppingIframeRunner",e.UpdatePaymentDetailsComplete="UpdatePaymentDetailsComplete",e.PrintableCouponsStart="PrintableCouponsStart",e.PrintableCouponsComplete="PrintableCouponsComplete",e.PrintableCouponsError="PrintableCouponsError",e.PrintableCouponsClosed="PrintableCouponsClosed",e.OpenFlyout="OpenFlyout",e.OpenPane="OpenPane",e.EdgeDriverStateChange="EdgeDriverStateChange",e.RetailerPageRefresh="RetailerPageRefresh",e.WalletDrawerLog="WalletDrawerLog",e.GetStorageValueByDottedPath="GetStorageValueByDottedPath",e.SetStorageValueByDottedPath="SetStorageValueByDottedPath",e.ClearStorageValueByDottedPath="ClearStorageValueByDottedPath",e.FetchRewardsUserInfoWithPromotions="FetchRewardsUserInfoWithPromotions",e}({}),d=function(e){return e.UseCoupon="UseCoupon",e.UseRebates="UseRebates",e}({}),h=function(e){return e.AutoApplyStarted="AutoApplyStarted",e.AutoApplyFinished="AutoApplyFinished",e.ProgressBarUpdate="ProgressBarUpdate",e.CouponUpdate="CouponUpdate",e}({}),p=function(e){return e.FinishAutoApply="FinishAutoApply",e.CancelAutoApply="CancelAutoApply",e.RestartAutoApply="RestartAutoApply",e}({}),g=function(e){return e.CloseWalletCheckoutPane="CloseWalletCheckoutPane",e.SkipCouponAutoApply="SkipCouponAutoApply",e.RemoveAppliedCoupon="RemoveAppliedCoupon",e.StartActivateCashback="StartActivateCashback",e.PassDynamicSelectors="PassDynamicSelectors",e}({}),C=function(e){return e.NewSkipCoupon="NewSkipCoupon",e}({});var S=i(87720),m=i(29247),A=i(66933),f=i(35062);class v{constructor(){(0,a.Z)(this,"title",void 0),(0,a.Z)(this,"offerUrl",void 0)}static Create(e){const t=new v;return t.title=e.title,t.offerUrl=e.offerUrl,t}}var E=v,P=i(57021),I=i(69886);class T{constructor(){(0,a.Z)(this,"otherSellersOverlayLinkSelector",void 0),(0,a.Z)(this,"otherSellerOfferElementSelector",void 0),(0,a.Z)(this,"otherSellerHeadingSelector",void 0),(0,a.Z)(this,"otherSellerPriceSelector",void 0),(0,a.Z)(this,"otherSellerNameSelector",void 0),(0,a.Z)(this,"productImageSelector",void 0),(0,a.Z)(this,"otherSellerRatingSelector",void 0),(0,a.Z)(this,"otherSellerDeliverySelector",void 0),(0,a.Z)(this,"otherSellerAddButtonSelector",void 0),(0,a.Z)(this,"otherSellerAddedConfirmationSelector",void 0)}static Create(e){const t=new T;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}}var O=T,y=i(99182),D=i(6747);class b{constructor(){(0,a.Z)(this,"inputBoxSelector",void 0),(0,a.Z)(this,"applyButtonSelector",void 0),(0,a.Z)(this,"removeCouponButtonSelector",void 0),(0,a.Z)(this,"orderTotalDataElementSelector",void 0),(0,a.Z)(this,"orderSubTotalElementSelector",void 0),(0,a.Z)(this,"enabledTips",void 0),(0,a.Z)(this,"couponAcceptedMessageElementSelector",void 0),(0,a.Z)(this,"errorMessageCloseButtonSelector",void 0),(0,a.Z)(this,"waitBeforeReApplyingNextCoupon",void 0),(0,a.Z)(this,"waitAfterApplyingCurrentCoupon",void 0),(0,a.Z)(this,"checkoutPageUrl",void 0),(0,a.Z)(this,"refreshAfterApplying",void 0),(0,a.Z)(this,"refreshAfterRemoving",void 0),(0,a.Z)(this,"closeModal",void 0),(0,a.Z)(this,"layoutClickSelector",void 0),(0,a.Z)(this,"clickBeforeStartSelector",void 0),(0,a.Z)(this,"errorMessageSelector",void 0),(0,a.Z)(this,"couponSuccessMessageSelectors",void 0),(0,a.Z)(this,"couponFailureMessageSelectors",void 0),(0,a.Z)(this,"domMutationEnabled",void 0),(0,a.Z)(this,"couponRemovalNotNeeded",void 0),(0,a.Z)(this,"appliedCouponSelector",void 0),(0,a.Z)(this,"finalCheckoutButtonSelector",void 0),(0,a.Z)(this,"otherSellerSelectors",void 0),(0,a.Z)(this,"clippingSelectors",void 0),(0,a.Z)(this,"backgroundAAEnabled",void 0),(0,a.Z)(this,"socialSelectors",void 0),(0,a.Z)(this,"pinterestSelectors",void 0),(0,a.Z)(this,"backgroundAutoApplyStartTimeout",void 0),(0,a.Z)(this,"backgroundAutoApplyInProgressTimeout",void 0),(0,a.Z)(this,"backgroundAutoApplyCancelTimeout",void 0),(0,a.Z)(this,"edgeEnabled",void 0),(0,a.Z)(this,"couponApplyMinWaitTime",void 0),(0,a.Z)(this,"couponRemoveMinWaitTime",void 0),(0,a.Z)(this,"suggestedCouponElementSelector",void 0),(0,a.Z)(this,"suggestedCouponRegex",void 0),(0,a.Z)(this,"successfulAlertSelector",void 0),(0,a.Z)(this,"supportedNoOrderTotal",void 0),(0,a.Z)(this,"waitBeforeTypingNextCoupon",void 0),(0,a.Z)(this,"waitAfterTypingCoupon",void 0),(0,a.Z)(this,"productAddToCartSelector",void 0),(0,a.Z)(this,"pageUrlRegex",void 0),(0,a.Z)(this,"pageTypeSelector",void 0),(0,a.Z)(this,"pageType",void 0),(0,a.Z)(this,"addToCartOverlaySelector",void 0),(0,a.Z)(this,"shipmentSelector",void 0),(0,a.Z)(this,"getProductNamesFromImg",void 0),(0,a.Z)(this,"isHomePageSameAsCheckout",void 0)}static Create(e){const t=new b;return t.inputBoxSelector=e.inputBoxSelector,t.applyButtonSelector=e.applyButtonSelector,t.removeCouponButtonSelector=e.removeCouponButtonSelector,t.orderTotalDataElementSelector=e.orderTotalDataElementSelector,t.orderSubTotalElementSelector=e.orderSubTotalElementSelector,t.enabledTips=e.enabledTips,t.couponAcceptedMessageElementSelector=e.couponAcceptedMessageElementSelector,t.errorMessageCloseButtonSelector=e.errorMessageCloseButtonSelector,t.waitBeforeReApplyingNextCoupon=e.waitBeforeReApplyingNextCoupon,t.waitAfterApplyingCurrentCoupon=e.waitAfterApplyingCurrentCoupon,t.checkoutPageUrl=e.checkoutPageUrl,t.refreshAfterApplying=e.refreshAfterApplying,t.refreshAfterRemoving=e.refreshAfterRemoving,t.closeModal=e.closeModal,t.clickBeforeStartSelector=e.clickBeforeStartSelector,t.errorMessageSelector=e.errorMessageSelector,t.couponSuccessMessageSelectors=e.couponSuccessMessageSelectors,t.couponFailureMessageSelectors=e.couponFailureMessageSelectors,t.domMutationEnabled=e.domMutationEnabled,t.couponRemovalNotNeeded=e.couponRemovalNotNeeded,t.appliedCouponSelector=e.appliedCouponSelector,t.finalCheckoutButtonSelector=e.finalCheckoutButtonSelector,t.layoutClickSelector=e.layoutClickSelector,t.backgroundAAEnabled=e.backgroundAAEnabled,t.backgroundAutoApplyCancelTimeout=e.backgroundAutoApplyCancelTimeout,t.backgroundAutoApplyStartTimeout=e.backgroundAutoApplyStartTimeout,t.backgroundAutoApplyInProgressTimeout=e.backgroundAutoApplyInProgressTimeout,t.edgeEnabled=e.edgeEnabled,t.couponApplyMinWaitTime=e.couponApplyMinWaitTime,t.couponRemoveMinWaitTime=e.couponRemoveMinWaitTime,t.suggestedCouponElementSelector=e.suggestedCouponElementSelector,t.suggestedCouponRegex=e.suggestedCouponRegex,t.successfulAlertSelector=e.successfulAlertSelector,t.supportedNoOrderTotal=e.supportedNoOrderTotal,t.waitBeforeTypingNextCoupon=e.waitBeforeTypingNextCoupon,t.waitAfterTypingCoupon=e.waitAfterTypingCoupon,t.productAddToCartSelector=e.productAddToCartSelector,t.pageUrlRegex=e.pageUrlRegex,t.pageTypeSelector=e.pageTypeSelector,t.pageType=e.pageType,t.addToCartOverlaySelector=e.addToCartOverlaySelector,t.shipmentSelector=e.shipmentSelector,t.isHomePageSameAsCheckout=e.isHomePageSameAsCheckout,e.otherSellerSelectors&&(t.otherSellerSelectors=O.Create(e.otherSellerSelectors)),e.clippingSelectors&&(t.clippingSelectors=I.Z.Create(e.clippingSelectors)),e.socialSelectors&&(t.socialSelectors=D.Z.Create(e.socialSelectors)),e.pinterestSelectors&&(t.pinterestSelectors=y.Z.Create(e.pinterestSelectors)),t}static Process(t,i){return!i||i!==e.BN.Opal&&i!==e.BN.EdgeMobile&&i!==e.BN.Sapphire||(t.inputBoxSelector=(0,r.oO)(t.inputBoxSelector),t.applyButtonSelector=(0,r.oO)(t.applyButtonSelector),t.removeCouponButtonSelector=(0,r.oO)(t.removeCouponButtonSelector),t.orderTotalDataElementSelector=(0,r.oO)(t.orderTotalDataElementSelector),t.orderSubTotalElementSelector=(0,r.oO)(t.orderSubTotalElementSelector),t.enabledTips=(0,r.oO)(t.enabledTips),t.couponAcceptedMessageElementSelector=(0,r.oO)(t.couponAcceptedMessageElementSelector),t.errorMessageCloseButtonSelector=(0,r.oO)(t.errorMessageCloseButtonSelector),t.closeModal=(0,r.oO)(t.closeModal),t.clickBeforeStartSelector=(0,r.oO)(t.clickBeforeStartSelector),t.layoutClickSelector=(0,r.oO)(t.layoutClickSelector),t.errorMessageSelector=(0,r.oO)(t.errorMessageSelector)),t}}var N=b;class R{constructor(){(0,a.Z)(this,"transactionIdSelector",void 0),(0,a.Z)(this,"purchaseTotalSelector",void 0),(0,a.Z)(this,"isHtmlFragmentCollectionEnabled",void 0)}static Create(e){const t=new R;return t.transactionIdSelector=e.transactionIdSelector,t.purchaseTotalSelector=e.purchaseTotalSelector,t.isHtmlFragmentCollectionEnabled=e.isHtmlFragmentCollectionEnabled,t}}var _=R;class k{constructor(){(0,a.Z)(this,"checkoutPageUrl",void 0),(0,a.Z)(this,"priceSelector",void 0),(0,a.Z)(this,"startDateSelector",void 0),(0,a.Z)(this,"endDateSelector",void 0),(0,a.Z)(this,"domainType",void 0),(0,a.Z)(this,"nameSelector",void 0)}static Create(e){const t=new k;return t.checkoutPageUrl=e.checkoutPageUrl,t.priceSelector=e.priceSelector,t.startDateSelector=e.startDateSelector,t.endDateSelector=e.endDateSelector,t.nameSelector=e.nameSelector,t}}var w=k;class x{constructor(){(0,a.Z)(this,"domainName",void 0),(0,a.Z)(this,"productPageUrl",void 0),(0,a.Z)(this,"productImageSelector",void 0),(0,a.Z)(this,"productNameSelector",void 0),(0,a.Z)(this,"productOutOfStockSelector",void 0),(0,a.Z)(this,"productPriceSelector",void 0),(0,a.Z)(this,"allCheckoutPages",void 0),(0,a.Z)(this,"couponsFilteringEnabled",void 0),(0,a.Z)(this,"bestCouponLogicEnabled",void 0),(0,a.Z)(this,"shortCircuitAAEnabled",void 0),(0,a.Z)(this,"hasWhitePageError",void 0),(0,a.Z)(this,"checkoutPageKey",void 0),(0,a.Z)(this,"orderConfirmationPageUrl",void 0),(0,a.Z)(this,"orderConfirmationRegex",void 0),(0,a.Z)(this,"isHighTrafficDomain",void 0),(0,a.Z)(this,"exclusiveMarket",void 0),(0,a.Z)(this,"confirmationPageTelemetry",void 0),(0,a.Z)(this,"travelCheckoutPageData",void 0),(0,a.Z)(this,"isStorewideCashbackEstimationEnabled",void 0),(0,a.Z)(this,"IsForceRefreshDisabled",void 0),(0,a.Z)(this,"selectorExtractionEnabled",void 0),(0,a.Z)(this,"searchQueryUrlRegex",void 0),(0,a.Z)(this,"retailerTrivia",void 0),(0,a.Z)(this,"isCompositeNotificationPhCExcludedRetailer",void 0),(0,a.Z)(this,"isCompositeNotificationPhCTopRetailer",void 0)}static Create(e){const t=new x;return t.domainName=e.domainName,t.productPageUrl=e.productPageUrl,t.productImageSelector=e.productImageSelector,t.productOutOfStockSelector=e.productOutOfStockSelector,t.productNameSelector=e.productNameSelector,t.productPriceSelector=e.productPriceSelector,t.couponsFilteringEnabled=e.couponsFilteringEnabled,t.bestCouponLogicEnabled=e.bestCouponLogicEnabled,t.shortCircuitAAEnabled=e.shortCircuitAAEnabled,t.hasWhitePageError=e.hasWhitePageError,t.exclusiveMarket=e.exclusiveMarket,t.orderConfirmationPageUrl=e.orderConfirmationPageUrl,t.orderConfirmationRegex=e.orderConfirmationRegex,t.isHighTrafficDomain=e.isHighTrafficDomain,t.selectorExtractionEnabled=e.selectorExtractionEnabled,t.isStorewideCashbackEstimationEnabled=e.isStorewideCashbackEstimationEnabled,t.IsForceRefreshDisabled=e.IsForceRefreshDisabled,t.searchQueryUrlRegex=e.searchQueryUrlRegex,t.isCompositeNotificationPhCExcludedRetailer=e.isCompositeNotificationPhCExcludedRetailer,t.isCompositeNotificationPhCTopRetailer=e.isCompositeNotificationPhCTopRetailer,e.confirmationPageTelemetry&&(t.confirmationPageTelemetry=_.Create(e.confirmationPageTelemetry)),e.retailerTrivia&&(t.retailerTrivia=new class{constructor(e,t){(0,a.Z)(this,"AverageSavings",void 0),(0,a.Z)(this,"AverageUsers",void 0),(0,a.Z)(this,"SellerName",void 0),(0,a.Z)(this,"Domain",void 0),(0,a.Z)(this,"SuccessRate",void 0),this.AverageSavings=e.averageSavings,this.AverageUsers=e.averageUsers,this.Domain=t,this.SellerName=e.websiteName,this.SuccessRate=e.successRate}}(e.retailerTrivia,e.domainName)),t.CreateCheckoutPageList(e),t.CreateTravelCheckoutPageList(e),t}static Process(t,i){if(i&&(i===e.BN.Opal||i===e.BN.EdgeMobile||i===e.BN.Sapphire)){t.productImageSelector=(0,r.oO)(t.productImageSelector),t.productNameSelector=(0,r.oO)(t.productNameSelector),t.productPriceSelector=(0,r.oO)(t.productPriceSelector);for(let e=0;e<t.allCheckoutPages.length;e++)t.allCheckoutPages[e]=N.Process(t.allCheckoutPages[e],i)}return t}UpdateCurrentCheckoutPage(e){for(let t=0;t<this.allCheckoutPages.length;t++)if((0,m.VJ)(this.allCheckoutPages[t].checkoutPageUrl,this.allCheckoutPages[t].pageUrlRegex,e))return this.checkoutPageKey=t,!0;return this.checkoutPageKey=-1,!1}UpdateCurrentCheckoutPageWithPageTypeCheck(t){for(let i=0;i<this.allCheckoutPages.length;i++)if((!this.allCheckoutPages[i].pageType||this.allCheckoutPages[i].pageType===e.GV.CheckoutPage)&&(0,m.VJ)(this.allCheckoutPages[i].checkoutPageUrl,this.allCheckoutPages[i].pageUrlRegex,t))return this.checkoutPageKey=i,!0;return this.checkoutPageKey=-1,!1}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}IsConfirmationPage(e){return!!this.orderConfirmationPageUrl&&new RegExp(this.orderConfirmationPageUrl).test(e)}CreateCheckoutPageList(e){if(this.allCheckoutPages=[],e.allCheckoutPages&&e.allCheckoutPages.length>0)for(const t of e.allCheckoutPages)this.allCheckoutPages.push(N.Create(t))}CreateTravelCheckoutPageList(e){if(this.travelCheckoutPageData=[],e.travelCheckoutPageData&&e.travelCheckoutPageData.length>0)for(const t of e.travelCheckoutPageData)this.travelCheckoutPageData.push(w.Create(t))}}var U=x;class M extends P.Z{static Create(e){if(e){const t=new M(e.Timestamp);if(e.errorCode&&(t.errorCode=e.errorCode),e.retailerData&&(t.retailerData=U.Create(e.retailerData)),t.coupons=[],e.coupons)for(const i of e.coupons)t.coupons.push(i);if(t.suppressedCoupons=[],e.suppressedCoupons)for(const i of e.suppressedCoupons)t.suppressedCoupons.push(i);if(t.deals=[],e.deals)for(const i of e.deals)t.deals.push(E.Create(i));return e.cashback&&(t.cashback=A.Z.Create(e.cashback)),e.impressionId&&(t.impressionId=e.impressionId),e.aFDMarket&&(t.aFDMarket=e.aFDMarket),e.market&&(t.market=e.market),e.userPersonalizationInfo&&(t.userPersonalizationInfo=e.userPersonalizationInfo),t}return new M}static Process(e,t){return e.retailerData&&(e.retailerData=U.Process(e.retailerData,t)),e}constructor(e){super(M.thirtyMinutesExpiryInSeconds,e),(0,a.Z)(this,"coupons",[]),(0,a.Z)(this,"suppressedCoupons",[]),(0,a.Z)(this,"deals",[]),(0,a.Z)(this,"retailerData",void 0),(0,a.Z)(this,"cashback",void 0),(0,a.Z)(this,"errorCode",void 0),(0,a.Z)(this,"impressionId",void 0),(0,a.Z)(this,"market",void 0),(0,a.Z)(this,"aFDMarket",void 0),(0,a.Z)(this,"userPersonalizationInfo",void 0),(0,a.Z)(this,"domainData",void 0)}HasCoupons(){return this.coupons&&this.coupons.length>0}HasDeals(){return this.deals&&this.deals.length>0}GetOfferCount(){return this.HasCoupons()?this.coupons.length:this.HasDeals()?this.deals.length:0}}(0,a.Z)(M,"thirtyMinutesExpiryInSeconds",1800);var L=M;class B{constructor(){(0,a.Z)(this,"Guid",void 0),(0,a.Z)(this,"Email",void 0),(0,a.Z)(this,"FirstName",void 0),(0,a.Z)(this,"MiddleName",void 0),(0,a.Z)(this,"LastName",void 0),(0,a.Z)(this,"FullName",void 0),(0,a.Z)(this,"AddressLines",void 0),(0,a.Z)(this,"City",void 0),(0,a.Z)(this,"State",void 0),(0,a.Z)(this,"Country",void 0),(0,a.Z)(this,"Zip",void 0),(0,a.Z)(this,"PhoneNumber",void 0),(0,a.Z)(this,"Honorific",void 0),(0,a.Z)(this,"Company",void 0),(0,a.Z)(this,"DateOfBirth",void 0)}static CreateFromCheckoutData(e){let t;const i=e.cardholder;return i?.address1&&(t=new B,t.UpdateFields("",i.firstName,i.middleName,i.lastName,i.name,i.address1+"\n"+i.address2,i.city,i.state,i.country,i.postalCode,"","","","","")),t}static CreateFromSettingsData(e){const t=new B;return t.UpdateFields(e.Emails?.[0],e.FirstName,e.MiddleName,e.LastName,e.FullName,e.AddressLines,e.City,e.State,e.Country,e.Zip,e.PhoneNumbers?.[0],e.Honorific,e.Guid,e.Company,e.DateOfBirth),t}UpdateFields(e,t,i,o,a,r,n,s,c,l,u,d,h,p,g){this.Guid=h,this.Email=e,this.FirstName=t,this.MiddleName=i,this.LastName=o,this.FullName=a,this.AddressLines=r,this.City=n,this.State=s,this.Country=c,this.Zip=l,this.PhoneNumber=u,this.Honorific=d,this.Company=p,this.DateOfBirth=g}}var F=B,Z=class{constructor(e){(0,a.Z)(this,"Guid",void 0),(0,a.Z)(this,"Emails",void 0),(0,a.Z)(this,"FirstName",void 0),(0,a.Z)(this,"MiddleName",void 0),(0,a.Z)(this,"LastName",void 0),(0,a.Z)(this,"FullName",void 0),(0,a.Z)(this,"AddressLines",void 0),(0,a.Z)(this,"City",void 0),(0,a.Z)(this,"State",void 0),(0,a.Z)(this,"Country",void 0),(0,a.Z)(this,"Zip",void 0),(0,a.Z)(this,"PhoneNumbers",void 0),(0,a.Z)(this,"Honorific",void 0),(0,a.Z)(this,"Company",void 0),(0,a.Z)(this,"DateOfBirth",void 0),this.UpdateFields(e.guid,e.emailAddresses,e.fullNameSplit?.firstName??"",e.fullNameSplit?.middleName??"",e.fullNameSplit?.lastName??"",e.fullNames,e.honorific,e.addressLines,e.addressLevel2,e.addressLevel1,e.countryCode,e.postalCode,e.phoneNumbers,e.companyName,e.dateOfBirth)}UpdateFields(e,t,i,o,a,r,n,s,c,l,u,d,h,p,g){this.Guid=e,this.Emails=t,this.FirstName=i,this.MiddleName=o,this.LastName=a,this.FullName=r?.[0],this.AddressLines=s,this.City=c,this.State=l,this.Country=u,this.Zip=d,this.PhoneNumbers=h,this.Honorific=n,this.Company=p,this.DateOfBirth=`${g?.year}-${g?.month}-${g?.day}`}};class G{constructor(){(0,a.Z)(this,"Guid",void 0),(0,a.Z)(this,"ExpMonth",void 0),(0,a.Z)(this,"ExpYear",void 0),(0,a.Z)(this,"FullName",void 0),(0,a.Z)(this,"CardNumber",void 0),(0,a.Z)(this,"CardType",void 0),(0,a.Z)(this,"CardCVC",void 0),(0,a.Z)(this,"Address",void 0),(0,a.Z)(this,"FirstName",""),(0,a.Z)(this,"MiddleName",""),(0,a.Z)(this,"LastName","")}static CreateFromCheckoutData(t){const i=t.card,o=t.cardholder,a=e.sj[i.brand.toUpperCase().trim()],r=new G;return r.UpdateFields("",i.expirationMonth,i.expirationYear,o?.name,i.number,a,i.cvc),r}static CreateFromSettingsData(e){const t=new G;return t.UpdateFields(e.Guid,e.ExpMonth,e.ExpYear,e.FullName,e.CardNumber,e.CardType,e.Cvv,e.Address),t}UpdateFields(e,t,i,o,a,r,n,s){if(this.Guid=e,this.ExpMonth=t,this.ExpYear=i,this.FullName=o,this.CardNumber=a,this.CardType=r,this.CardCVC=n??"",this.Address=s?F.CreateFromSettingsData(new Z(s)):void 0,o){const e=o.split(" ");this.FirstName=e.shift()??"",this.LastName=e.pop()??"",this.MiddleName=e[0]??""}}}var H=G;let V=function(e){return e.EdgeDriverForCouponInjectedAndStarted="EdgeDriverForCouponInjectedAndStarted",e.AutoApplyDone="AutoApplyDone",e.AutoApplyProgress="AutoApplyProgress",e.AutoApplyCancelled="AutoApplyCancelled",e.AddressDone="AddressDone",e.PaymentDone="PaymentDone",e.CancelEC="CancelExpressCheckout",e.FieldError="FieldError",e.BNPLPaymentSuccess="BNPLPaymentSuccess",e.BNPLPaymentFail="BNPLPaymentFail",e.BillingAddressStart="BillingAddressStart",e.BillingAddressSuccess="BillingAddressSuccess",e.BillingAddressFail="BillingAddressFail",e.DynamicSelectorFetch="DynamicSelectorFetch",e.ContactInfoDone="ContactInfoDone",e.ShippingAddressDone="ShippingAddressDone",e.ShippingOptionsDone="ShippingOptionsDone",e.BillingAddressDone="BillingAddressDone",e.AutoApplySkipped="AutoApplySkipped",e}({});var W=class{constructor(){(0,a.Z)(this,"Profile",void 0),(0,a.Z)(this,"Payment",void 0),(0,a.Z)(this,"paymentGuid",void 0),(0,a.Z)(this,"profileGuid",void 0),(0,a.Z)(this,"SkipAutoApply",void 0),(0,a.Z)(this,"IsSkipPayment",void 0),(0,a.Z)(this,"IsSkipProfile",void 0),(0,a.Z)(this,"BNPLProvider",void 0),(0,a.Z)(this,"TotalAmountDialogData",void 0)}ToString(){return JSON.stringify(this)}},K=i(5491),z=i(82960);class Q extends z.Z{constructor(t,i,o){super(e.Vm.GetCouponStatusMessagesResponse),(0,a.Z)(this,"StatusMessage",void 0),(0,a.Z)(this,"SuccessMessages",void 0),(0,a.Z)(this,"FailureMessages",void 0),this.StatusMessage=t,this.SuccessMessages=i,this.FailureMessages=o}}var j=Q,Y=function(e){return e.Apply="Apply",e.Continue="Continue",e.ClickBefore="ClickBefore",e.Confirm="Confirm",e.LayoutClick="LayoutClick",e.FieldError="FieldError",e.FormError="FormError",e.IframeName="IframeName",e.IframeOrigin="IframeOrigin",e.CheckedValue="CheckedValue",e.FieldValue="FieldValue",e}(Y||{}),J=Y;class X extends z.Z{constructor(t,i,o,r){super(e.Vm.DOMMutationMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"couponResultSignal",void 0),(0,a.Z)(this,"isApplyReady",void 0),(0,a.Z)(this,"isRemoveReady",void 0),this.ContextID=t,this.couponResultSignal=i,this.isApplyReady=o,this.isRemoveReady=r}}var q=X;class $ extends z.Z{constructor(t){super(e.Vm.CountElementsResponse),(0,a.Z)(this,"NumElements",void 0),this.NumElements=t}}var ee=$;class te extends z.Z{constructor(){super(e.Vm.EmptyResponse)}}var ie=te;class oe extends z.Z{constructor(t){super(e.Vm.GetCheckedValueResponse),(0,a.Z)(this,"DisabledValue",void 0),this.DisabledValue=t}}var ae=oe;class re extends z.Z{constructor(t){super(e.Vm.GetCheckedValueResponse),(0,a.Z)(this,"CheckedValue",void 0),this.CheckedValue=t}}var ne=re;class se extends z.Z{constructor(t){super(e.Vm.GetFieldValueResponse),(0,a.Z)(this,"FieldValue",void 0),this.FieldValue=t}}var ce=se;class le extends z.Z{constructor(t){super(e.Vm.GetTextValueResponse),(0,a.Z)(this,"TextValue",void 0),this.TextValue=t}}var ue=le;class de extends z.Z{constructor(t){super(e.Vm.SelectorSuccessResponse),(0,a.Z)(this,"SelectorSuccess",void 0),this.SelectorSuccess=t}}var he=de,pe=i(56019);let ge=function(e){return e.RemoveButtonRemoved="RemoveButtonRemoved",e.RemoveButtonAdded="RemoveButtonAdded",e.PriceElementAdded="PriceElementAdded",e.ResultMessageAdded="ResultMessageAdded",e.PriceElementChanged="PriceElementChanged",e.PriceCharDataChanged="PriceCharDataChanged",e.FixedWaitTime="FixedWaitTime",e.Refresh="Refresh",e.NoRemoveButton="NoRemoveButton",e.RemovalNotNeeded="RemovalNotNeeded",e.NotApplied="NotApplied",e.RemoveButtonDetected="RemoveButtonDetected",e}({}),Ce=function(e){return e.SetValue="SetValue",e.ScrollIntoView="ScrollIntoView",e.Display="Display",e.GetAppliedCoupon="GetAppliedCoupon",e.GetTextValue="GetTextValue",e.setUpMutationObserver="setObserver",e.DisconnectDOMMutationObserver="disconnectObserver",e.SetBoxValue="SetBoxValue",e.CountMatchingElements="QueryPath",e.Click="Click",e.GetInnerText="GetInnerText",e.SelectorName="SelectorName",e.IframeOrigin="IframeOrigin",e.GetCheckedValue="GetCheckedValue",e.GetDisabledValue="GetDisabledValue",e.SetCheckBox="SetCheckBox",e.GetFieldValue="GetFieldValue",e.ExtractInputBox="ExtractInputBox",e.ExtractOrderTotal="ExtractOrderTotal",e.ExtractApplyButton="ExtractApplyButton",e.GetCouponStatusMessages="GetCouponStatusMessages",e}({});var Se=i(18435),me=i(80090);class Ae extends z.Z{constructor(t,i,o,r){super(e.Vm.TelemetryMessage),(0,a.Z)(this,"EventType",void 0),(0,a.Z)(this,"LogLevel",void 0),(0,a.Z)(this,"Message",void 0),(0,a.Z)(this,"Data",void 0),this.EventType=t,this.LogLevel=i,this.Message=o,this.Data=r}}var fe=Ae,ve=class{constructor(e){(0,a.Z)(this,"platformInstance",void 0),this.platformInstance=e}getContextID(e){const t=document.getElementById(e);return t?parseInt(t.innerText,10):-1}selectElement(e,t){return e.querySelector(t)}LogClientError(t,i){const o=new fe(e.R.ClientError,e.in.Error,"",new me.Z((0,r.S8)(),t,i??{},void 0));this.platformInstance.SendMessage(o)}},Ee=i(28219),Pe=i(90066),Ie=class extends ve{constructor(...e){super(...e),(0,a.Z)(this,"mutationObserver",void 0)}HandleMessage(e){const t=e.DomPath,i=e.DomValue;try{if(e.Command===Ce.setUpMutationObserver){const t=e,i=t.checkoutPageUrlData;this.SetUpDOMMutationObserver(t.ContextID,i,t.shouldObserveStatusSelector)}else if(e.Command===Ce.DisconnectDOMMutationObserver)this.DisconnectMutationObserver();else{if(e.Command===Ce.Click){const i=this.Click(t,e.SelectorType,e.AutoApplyScenario);return new he(i)}if(e.Command===Ce.GetTextValue){const e=Pe.Z.GetTextValue(t);return new ue(e)}if(e.Command===Ce.GetInnerText){const e=this.GetInnerText(t);return new ue(e)}if(e.Command===Ce.SetBoxValue){const o=this.SetBoxValue(t,i,e.AutoApplyScenario);return new he(o)}if(e.Command===Ce.CountMatchingElements){const e=Pe.Z.CountVisibleElements(t);return new ee(e)}if(e.Command===Ce.GetAppliedCoupon)return new ue(this.GetAppliedCoupon(t));if(e.Command===Ce.SetValue){const e=Pe.Z.GetFirstVisibleElement(t);e&&(e.value=i)}else if(e.Command===Ce.ScrollIntoView){const e=document.querySelector(t);e&&e.scrollIntoView(!0)}else if(e.Command===Ce.Display)for(const e of t.split(";")){const t=document.querySelector(e);t&&(t.style.display="block")}else{if(e.Command===Ce.SelectorName){const t=this.GetFrameName(e.DomPath);return new ue(t)}if(e.Command===Ce.IframeOrigin){const t=this.GetFrameOrigin(e.DomPath);return new ue(t)}if(e.Command===Ce.GetCheckedValue){const e=this.GetCheckedValue(t);return new ne(e)}if(e.Command===Ce.GetFieldValue){const e=this.GetFieldValue(t);return new ce(e)}if(e.Command===Ce.GetDisabledValue){const e=this.GetDisabledValue(t);return new ae(e)}if(e.Command!==Ce.SetCheckBox){if(e.Command===Ce.GetCouponStatusMessages){const t=e?.OtherData?.errorMessageSelector,i=e?.OtherData?.couponSuccessMessageSelectors,o=e?.OtherData?.couponFailureMessageSelectors,a=Ee.Z.GetCouponStatusMessages("string"==typeof t?t:void 0,(0,m.V6)(i)?i:void 0,(0,m.V6)(o)?o:void 0);return new j(a.statusMessage,a.successMessages,a.failureMessages)}throw Error("Invalid eventType.")}this.SetCheckBox(t,i)}}}catch(e){return(0,r.Md)(e.message,this.platformInstance.GetAppInfoClientName())}return new ie}SetCheckBox(e,t){const i=document.querySelectorAll(e)[0];i&&(i.checked="true"===t)}GetFrameOrigin(e){const t=document.querySelectorAll(e)[0];return t&&t.src?new URL(t.src).origin:""}GetFrameName(e){const t=document.querySelectorAll(e)[0];return t?t.name:""}GetAppliedCoupon(e){const t=Pe.Z.GetFirstVisibleElement(e);if(t){let e=t.innerText;return e||(e=t.value),e.replace(/[^a-z0-9]/gim,"")}return""}SetUpDOMMutationObserver(e,t,i){const o=t.orderTotalDataElementSelector,a=t.applyButtonSelector,r=t.errorMessageSelector,n=this.GetRemoveBtnPath(t.removeCouponButtonSelector),s=Pe.Z.GetFirstVisibleElement(o);if(null!==a&&s&&(window.MutationObserver||window.WebKitMutationObserver)){const t=Pe.Z.GetFirstVisibleElement(a);let c=s;const l=[];for(;c;c=c.parentElement)l.push(c);let u=t;for(;u;u=u.parentElement){const t=l.find((e=>e===u?e:null));if(t){const c=MutationObserver||window.WebKitMutationObserver;this.mutationObserver=new c((s=>{if(s)for(const c of s){const s=Pe.Z.GetFirstVisibleElement(o),l=Pe.Z.GetFirstVisibleElement(a);for(const t of c.removedNodes)t.nodeType===Node.ELEMENT_NODE&&(t.matches(n)||t.querySelector(n))&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.RemoveButtonRemoved,!1,!0);for(const a of c.addedNodes){const c=["valid","invalid","expired","applied","cannot be added"];if(a.nodeType===Node.ELEMENT_NODE){(a.matches(o)||a.querySelector(o))&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.PriceElementAdded,!0,!0),(a.matches(n)||a.querySelector(n))&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.RemoveButtonAdded,!0),i&&r&&(a.matches(r)||a.querySelector(r))&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.ResultMessageAdded,!0);const u=this.ElementIsChildOf(a,s,t[0]);!this.ElementIsChildOf(a,l,t[0])&&!u&&c.filter((e=>a.innerText.toLowerCase().includes(e))).length>0&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.ResultMessageAdded,!0)}if(a.nodeType===Node.TEXT_NODE){const i=this.ElementIsChildOf(a,s,t[0]);!this.ElementIsChildOf(a,l,t[0])&&!i&&c.filter((e=>a.data.toLowerCase().includes(e))).length>0&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.ResultMessageAdded,!0)}}c.target&&c.target.nodeType===Node.ELEMENT_NODE&&(c.target.matches(o)||c.target.querySelector(o))&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.PriceElementChanged,!0,!0),"characterData"===c.type&&this.ElementIsChildOf(c.target,s,t[0])&&this.NotifyCheckoutAreaUpdateCompletion(e,ge.PriceCharDataChanged,!0,!0)}})),this.mutationObserver.observe(t,{childList:!0,subtree:!0}),this.mutationObserver.observe(s,{childList:!0,subtree:!0,characterData:!0,attributes:!0});break}}}}NotifyCheckoutAreaUpdateCompletion(e,t,i=!1,o=!1){this.platformInstance.SendMessage(new q(e,t,i,o))}DisconnectMutationObserver(){this.mutationObserver&&this.mutationObserver.disconnect()}GetRemoveBtnPath(e){return e&&e.includes(";")?e.split(";")[0]:e}ElementIsChildOf(e,t,i){let o=e;for(;null!==o;){if(o.isSameNode(t))return!0;if(i&&o.isSameNode(i))return!1;o=o.parentElement}return!1}Click(e,t,i){const o=Pe.Z.GetFirstVisibleElement(e),a={Scenario:i??""};if(o){if(Se.Z.isElementDisabled(o))t&&t===J.Apply?this.LogClientError(pe.x.ApplyButtonDisabled,a):t&&t===J.Continue&&this.LogClientError(pe.x.ContinueButtonDisabled);else{const r=["mousedown","click","mouseup"];function n(e){r.forEach((t=>e.dispatchEvent(new MouseEvent(t,{bubbles:!0,buttons:1,cancelable:!0,view:window}))))}n(o)}return!0}return t&&t===J.Apply?this.LogClientError(pe.x.ApplyButtonUndefined,a):t&&t===J.Continue&&this.LogClientError(pe.x.ContinueButtonUndefined),!1}GetInnerText(e){const t=Pe.Z.GetFirstVisibleElement(e);return t?t.innerText:""}GetCheckedValue(e){const t=Pe.Z.GetFirstMatchingElement(e);return t?.checked}GetFieldValue(e){const t=Pe.Z.GetFirstMatchingElement(e);return t?.value}GetDisabledValue(e){const t=Pe.Z.GetFirstMatchingElement(e);return t?.disabled}SetBoxValue(e,t,i){const o=document.createEvent("Events");o.initEvent("change",!0,!1);const a=document.createEvent("Events");a.initEvent("input",!0,!1);const r=new KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,view:window}),n=Pe.Z.GetFirstVisibleElement(e);if(n)return n.blur(),n.dispatchEvent(o),n.focus(),n.setAttribute("value",t),n.value=t,n.dispatchEvent(r),n.dispatchEvent(a),n.dispatchEvent(o),n.blur(),!0;{const e={Scenario:i??""};return this.LogClientError(pe.x.InputUndefined,e),!1}}};class Te extends z.Z{constructor(t=""){super(e.Vm.SelectorExtractionResponse),(0,a.Z)(this,"Selector",void 0),this.Selector=t}}var Oe=Te;class ye{static hasNoChild(){return this.price.wHasNoChild}static containsCheckoutKeywords(e){return!e.includes("total")||e.includes("savings")||e.includes("save")||e.includes("item")||e.includes("product")?0:this.price.wContainsCheckoutKeywords}static nearbyContainsCheckoutKeywords(e,t){let i=0;return e.includes("savings")||e.includes("save")||e.includes("item")||e.includes("product")||e.includes("off")||(Object.keys(this.price.wNearbyContainsCheckoutKeywords).forEach((t=>{e.includes(t.toString())&&(i+=this.price.wNearbyContainsCheckoutKeywords[t])})),e.includes("total")&&(e.includes("subtotal")||e.includes("shipping"))&&(i-=3),e.includes("total")&&t>0&&(i+=i/(Math.log(Math.abs(t))+1))),i}static containsCouponKeywords(e){let t=0;return Object.keys(this.wContainsCouponKeywords).forEach((i=>{e.includes(i.toString())&&(t+=this.wContainsCouponKeywords[i])})),t}static typeAttribute(e){return e&&"text"===e?this.input.wTypeAttribute:0}static inputIsButton(e){return e.includes("button")||e.includes("submit")?this.input.wContainsButtonKeywords:0}static idHasCouponKeywords(e){return e>0?this.input.wIdHasCouponKeywords:0}static hasCouponKeywords(e){return e>0?this.button.wHasCouponKeywords:0}static containsButtonTag(e){let t=0;return Object.keys(this.button.wContainsButtonTag).forEach((i=>{e===i.toString()&&(t+=this.button.wContainsButtonTag[i])})),t}static containsButtonKeywords(e){let t=0;return Object.keys(this.button.wContainsButtonKeywords).forEach((i=>{e.includes(i.toString())&&(t+=this.button.wContainsButtonKeywords[i])})),t}static hasButtonType(e){return"button"===e||"submit"===e?this.button.wHasButtonType:0}static proximityToInput(e,t,i){let o=0;return Object.keys(this.button.wContainsButtonTagInverse).forEach((a=>{i===a.toString()&&(o=e/(Math.log(t)+1+this.button.wContainsButtonTagInverse[a]))})),o}}(0,a.Z)(ye,"wContainsCouponKeywords",{apply:2,code:3,coupon:5,discount:3,promo:4,promotion:4,voucher:3}),(0,a.Z)(ye,"price",{wContainsCheckoutKeywords:3,wHasNoChild:2,wNearbyContainsCheckoutKeywords:{checkout:5,estimated:5,grand:3,order:5,proceed:3,shipping:1,subtotal:1,tax:1,total:5}}),(0,a.Z)(ye,"input",{wContainsButtonKeywords:-2,wIdHasCouponKeywords:2,wTypeAttribute:3}),(0,a.Z)(ye,"button",{wContainsButtonKeywords:{add:2,apply:8,redeem:2},wContainsButtonTag:{a:3,button:5,div:1,input:3,span:1,submit:4},wContainsButtonTagInverse:{a:3,button:0,div:5,input:3,span:5,submit:1},wHasButtonType:5,wHasCouponKeywords:3});var De=ye,be=i(36493),Ne=i(54380),Re=i(39088),_e=i(71544);class ke{static GetInstance(){return this.Instance||(this.Instance=new class{constructor(){(0,a.Z)(this,"resourcesMap",new Map),this.initializeResources()}GetUrl(e,t){return""}UpdateLocalData(e,t){e===Ne.Q.LocalizedStrings&&(this.resourcesMap=new Map([...this.resourcesMap,...Object.entries(t)]))}GetResourceString(e){return this.resourcesMap.get(e)??""}ReadFromStorage(e,t){t(this.ReadFromStorageSync(e))}WriteToStorage(e,t){if(window.sessionStorage)for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];window.sessionStorage.setItem(t,JSON.stringify(i))}t&&t()}async SendMessage(t,i){const o=i;return new Promise((async(i,a)=>{if(o&&o===e.og.FromBackground){const o=await window[e.PK.HandleBackgroundMessage](t);o.Type===e.Vm.ErrorResponse?a(o):i(o)}else await window[e.PK.HandleContentMessage](t),i(new ie)}))}GetVersion(){return Re.QY}GetAppInfoClientName(){return _e.Z.GetClientName()}ReadFromStorageSync(e){let t=null;if(window.sessionStorage){const i=window.sessionStorage.getItem(e);null!==i&&(t=JSON.parse(i))}const i={};return null!==t&&(i[e]=t),i}initializeResources(){const e=this.ResourcesJSONString(),t=JSON.parse(e);this.resourcesMap=new Map(Object.entries(t))}ResourcesJSONString(){return'{\n            "ERROR_DIALOGUE_SUBTEXT": "Click the promotional codes box on the checkout page and try to apply available coupons.",\n            "ERROR_DIALOGUE_TITLE": "We can\'t automatically apply coupons right now",\n            "ERROR_EXIT_BUTTON": "Return to checkout",\n            "IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is testing available coupons for your cart",\n            "IN_PROGRESS_DIALOGUE_TITLE_V1": "Microsoft Edge is finding the best coupon from the web for you",\n            "IN_PROGRESS_DIALOGUE_TITLE_V2": "Microsoft Edge is checking the web for the best savings",\n            "OTHER_SELLER_IN_PROGRESS_DIALOGUE_TITLE": "Edge is adding selected item to your cart",\n            "IN_PROGRESS_EXIT_BUTTON": "Stop & Close",\n            "IN_PROGRESS_LOADER_TEXT_BOTTOM": "Testing code $1",\n            "OTHER_SELLER_IN_PROGRESS_LOADER_TEXT_BOTTOM" : "Adding item to cart",\n            "IN_PROGRESS_LOADER_TEXT_TOP": "$1 out of $2",\n            "NO_COUPONS_DIALOGUE_SUBTEXT": "Available coupons don\'t apply to your cart",\n            "BEST_DEAL_TITLE": "You already have the best deal!",\n            "BEST_PRICE_TITLE": "You have the best price!",\n            "BEST_PRICE_SUBTITLE": "Available coupons don\'t apply to your cart",\n            "SUGGESTED_COUPONS_TEXT": "Applying a coupon suggested by the website",\n            "NO_COUPONS_DIALOGUE_TITLE": "We are working hard to find you more coupons",\n            "NO_COUPONS_EXIT_BUTTON": "Proceed to checkout",\n            "NO_COUPONS_CASHBACK_ACTIVATED_TRUE_PRICE": "Congrats! You\'re saving estimated $1 cash back",\n            "NO_COUPONS_CASHBACK_ACTIVATED": "Congrats! You\'re earning up to $1 cash back",\n            "NO_COUPONS_CASHBACK_ACTIVATED_HEADER": "Cash back activated",\n            "NO_COUPONS_CASHBACK_ACTIVATED_OFFER_DETAILS": "See offer details and exclusions",\n            "SUCCESS_DIALOGUE_SUBTEXT": "$1 was applied to your cart",\n            "SUCCESS_DIALOGUE_TITLE": "You saved $1 with Microsoft Edge!",\n            "3DSUCCESS_DIALOGUE_TITLE": "Congrats! You saved $1 with Microsoft Edge!",\n            "3DSUCCESS_DIALOGUE_TITLE_NOT": "We applied the best coupon for you!",\n            "SUCCESS_EXIT_BUTTON": "Proceed to checkout",\n            "EC_EXIT_BUTTON": "Continue to checkout",\n            "SUCCESS_IMPORT_EXIT_BUTTON": "Import and check out",\n            "INSTANT_ADD_TO_CART_DIALOGUE_TITLE": "Applying $1 cash back and adding to cart",\n            "INSTANT_ADD_TO_CART_SUCCESS_TITLE" : "Congratulations! Get $1 cash back after your purchase!",\n            "IMPORT_FROM_PRIMARY_BROWSER_MESSAGE": "Import passwords, addresses and more from $1 to check out faster and continue saving on Microsoft Edge",\n            "IN_PROGRESS_DIALOGUE_SAVINGS": "You have saved $1 so far!",\n            "IN_PROGRESS_DIALOGUE_SAVINGS_NOT": "Valid coupons are found!",\n            "SUCCESS_DIALOGUE_TITLE_WITH_CASHBACK": "You saved $1 & got $2 cash back with Microsoft Edge!",\n            "SUCCESS_DIALOGUE_TITLE_WITH_NON_STACK_CASHBACK": "Save $1 with code $2 OR earn up to $3 cash back with Microsoft Edge!",\n            "SUCCESS_DIALOGUE_TITLE_WITH_NON_STACK_CASHBACK_REFRESH": "Best savings found!",\n            "SUCCESS_DIALOGUE_TITLE_WITH_INBOX_COUPON": "Congrats! You saved $1 with a coupon from your inbox.",\n            "SUCCESS_DIALOGUE_TITLE_WITH_INBOX_COUPON_NOT": "We\'ve applied a coupon from your inbox!",\n            "OPTION_NON_STACK_COUPON_APPLIED": "Save $1 with coupon",\n            "OPTION_NON_STACK_ECB_APPLIED": "Estimated $1 cash back$2",\n            "SUCCESS_DIALOGUE_SUBTITLE_NON_STACK_COUPON": "Microsoft Cashback $1 and code $2 can\'t be used at the same time",\n            "SUCCESS_SUBTITLE_NON_STACK_COUPON_APPLIED": "Code $1 applied to your cart",\n            "SUCCESS_SUBTITLE_NON_STACK_ECB_APPLIED": "Redeem after purchase. ",\n            "OPTION_NON_STACK_OR": "OR",\n            "OPTION_NON_STACK_ECB_APPLIED_OFFER_DETAILS": "See offer details",\n            "OPTION_NON_STACK_ECB_APPLIED_TOOLTIP": "Exclusions apply. $1",\n            "USE_REBATES": "Use Microsoft Cashback",\n            "EARN_REBATES": "Earn Microsoft Cashback",\n            "USE_COUPON": "Use Coupon",\n            "SUCCESS_UPSELL_CASHBACK": "You can save even more next time by getting cash back from Microsoft Cashback.",\n            "SUCCESS_LEARN_MORE_CASHBACK": "Learn more",\n            "EC_IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is filling your address and payment details",\n            "EC_ADDRESS_IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is filling your address details",\n            "EC_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is filling your payment details",\n            "EC_AUTOAPPLY_IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is trying coupons and filling your details",\n            "EC_SUCCESS_DAILOGUE_TITLE": "Your details have been filled up",\n            "EC_ADDRESS_SUCCESS_DIALOGUE_TITLE": "Your shipping address has been filled up",\n            "EC_SUCCESS_DAILOGUE_SUBTEXT": "Input your CVV on the website to finish checkout",\n            "EC_PROGRESS_DETAILS_APPLY_COUPONS": "Apply coupons",\n            "EC_PROGRESS_DETAILS_FILL_ADDRESS_DETAILS": "Fill address details",\n            "EC_PROGRESS_DETAILS_FILL_PAYMENT_DETAILS": "Fill payment details",\n            "EC_ERROR_TITLE": "Unfortunately we could not fill your details",\n            "EC_ERROR_SUBTITLE": "please fill in your details manually",\n            "EC_PROGRESS_ADDRESS": "Filling in your address details",\n            "EC_PROGRESS_PAYMENT": "Filling in your payment details",\n            "EC_IN_PROGRESS_LOADER_TEXT_TOP": "Step $1 of $2",\n            "SHOPPING_IN_EDGE_TEXT": "Shopping in Microsoft Edge",\n            "SHOPPING_IN_EDGE_TEXT_NEW": "Microsoft Shopping",\n            "PRIVACY_STATEMENT_LABEL": "Microsoft Privacy Statement",\n            "EC_WALLET_PROGRESS_DETAILS_CHECKOUT_BUTTON": "Checkout with $1",\n            "EC_WALLET_INSTALLMENT_ZIP": "Zip",\n            "EC_WALLET_ADDRESS_AND_OTHER_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is filling your address details and connecting you with $1",\n            "EC_WALLET_AUTOAPPLY_AND_OTHER_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is trying coupons and connecting you with $1",\n            "EC_WALLET_OTHER_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE": "Microsoft Edge is connecting you with $1",\n            "EC_WALLET_EXTRA_DIALOG_TITLE": "Enter your total purchase amount",\n            "EC_WALLET_EXTRA_DIALOG_SUB_TITLE": "See if you qualify to pay overtime",\n            "EC_WALLET_EXTRA_DIALOG_LICENSE": "By continuing, you agree to our $1 and acknowledge that your total purchase amount will be shared with $2, in accordance with $3.",\n            "EC_WALLET_EXTRA_DIALOG_TERMS_OF_USE": "Terms of Use",\n            "EC_WALLET_EXTRA_DIALOG_PRIVACY": "Microsoft Privacy Statement",\n            "EC_WALLET_EXTRA_DIALOG_VALIDATION_ERROR": "To spend with $1, your purchase must be between $2 and $3. Please update your cart so that your total purchase amount is more than $4 but less than $5.",\n            "EC_WALLET_EXTRA_DIALOG_CONNECT_ISSUE": "Unable to connect to $1. Please try again.",\n            "EC_WALLET_EXTRA_DIALOG_TOTAL_ORDER_AMOUNT": "Total purchase amount",\n            "EC_WALLET_EXTRA_DIALOG_CONTINUE_BUTTON": "Continue to $1",\n            "EC_WALLET_FILLING_VIRTUAL_CARD_INFO": "Microsoft Edge is filling your $1 virtual card information",\n            "EC_WALLET_INSTALLMENT_ZIP_LOGO_DESC": "Zip, buy now, pay later",\n            "EC_WALLET_AMOUNT_TAX_SHIPPING_REMINDER": "Don\'t forget to include tax + shipping!",\n            "EC_WALLET_EXTRA_ZIP_PAY_MICROSOFT_STATEMENT": "Microsoft does not charge you or get paid by this provider for the transaction.",\n            "EC_WALLET_TOP_BANNER": "With Microsoft Edge, you have $1 options to pay",\n            "EC_WALLET_TOP_BANNER_BOLD_TEXT": "more",\n            "COUPON_SHARE_SAVINGS": "Share your savings with everybody!",\n            "COUPON_SHARE_SAVINGS_REFRESH": "Let your friends know!",\n            "COUPON_SHARE_SAVINGS_FACEBOOK": "Share on Facebook",\n            "COUPON_SHARE_SAVINGS_TWITER": "Share on Twitter",\n            "COUPON_SHARE_SAVINGS_WHATSAPP":"Share on Whatsapp",\n            "COUPON_SHARE_SAVINGS_CLIPBOARD":"Share on Clipboard",\n            "SAVINGS_WITH_COUPON": "With coupon: |$1|",\n            "SAVINGS_WITHOUT_COUPON": "Without coupon: $1",\n            "ATT_COUPON_PROMPT": "Unlock a better deal!",\n            "ATT_COUPON_TITLE": "Get $1 when you boost your cart to $2!",\n            "ATT_COUPON_BUTTON": "Continue Shopping",\n            "COUPON_SHARE_SAVINGS_MESSAGE": "I just saved with Microsoft Edge",\n            "COUPON_SHARE_SAVINGS_MESSAGE_WITH_PRICE": "I saved $1 by shopping on Edge browser!",\n            "CASHBACK_UPSELL_TOP_TEXT": "We didn\'t find any qualifying coupons, but you could get cash back!",\n            "CASHBACK_UPSELL_OFFER": "Get up to $1 cash back on this purchase",\n            "CASHBACK_UPSELL_ESTIMATE": "(estimated based on your cart)",\n            "CASHBACK_UPSELL_PRIVACY": "You will be signed in to Microsoft Edge which will back up your browsing data and let you see your favorites, passwords, history and more on all your devices. You will also join and receive emails about $1, which include offers about partner products. $2 | $3",\n            "CASHBACK_UPSELL_MICROSOFT_REWARDS": "Microsoft Rewards",\n            "CASHBACK_UPSELL_PRIVACY_NEXT": "which include offers about partner products. ",\n            "CASHBACK_UPSELL_TERMS": "Terms",\n            "CASHBACK_UPSELL_PRIVACY_COOKIES": "Privacy & Cookies",\n            "CASHBACK_UPSELL_EXIT": "No thanks, proceed to checkout",\n            "CASHBACK_UPSELL_INFO_BUTTON_TEXT": "$1 on Microsoft Cashback. Edge Shopping is powered by Microsoft Cashback, part of Microsoft Rewards",\n            "CASHBACK_UPSELL_JOIN_NOW": "Join now to save",\n            "SHORTCIRCUIT_TITLE": "This site doesn\'t support automatically applying coupons, but hold on...",\n            "SHORTCIRCUIT_SUBTITLE": "You can still save by entering this coupon code yourself at checkout!",\n            "SHORTCIRCUIT_EXIT_BUTTON": "Return to checkout",\n            "SHORTCIRCUIT_COPY": "COPY",\n            "SHORTCIRCUIT_COPIED": "COPIED ✓",\n            "SHORTCIRCUIT_CALL_TO_ACTION": "Click to copy coupon",\n            "INFO_ICON_LABEL": "More info",\n            "PAUSE_BUTTON_PAUSE_AND_APPLY": "Pause and apply savings",\n            "PAUSE_BUTTON_APPLY_CURRENT": "Apply current savings and checkout",\n            "PAUSE_SUBTITLE": "Trying available coupons for your cart",\n            "AUTO_APPLY_PAUSING": "Getting your savings!",\n            "IBC_CONNECT_YOUR_INBOX_UPSELL_TITLE": "Find more savings with inbox coupons",\n            "IBC_CONNECT_YOUR_INBOX_UPSELL_PERSONALIZED_COUPONS_TITLE": "Find personalized coupons sent to your email",\n            "IBC_CONNECT_YOUR_INBOX_BUTTON_TITLE": "Connect your inbox",\n            "IBC_OPENING_SIDEBAR_LOADING_TITLE": "Opening sidebar ...",\n            "REWARDS_UPSELL_TITLE_PREFIX": "No coupons found, but earn $1 with Microsoft Rewards",\n            "REWARDS_UPSELL_TITLE_MIDDLE": " points",\n            "REWARDS_UPSELL_SUBTITLE": "Finish your purchase to claim the points. Microsoft Rewards points can be used for gift cards, sweepstakes, and more!",\n            "REWARDS_UPSELL_POINTS_LEFT": " points",\n            "REWARDS_UPSELL_POINTS_DETAILS_SUFFIX": " earned with this offer"\n        }'}}),this.Instance}}(0,a.Z)(ke,"Instance",void 0);var we=ke;class xe{static GetPlatformInstance(){return this.platformInstance}static GetLocalDataService(){return this.localDataService}}(0,a.Z)(xe,"localDataService",new class{constructor(){(0,a.Z)(this,"localData",void 0),(0,a.Z)(this,"featureData",void 0),this.localData=new Map,this.featureData=new Map}clear(){this.localData.clear(),this.featureData.clear()}GetLocalData(e){return this.localData.get(e)}SaveLocalData(e,t){this.localData||(this.localData=new Map),this.localData.set(e,t)}SaveFeature(e,t){this.featureData.set(e,t)}IsFeatureEnabled(e){const t=this.featureData.get(e);return void 0!==t&&t}}),(0,a.Z)(xe,"platformInstance",we.GetInstance());var Ue=xe;let Me=function(e){return e.AutoApplyCancelled="AutoApplyCancelled",e.AutoApplyFail="AutoApplyFail",e.AutofillFail="AutofillFail",e.ECCancelled="ExpressCheckoutCancelled",e.ECFieldError="ExpressCheckoutFieldError",e.ECFormError="ExpressCheckoutFormError",e.InvalidInput="InvalidInput",e.SelectorError="SelectorError",e.ExecutionError="ExecutionError",e.OverlayError="OverlayError",e.TimeOut="TimeOut",e.Unknown="Unknown",e.Refresh="Refresh",e.IframePaymentFail="IframePaymentFail",e.IframeOriginInvalid="IframeOriginInvalid",e.IframeSelectorNotFound="IframeSelectorNotFound",e.InvalidCartValue="InvalidCartValue",e.CouponAlreadyApplied="CouponAlreadyApplied",e.AutoApplyShortcircuit="AutoApplyShortcircuit",e.AutoApplyPaused="AutoApplyPaused",e.AutoApplySkipped="AutoApplySkipped",e}({});var Le=class{SaveTransactionToEdgeLocalStore(e,t){this.SetStorageValue(e,t)}SendAutoApplyStartMessage(){this.SendMessage(u.AutoApplyStart,[])}SendExpressCheckoutStartMessage(){this.SendMessage(u.ExpressCheckoutStart,[])}SendOtherSellersStartMessage(){this.SendMessage(u.OtherSellerStart,[])}SendOtherSellersCompleteMessage(e,t,i){const o=[i,e.toString(),t.toString()];this.SendMessage(u.OtherSellerComplete,o)}SendPrintCouponsStartMessage(){this.SendMessage(u.PrintableCouponsStart,[])}SendPrintCouponsCompleteMessage(){this.SendMessage(u.PrintableCouponsComplete,[])}SendOtherSellersClosedMessaged(){this.SendMessage(u.OtherSellerClosed,[])}SendOtherSellersErrorMessage(){this.SendMessage(u.OtherSellerError,[])}SendActivateCashbackMessage(){this.SendMessage(u.ActivateCashback,[])}SendAutoApplyPositiveMessage(e,t,i){const o=i??0,a=[e?"true":"false",(t??0).toString(),o.toFixed(2),e??""];this.SendMessage(u.AutoApplyComplete,a)}SendAutoApplyNegativeMessage(){this.SendMessage(u.AutoApplyComplete,["false"])}SendAutoApplyErrorMessage(e){const t=e??Me.Unknown;this.SendMessage(u.AutoApplyError,[t])}SendAutoApplyCancelledMessage(){this.SendMessage(u.AutoApplyClosed,[])}SaveExpressCheckoutStatus(e){let t="";e&&(t=e.ToString()),this.SendMessage(u.SetExpressCheckoutState,[t])}SendExpressCheckoutCompletedMessage(){this.SendMessage(u.ExpressCheckoutComplete,[])}SetStorageValue(e,t){this.SendMessage(u.SetStorageValue,[e,t])}DeleteStorageValue(e){this.SendMessage(u.SetStorageValue,[e,JSON.stringify({value:null})])}SendExpressCheckoutClosedMessage(){this.SendMessage(u.ExpressCheckoutClosed,[])}SendExpressCheckoutErrorMessage(){this.SendMessage(u.ExpressCheckoutError,[])}SendSequenceSupportedMessage(){this.SendMessage(u.SequenceSupported,[])}SendImportCheckboxShownMessage(){this.SendMessage(u.ImportCheckboxShown,[])}SendTriggerImportFeature(){this.SendMessage(u.TriggerImportFeature,[])}SendSubscribedToBroadcastChannelMessage(){this.SendMessage(u.SubscribedToBroadcastChannel,[])}SendDestructBgAutoApplyMessage(){this.SendMessage(u.ReleaseBackgroundAutoApply,[])}SendIframeMessage(e){this.SendMessage(u.ShoppingIframeRunner,e)}SendUpdatePaymentDetailsResultMessage(e){this.SendMessage(u.UpdatePaymentDetailsComplete,[String(e)])}SendOpenFlyoutMessage(e){this.SendMessage(u.OpenFlyout,[e])}SendOpenPaneMessage(){this.SendMessage(u.OpenPane,[])}SendEdgeDriverStateChangeMessage(e,t){this.SendMessage(u.EdgeDriverStateChange,t?[e,t]:[e]),this.SendMessage(u.WalletDrawerLog,[e,String(Date.now())])}SendRetailerPageRefreshMessage(){this.SendMessage(u.RetailerPageRefresh,[]),this.SendMessage(u.WalletDrawerLog,["retailerPageRefresh",String(Date.now())])}FetchRewardsUserInfoWithPromotions(){this.SendMessage(u.FetchRewardsUserInfoWithPromotions,[])}SendMessage(e,i){t.a.postMessageToHost(e,i)}};let Be=function(e){return e.errorTitle="ERROR_DIALOGUE_TITLE",e.errorSubTitle="ERROR_DIALOGUE_SUBTEXT",e.errorExitButton="ERROR_EXIT_BUTTON",e.inProgressTitle="IN_PROGRESS_DIALOGUE_TITLE",e.inProgressTitleV1="IN_PROGRESS_DIALOGUE_TITLE_V1",e.inProgressTitleV2="IN_PROGRESS_DIALOGUE_TITLE_V2",e.OS_InProgressTitle="OTHER_SELLER_IN_PROGRESS_DIALOGUE_TITLE",e.inProgressExitButton="IN_PROGRESS_EXIT_BUTTON",e.inProgressLoaderTextBottom="IN_PROGRESS_LOADER_TEXT_BOTTOM",e.OS_InProgressLoaderTextBottom="OTHER_SELLER_IN_PROGRESS_LOADER_TEXT_BOTTOM",e.instantAddToCartSuccessTitle="INSTANT_ADD_TO_CART_SUCCESS_TITLE",e.instantAddToCartDialogueTitle="INSTANT_ADD_TO_CART_DIALOGUE_TITLE",e.inProgressLoaderTextTop="IN_PROGRESS_LOADER_TEXT_TOP",e.noCouponsTitle="NO_COUPONS_DIALOGUE_TITLE",e.noCouponsSubTitle="NO_COUPONS_DIALOGUE_SUBTEXT",e.noCouponsCashbackEstimated="NO_COUPONS_CASHBACK_ACTIVATED_TRUE_PRICE",e.noCouponsCashbackActivated="NO_COUPONS_CASHBACK_ACTIVATED",e.noCouponsCashbackActivatedHeader="NO_COUPONS_CASHBACK_ACTIVATED_HEADER",e.noCouponsCashbackActivatedOfferDetails="NO_COUPONS_CASHBACK_ACTIVATED_OFFER_DETAILS",e.noCouponsExitButton="NO_COUPONS_EXIT_BUTTON",e.successTitle="SUCCESS_DIALOGUE_TITLE",e.successTitleAnimation="3DSUCCESS_DIALOGUE_TITLE",e.successTitleAnimationNOT="3DSUCCESS_DIALOGUE_TITLE_NOT",e.successSubTitle="SUCCESS_DIALOGUE_SUBTEXT",e.successExitButton="SUCCESS_EXIT_BUTTON",e.expressCheckoutButton="EC_EXIT_BUTTON",e.successImportExitButton="SUCCESS_IMPORT_EXIT_BUTTON",e.importFromPrimaryBrowser="IMPORT_FROM_PRIMARY_BROWSER_MESSAGE",e.currentBestDiscount="IN_PROGRESS_DIALOGUE_SAVINGS",e.currentBestDiscountNOT="IN_PROGRESS_DIALOGUE_SAVINGS_NOT",e.inProgressSapphireTitle="IN_PROGRESS_SAPPHIRE_DIALOGUE_TITLE",e.successSapphireTitle="SUCCESS_SAPPHIRE_DIALOGUE_TITLE",e.successCashBackTitle="SUCCESS_DIALOGUE_TITLE_WITH_CASHBACK",e.successCashBackNonStackableTitle="SUCCESS_DIALOGUE_TITLE_WITH_NON_STACK_CASHBACK",e.successCashBackNonStackableTitleRefresh="SUCCESS_DIALOGUE_TITLE_WITH_NON_STACK_CASHBACK_REFRESH",e.successAutoApplyWithInboxCoupon="SUCCESS_DIALOGUE_TITLE_WITH_INBOX_COUPON",e.successAutoApplyWithInboxCouponNOT="SUCCESS_DIALOGUE_TITLE_WITH_INBOX_COUPON_NOT",e.optionNonStackCouponApplied="OPTION_NON_STACK_COUPON_APPLIED",e.optionNonStackEcbApplied="OPTION_NON_STACK_ECB_APPLIED",e.successCashBackNonStackableSubtitle="SUCCESS_DIALOGUE_SUBTITLE_NON_STACK_COUPON",e.optionNonStackCouponAppliedSubtitle="SUCCESS_SUBTITLE_NON_STACK_COUPON_APPLIED",e.optionNonStackECBAppliedSubtitle="SUCCESS_SUBTITLE_NON_STACK_ECB_APPLIED",e.optionNonStackOr="OPTION_NON_STACK_OR",e.optionNonStackEcbOfferDetails="OPTION_NON_STACK_ECB_APPLIED_OFFER_DETAILS",e.optionNonStackEcbTooltip="OPTION_NON_STACK_ECB_APPLIED_TOOLTIP",e.useRebatesButton="USE_REBATES",e.earnRebatesButton="EARN_REBATES",e.useCouponButton="USE_COUPON",e.successCashBackUpsell="SUCCESS_UPSELL_CASHBACK",e.successCashBackLearnMore="SUCCESS_LEARN_MORE_CASHBACK",e.ECInProgressTitle="EC_IN_PROGRESS_DIALOGUE_TITLE",e.ECAddressInProgressTitle="EC_ADDRESS_IN_PROGRESS_DIALOGUE_TITLE",e.ECPaymentInProgressTitle="EC_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE",e.ECAutoApplyInProgressTitle="EC_AUTOAPPLY_IN_PROGRESS_DIALOGUE_TITLE",e.ECsuccessTitle="EC_SUCCESS_DAILOGUE_TITLE",e.ECAddressSuccessTitle="EC_ADDRESS_SUCCESS_DIALOGUE_TITLE",e.ECsuccessSubTitle="EC_SUCCESS_DAILOGUE_SUBTEXT",e.ECErrorTitle="EC_ERROR_TITLE",e.ECErrorSubTitle="EC_ERROR_SUBTITLE",e.ECProgressAddress="EC_PROGRESS_ADDRESS",e.ECProgressPayment="EC_PROGRESS_PAYMENT",e.ECApplyCoupons="EC_PROGRESS_DETAILS_APPLY_COUPONS",e.ECAddress="EC_PROGRESS_DETAILS_FILL_ADDRESS_DETAILS",e.ECPayment="EC_PROGRESS_DETAILS_FILL_PAYMENT_DETAILS",e.ECInProgressLoaderTextTop="EC_IN_PROGRESS_LOADER_TEXT_TOP",e.ShoppingInEdgeText="SHOPPING_IN_EDGE_TEXT",e.ShoppingInEdgeTextNew="SHOPPING_IN_EDGE_TEXT_NEW",e.PrivacyStatement="PRIVACY_STATEMENT_LABEL",e.ContinuousImportCheckBoxText="CONTINUOUS_IMPORT_FROM_BROWSER_MESSAGE",e.CheckoutWithNewPaymentOption="EC_WALLET_PROGRESS_DETAILS_CHECKOUT_BUTTON",e.ZipPayment="EC_WALLET_INSTALLMENT_ZIP",e.ECWalletAddressAndOtherPaymentInProgressTitle="EC_WALLET_ADDRESS_AND_OTHER_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE",e.ECWalletAAAndOtherPaymentInProgressTitle="EC_WALLET_AUTOAPPLY_AND_OTHER_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE",e.ECWalletOtherPaymentInProgressTitle="EC_WALLET_OTHER_PAYMENT_IN_PROGRESS_DIALOGUE_TITLE",e.ECWalletExtraDialogTitle="EC_WALLET_EXTRA_DIALOG_TITLE",e.ECWalletExtraDialogSubTitle="EC_WALLET_EXTRA_DIALOG_SUB_TITLE",e.ECWalletExtraDialogFeeDescription="EC_WALLET_EXTRA_DIALOG_FEE_DECSCRIPTION",e.EcWalletExtraDialogFeePrivacy="EC_WALLET_EXTRA_DIALOG_FEE_PRIVACY",e.EcWalletExtraDialogLicense="EC_WALLET_EXTRA_DIALOG_LICENSE",e.EcWalletExtraDialogTermsOfUse="EC_WALLET_EXTRA_DIALOG_TERMS_OF_USE",e.EcWalletExtraDialogPrivacy="EC_WALLET_EXTRA_DIALOG_PRIVACY",e.EcWalletExtraDialogValidationError="EC_WALLET_EXTRA_DIALOG_VALIDATION_ERROR",e.EcWalletExtraDialogConnectIssue="EC_WALLET_EXTRA_DIALOG_CONNECT_ISSUE",e.EcWalletExtraDialogTotalOrderAmount="EC_WALLET_EXTRA_DIALOG_TOTAL_ORDER_AMOUNT",e.EcWalletExtraDialogContinueButton="EC_WALLET_EXTRA_DIALOG_CONTINUE_BUTTON",e.EcWalletFillingVirtualCardInfo="EC_WALLET_FILLING_VIRTUAL_CARD_INFO",e.EcWalletInstallmentZipLogoDesc="EC_WALLET_INSTALLMENT_ZIP_LOGO_DESC",e.EcWalletAmountTaxShippingReminder="EC_WALLET_AMOUNT_TAX_SHIPPING_REMINDER",e.EcWalletMicrosoftDescription="EC_WALLET_EXTRA_ZIP_PAY_MICROSOFT_STATEMENT",e.EcWalletTopBanner="EC_WALLET_TOP_BANNER",e.EcWalletTopBannerBoldText="EC_WALLET_TOP_BANNER_BOLD_TEXT",e.CouponShareSavings="COUPON_SHARE_SAVINGS",e.CouponShareSavingsMessage="COUPON_SHARE_SAVINGS_MESSAGE",e.CouponShareSavingsRefresh="COUPON_SHARE_SAVINGS_REFRESH",e.FacebookShare="COUPON_SHARE_SAVINGS_FACEBOOK",e.TwitterShare="COUPON_SHARE_SAVINGS_TWITER",e.WhatsappShare="COUPON_SHARE_SAVINGS_WHATSAPP",e.ClipboardShare="COUPON_SHARE_SAVINGS_CLIPBOARD",e.SavingsWithCoupon="SAVINGS_WITH_COUPON",e.SavingsWithoutCoupon="SAVINGS_WITHOUT_COUPON",e.BestDealTitle="BEST_DEAL_TITLE",e.BestPriceTitle="BEST_PRICE_TITLE",e.BestPriceSubTitle="BEST_PRICE_SUBTITLE",e.SuggestedCouponsText="SUGGESTED_COUPONS_TEXT",e.AttCouponPrompt="ATT_COUPON_PROMPT",e.AttCouponTitle="ATT_COUPON_TITLE",e.AttCouponButton="ATT_COUPON_BUTTON",e.CouponShareSavingsMessageWithPrice="COUPON_SHARE_SAVINGS_MESSAGE_WITH_PRICE",e.CashbackUpsellTopText="CASHBACK_UPSELL_TOP_TEXT",e.CashbackUpsellOffer="CASHBACK_UPSELL_OFFER",e.CashbackUpsellEstimate="CASHBACK_UPSELL_ESTIMATE",e.CashbackUpsellExit="CASHBACK_UPSELL_EXIT",e.CashbackUpsellJoinNow="CASHBACK_UPSELL_JOIN_NOW",e.CashbackUpsellPrivacy="CASHBACK_UPSELL_PRIVACY",e.CashbackUpsellMicrosoftRewards="CASHBACK_UPSELL_MICROSOFT_REWARDS",e.CashbackUpsellPrivacyNext="CASHBACK_UPSELL_PRIVACY_NEXT",e.CashbackUpsellTerms="CASHBACK_UPSELL_TERMS",e.CashbackUpsellPrivacyCookies="CASHBACK_UPSELL_PRIVACY_COOKIES",e.CashbackUpsellInfoButtonText="CASHBACK_UPSELL_INFO_BUTTON_TEXT",e.ShortcircuitTitle="SHORTCIRCUIT_TITLE",e.ShortcircuitSubtitle="SHORTCIRCUIT_SUBTITLE",e.ShortcircuitExitButton="SHORTCIRCUIT_EXIT_BUTTON",e.ShortcircuitCopy="SHORTCIRCUIT_COPY",e.ShortcircuitCopied="SHORTCIRCUIT_COPIED",e.ShortcircuitCalltoAction="SHORTCIRCUIT_CALL_TO_ACTION",e.InfoIconLabel="INFO_ICON_LABEL",e.PauseButtonPauseAndApply="PAUSE_BUTTON_PAUSE_AND_APPLY",e.AutoApplyPausing="AUTO_APPLY_PAUSING",e.InboxCouponsConnectYourInboxUpsellFindMoreSavingsTitle="IBC_CONNECT_YOUR_INBOX_UPSELL_TITLE",e.InboxCouponsConnectYourInboxUpsellFindPersonalizedCouponsTitle="IBC_CONNECT_YOUR_INBOX_UPSELL_PERSONALIZED_COUPONS_TITLE",e.InboxCouponsConnectYourInboxButtonTitle="IBC_CONNECT_YOUR_INBOX_BUTTON_TITLE",e.InboxCouponsOpeningSidebarLoading="IBC_OPENING_SIDEBAR_LOADING_TITLE",e.RewardsUpsellTitlePrefix="REWARDS_UPSELL_TITLE_PREFIX",e.RewardsUpsellTitleMiddle="REWARDS_UPSELL_TITLE_MIDDLE",e.RewardsUpsellSubtitle="REWARDS_UPSELL_SUBTITLE",e.RewardsUpsellPointsLeft="REWARDS_UPSELL_POINTS_LEFT",e.RewardsUpsellPointsDetailsSuffix="REWARDS_UPSELL_POINTS_DETAILS_SUFFIX",e}({});var Fe=i(88767),Ze=i(23582);function Ge(e){return e?"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Finished_Dark_01.mp4":"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Finished_01.mp4"}function He(e){return e?"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Success_Dark_01.mp4":"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Success_01.mp4"}const Ve={[Fe.M$.ZIP]:Be.ZipPayment},We={[Fe.M$.ZIP]:function(e){return e?Ze.Z.getTrustedHTML`<svg width='97' height='50' viewBox='0 0 97 50' fill='none'>
        <path d='M3.68063 46C5.52063 46 6.39062 45.27 6.39062 43.97C6.39062 43.09 5.98063 42.6 5.24063 42.35C5.90063 42.08 6.25063 41.57 6.25063 40.71C6.25063 39.53 5.44063 38.87 3.56063 38.87H0.830625V46H3.68063ZM3.60063 39.93C4.56063 39.93 4.96063 40.23 4.96063 40.85C4.96063 41.53 4.49063 41.82 3.61063 41.82H2.11063V39.93H3.60063ZM3.53063 42.88C4.56063 42.88 5.05063 43.17 5.05063 43.86C5.05063 44.53 4.63063 44.88 3.51063 44.88H2.11063V42.88H3.53063ZM11.2934 46H12.3934V40.25H11.0734V43.24C11.0734 44.26 10.6334 44.97 9.76336 44.97C8.87336 44.97 8.59336 44.35 8.59336 43.45V40.25H7.28336V43.81C7.28336 45.24 7.94336 46.12 9.31336 46.12C10.2534 46.12 10.8734 45.65 11.1734 44.9L11.2934 46ZM13.9522 48.15C15.4922 48.15 15.8022 47.93 16.4722 46.33L18.9922 40.25H17.6122L16.0922 44.15L16.0222 44.4L15.9722 44.14L14.4122 40.25H13.0122L15.3922 45.85L15.2822 46.12C14.9422 46.85 14.7322 47.01 13.9622 47.01H13.2922V48.15H13.9522ZM23.9852 43C23.9852 41.94 24.4452 41.25 25.4152 41.25C26.3452 41.25 26.6552 41.85 26.6552 42.78V46H27.9752V42.46C27.9752 41.03 27.2352 40.11 25.8452 40.11C24.8552 40.11 24.2052 40.62 23.8952 41.4L23.7752 40.25H22.6652V46H23.9852V43ZM31.8384 46.15C33.5684 46.15 34.7384 45.11 34.7384 43.24V43.09C34.7384 41.19 33.5384 40.11 31.8384 40.11C30.1684 40.11 28.9384 41.16 28.9384 43.09V43.24C28.9384 45.11 29.9884 46.15 31.8384 46.15ZM31.8384 45C30.8684 45 30.2784 44.35 30.2784 43.22V43.09C30.2784 41.88 30.9184 41.23 31.8484 41.23C32.7884 41.23 33.4084 41.92 33.4084 43.09V43.22C33.4084 44.36 32.8184 45 31.8384 45ZM40.6934 46H41.8634L43.6534 40.25H42.3734L41.1734 44.33L39.7734 40.25H38.9134L37.4034 44.34L36.3934 40.25H35.0934L36.6434 46H37.8334L39.3234 42.17L40.6934 46ZM43.8708 47.51C44.9508 47.36 45.4608 46.67 45.4608 45.59C45.4608 44.76 45.2208 44.48 44.5908 44.48C43.9808 44.48 43.7208 44.68 43.7208 45.3C43.7208 45.94 43.9308 46.07 44.4408 46.07C44.5108 46.07 44.5708 46.06 44.6408 46.05C44.5708 46.52 44.3208 46.78 43.8508 46.86L43.8708 47.51ZM52.6136 45.01C51.6636 45.01 51.0736 44.3 51.0736 43.19V43.09C51.0736 41.96 51.6936 41.23 52.6436 41.23C53.5336 41.23 54.1636 41.88 54.1636 43.11V43.23C54.1636 44.37 53.5836 45.01 52.6136 45.01ZM53.0236 46.12C54.4636 46.12 55.4936 45.14 55.4936 43.25V43.11C55.4936 41.18 54.5336 40.11 53.0436 40.11C52.0436 40.11 51.3736 40.64 51.0636 41.42L50.9236 40.25H49.8336V47.98H51.1036V44.99C51.4336 45.69 52.0736 46.12 53.0236 46.12ZM58.5238 45.14C57.9138 45.14 57.6238 44.88 57.6238 44.42C57.6238 44.15 57.7238 43.98 57.9638 43.82C58.2238 43.65 58.5138 43.57 59.2138 43.46C59.7338 43.38 60.1338 43.27 60.3738 43.09V43.4C60.3738 44.23 59.6538 45.14 58.5238 45.14ZM60.5638 46H61.6238V42.12C61.6238 40.89 60.9438 40.11 59.0838 40.11C57.4438 40.11 56.4738 40.98 56.3838 42.28H57.7338C57.7738 41.55 58.2038 41.13 59.1538 41.13C60.0438 41.13 60.3638 41.43 60.3638 41.91C60.3638 42.38 59.9438 42.52 58.9238 42.65C57.8338 42.82 57.4338 42.89 56.9438 43.2C56.4738 43.49 56.1938 43.97 56.1938 44.61C56.1938 45.55 56.8338 46.15 58.0738 46.15C59.2638 46.15 60.0338 45.6 60.4238 44.85L60.5638 46ZM62.9854 48.15C64.5254 48.15 64.8354 47.93 65.5054 46.33L68.0254 40.25H66.6454L65.1254 44.15L65.0554 44.4L65.0054 44.14L63.4454 40.25H62.0454L64.4254 45.85L64.3154 46.12C63.9754 46.85 63.7654 47.01 62.9954 47.01H62.3254V48.15H62.9854ZM73.0284 46V38.3H71.7184V46H73.0284ZM76.2581 45.14C75.6481 45.14 75.3581 44.88 75.3581 44.42C75.3581 44.15 75.4581 43.98 75.6981 43.82C75.9581 43.65 76.2481 43.57 76.9481 43.46C77.4681 43.38 77.8681 43.27 78.1081 43.09V43.4C78.1081 44.23 77.3881 45.14 76.2581 45.14ZM78.2981 46H79.3581V42.12C79.3581 40.89 78.6781 40.11 76.8181 40.11C75.1781 40.11 74.2081 40.98 74.1181 42.28H75.4681C75.5081 41.55 75.9381 41.13 76.8881 41.13C77.7781 41.13 78.0981 41.43 78.0981 41.91C78.0981 42.38 77.6781 42.52 76.6581 42.65C75.5681 42.82 75.1681 42.89 74.6781 43.2C74.2081 43.49 73.9281 43.97 73.9281 44.61C73.9281 45.55 74.5681 46.15 75.8081 46.15C76.9981 46.15 77.7681 45.6 78.1581 44.85L78.2981 46ZM83.8163 44.78H83.4063C82.4463 44.78 82.2963 44.62 82.2963 43.48V41.41H83.8163V40.25H82.2963V38.7H81.1763C81.1763 38.87 81.1663 39.21 81.1562 39.46C81.1163 40.16 81.0063 40.3 80.4663 40.3H79.9563V41.41H81.0763V43.7C81.0763 45.44 81.4563 46 83.0763 46H83.8163V44.78ZM89.9988 44.3H88.5888C88.3888 44.79 87.9688 45.07 87.2788 45.07C86.3288 45.07 85.7488 44.55 85.6388 43.61H90.0788V43C90.0788 41.53 89.2487 40.11 87.2688 40.11C85.4788 40.11 84.3388 41.28 84.3388 43.11V43.25C84.3388 45.03 85.2887 46.15 87.2288 46.15C88.7288 46.15 89.6588 45.46 89.9988 44.3ZM87.2788 41.15C88.1988 41.15 88.6788 41.7 88.7688 42.58H85.6488C85.7888 41.67 86.3688 41.15 87.2788 41.15ZM92.3438 46V43.34C92.3438 42.01 92.6638 41.53 94.0138 41.53H94.5838V40.2H94.1938C93.1138 40.2 92.5038 40.66 92.2838 41.6L92.1138 40.25H91.0538V46H92.3438ZM95.3323 46.12C95.9223 46.12 96.2123 45.87 96.2123 45.24C96.2123 44.59 95.9123 44.37 95.3323 44.37C94.7523 44.37 94.4523 44.59 94.4523 45.24C94.4523 45.9 94.6923 46.12 95.3323 46.12Z' fill='#FFFFFA'/>
        <path fillRule='evenodd' clipRule='evenodd' d='M6.96815 25.784L7.73119 31.9994H34.4411L33.5681 24.8821H21.1128L21.0051 23.9991L32.4752 15.9844L31.7088 9.75562H5L5.87411 16.874H18.3483L18.4583 17.7637L6.96815 25.784Z' fill='#FFFFFA'/>
        <path fillRule='evenodd' clipRule='evenodd' d='M34.8125 9.75513L37.5437 31.999H64.2747L61.5424 9.75513H34.8125Z' fill='#AA8FFF'/>
        <path fillRule='evenodd' clipRule='evenodd' d='M37.401 6.80355C39.1504 8.35962 41.6739 8.35962 43.0367 6.80355C44.4006 5.24747 44.0874 2.72397 42.3381 1.16789C40.5898 -0.389298 38.0663 -0.389298 36.7024 1.16789C35.3396 2.72397 35.6517 5.24747 37.401 6.80355Z' fill='#FFFFFA'/>
        <path fillRule='evenodd' clipRule='evenodd' d='M82.4267 21.3141L74.061 21.323L73.4057 15.985L81.8147 15.9916C83.7918 16.015 84.8047 17.129 84.968 18.6529C85.0724 19.6336 84.6237 21.3141 82.4267 21.3141ZM92.3074 17.7643C91.6899 12.764 87.7625 9.734 82.4245 9.75499H64.6445L67.3757 32H75.3738L74.8262 27.5506H83.2908C89.9528 27.5506 93.0016 23.3988 92.3074 17.7643Z' fill='#FFFFFA'/>
        </svg>`:Ze.Z.getTrustedHTML`<svg width='97' height='50' viewBox='0 0 97 50' fill='none'>
    <path d='M3.68063 46C5.52063 46 6.39062 45.27 6.39062 43.97C6.39062 43.09 5.98063 42.6 5.24063 42.35C5.90063 42.08 6.25063 41.57 6.25063 40.71C6.25063 39.53 5.44063 38.87 3.56063 38.87H0.830625V46H3.68063ZM3.60063 39.93C4.56063 39.93 4.96063 40.23 4.96063 40.85C4.96063 41.53 4.49063 41.82 3.61063 41.82H2.11063V39.93H3.60063ZM3.53063 42.88C4.56063 42.88 5.05063 43.17 5.05063 43.86C5.05063 44.53 4.63063 44.88 3.51063 44.88H2.11063V42.88H3.53063ZM11.2934 46H12.3934V40.25H11.0734V43.24C11.0734 44.26 10.6334 44.97 9.76336 44.97C8.87336 44.97 8.59336 44.35 8.59336 43.45V40.25H7.28336V43.81C7.28336 45.24 7.94336 46.12 9.31336 46.12C10.2534 46.12 10.8734 45.65 11.1734 44.9L11.2934 46ZM13.9522 48.15C15.4922 48.15 15.8022 47.93 16.4722 46.33L18.9922 40.25H17.6122L16.0922 44.15L16.0222 44.4L15.9722 44.14L14.4122 40.25H13.0122L15.3922 45.85L15.2822 46.12C14.9422 46.85 14.7322 47.01 13.9622 47.01H13.2922V48.15H13.9522ZM23.9852 43C23.9852 41.94 24.4452 41.25 25.4152 41.25C26.3452 41.25 26.6552 41.85 26.6552 42.78V46H27.9752V42.46C27.9752 41.03 27.2352 40.11 25.8452 40.11C24.8552 40.11 24.2052 40.62 23.8952 41.4L23.7752 40.25H22.6652V46H23.9852V43ZM31.8384 46.15C33.5684 46.15 34.7384 45.11 34.7384 43.24V43.09C34.7384 41.19 33.5384 40.11 31.8384 40.11C30.1684 40.11 28.9384 41.16 28.9384 43.09V43.24C28.9384 45.11 29.9884 46.15 31.8384 46.15ZM31.8384 45C30.8684 45 30.2784 44.35 30.2784 43.22V43.09C30.2784 41.88 30.9184 41.23 31.8484 41.23C32.7884 41.23 33.4084 41.92 33.4084 43.09V43.22C33.4084 44.36 32.8184 45 31.8384 45ZM40.6934 46H41.8634L43.6534 40.25H42.3734L41.1734 44.33L39.7734 40.25H38.9134L37.4034 44.34L36.3934 40.25H35.0934L36.6434 46H37.8334L39.3234 42.17L40.6934 46ZM43.8708 47.51C44.9508 47.36 45.4608 46.67 45.4608 45.59C45.4608 44.76 45.2208 44.48 44.5908 44.48C43.9808 44.48 43.7208 44.68 43.7208 45.3C43.7208 45.94 43.9308 46.07 44.4408 46.07C44.5108 46.07 44.5708 46.06 44.6408 46.05C44.5708 46.52 44.3208 46.78 43.8508 46.86L43.8708 47.51ZM52.6136 45.01C51.6636 45.01 51.0736 44.3 51.0736 43.19V43.09C51.0736 41.96 51.6936 41.23 52.6436 41.23C53.5336 41.23 54.1636 41.88 54.1636 43.11V43.23C54.1636 44.37 53.5836 45.01 52.6136 45.01ZM53.0236 46.12C54.4636 46.12 55.4936 45.14 55.4936 43.25V43.11C55.4936 41.18 54.5336 40.11 53.0436 40.11C52.0436 40.11 51.3736 40.64 51.0636 41.42L50.9236 40.25H49.8336V47.98H51.1036V44.99C51.4336 45.69 52.0736 46.12 53.0236 46.12ZM58.5238 45.14C57.9138 45.14 57.6238 44.88 57.6238 44.42C57.6238 44.15 57.7238 43.98 57.9638 43.82C58.2238 43.65 58.5138 43.57 59.2138 43.46C59.7338 43.38 60.1338 43.27 60.3738 43.09V43.4C60.3738 44.23 59.6538 45.14 58.5238 45.14ZM60.5638 46H61.6238V42.12C61.6238 40.89 60.9438 40.11 59.0838 40.11C57.4438 40.11 56.4738 40.98 56.3838 42.28H57.7338C57.7738 41.55 58.2038 41.13 59.1538 41.13C60.0438 41.13 60.3638 41.43 60.3638 41.91C60.3638 42.38 59.9438 42.52 58.9238 42.65C57.8338 42.82 57.4338 42.89 56.9438 43.2C56.4738 43.49 56.1938 43.97 56.1938 44.61C56.1938 45.55 56.8338 46.15 58.0738 46.15C59.2638 46.15 60.0338 45.6 60.4238 44.85L60.5638 46ZM62.9854 48.15C64.5254 48.15 64.8354 47.93 65.5054 46.33L68.0254 40.25H66.6454L65.1254 44.15L65.0554 44.4L65.0054 44.14L63.4454 40.25H62.0454L64.4254 45.85L64.3154 46.12C63.9754 46.85 63.7654 47.01 62.9954 47.01H62.3254V48.15H62.9854ZM73.0284 46V38.3H71.7184V46H73.0284ZM76.2581 45.14C75.6481 45.14 75.3581 44.88 75.3581 44.42C75.3581 44.15 75.4581 43.98 75.6981 43.82C75.9581 43.65 76.2481 43.57 76.9481 43.46C77.4681 43.38 77.8681 43.27 78.1081 43.09V43.4C78.1081 44.23 77.3881 45.14 76.2581 45.14ZM78.2981 46H79.3581V42.12C79.3581 40.89 78.6781 40.11 76.8181 40.11C75.1781 40.11 74.2081 40.98 74.1181 42.28H75.4681C75.5081 41.55 75.9381 41.13 76.8881 41.13C77.7781 41.13 78.0981 41.43 78.0981 41.91C78.0981 42.38 77.6781 42.52 76.6581 42.65C75.5681 42.82 75.1681 42.89 74.6781 43.2C74.2081 43.49 73.9281 43.97 73.9281 44.61C73.9281 45.55 74.5681 46.15 75.8081 46.15C76.9981 46.15 77.7681 45.6 78.1581 44.85L78.2981 46ZM83.8163 44.78H83.4063C82.4463 44.78 82.2963 44.62 82.2963 43.48V41.41H83.8163V40.25H82.2963V38.7H81.1763C81.1763 38.87 81.1663 39.21 81.1562 39.46C81.1163 40.16 81.0063 40.3 80.4663 40.3H79.9563V41.41H81.0763V43.7C81.0763 45.44 81.4563 46 83.0763 46H83.8163V44.78ZM89.9988 44.3H88.5888C88.3888 44.79 87.9688 45.07 87.2788 45.07C86.3288 45.07 85.7488 44.55 85.6388 43.61H90.0788V43C90.0788 41.53 89.2487 40.11 87.2688 40.11C85.4788 40.11 84.3388 41.28 84.3388 43.11V43.25C84.3388 45.03 85.2887 46.15 87.2288 46.15C88.7288 46.15 89.6588 45.46 89.9988 44.3ZM87.2788 41.15C88.1988 41.15 88.6788 41.7 88.7688 42.58H85.6488C85.7888 41.67 86.3688 41.15 87.2788 41.15ZM92.3438 46V43.34C92.3438 42.01 92.6638 41.53 94.0138 41.53H94.5838V40.2H94.1938C93.1138 40.2 92.5038 40.66 92.2838 41.6L92.1138 40.25H91.0538V46H92.3438ZM95.3323 46.12C95.9223 46.12 96.2123 45.87 96.2123 45.24C96.2123 44.59 95.9123 44.37 95.3323 44.37C94.7523 44.37 94.4523 44.59 94.4523 45.24C94.4523 45.9 94.6923 46.12 95.3323 46.12Z' fill='#1A0826'/>
    <path fillRule='evenodd' clipRule='evenodd' d='M6.96815 25.784L7.73119 31.9994H34.4411L33.5681 24.8821H21.1128L21.0051 23.9991L32.4752 15.9844L31.7088 9.75562H5L5.87411 16.874H18.3483L18.4583 17.7637L6.96815 25.784Z' fill='#1A0826'/>
    <path fillRule='evenodd' clipRule='evenodd' d='M34.8125 9.75513L37.5437 31.999H64.2747L61.5424 9.75513H34.8125Z' fill='#A690F8'/>
    <path fillRule='evenodd' clipRule='evenodd' d='M37.401 6.80355C39.1504 8.35962 41.6739 8.35962 43.0367 6.80355C44.4006 5.24747 44.0874 2.72397 42.3381 1.16789C40.5898 -0.389298 38.0663 -0.389298 36.7024 1.16789C35.3396 2.72397 35.6517 5.24747 37.401 6.80355Z' fill='#1A0826'/>
    <path fillRule='evenodd' clipRule='evenodd' d='M82.4267 21.3141L74.061 21.323L73.4057 15.985L81.8147 15.9916C83.7918 16.015 84.8047 17.129 84.968 18.6529C85.0724 19.6336 84.6237 21.3141 82.4267 21.3141ZM92.3074 17.7643C91.6899 12.764 87.7625 9.734 82.4245 9.75499H64.6445L67.3757 32H75.3738L74.8262 27.5506H83.2908C89.9528 27.5506 93.0016 23.3988 92.3074 17.7643Z' fill='#1A0826'/>
    </svg>`}},Ke={[Fe.M$.ZIP]:u.ContinueToZip};function ze(){return Ze.Z.getTrustedHTML`<svg xmlns="http://www.w3.org/2000/svg" width="9" height="20" viewBox="0 0 9 20" fill="none">
    <path d="M3.47164 18.7076C2.91129 19.517 1.9895 20 1.00506 20H0.5V0H1.00506C1.9895 0 2.91129 0.482975 3.47164 1.29237L8.31779 8.29237C9.02902 9.3197 9.02903 10.6803 8.31779 11.7076L3.47164 18.7076Z" fill="#3267FA"/>
    </svg>`}function Qe(){return Ze.Z.getTrustedHTML`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="28" viewBox="0 0 14 28" fill="none">
    <path d="M5.11245 26.0697C4.16517 27.2876 2.70864 28 1.16569 28H0.5V0H1.16569C2.70865 0 4.16517 0.712362 5.11245 1.9303L12.1125 10.9303C13.5168 12.7359 13.5168 15.2642 12.1125 17.0697L5.11245 26.0697Z" fill="#3267FA"/>
    </svg>`}var je=i(73557),Ye=i(56372);class Je extends Ye.Z{constructor(...e){super(...e),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"localDataService",void 0)}init(e,t,i,o,a,n){this.initCommonInfo(e,t,i,o),this.edgeMessageService=a,this.sendErrorMessage=r.Md.bind(this),this.sendStorageMessage=this.edgeMessageService.SetStorageValue.bind(this.edgeMessageService),this.localDataService=n,this.initialize()}updateTotalPriceInStorage(e){this.totalPrice=e,this.domainData?.blockedList&&this.writeToList(this.domainData?.blockedList,je.sR.AUTO_SHOW_COUPONS_CHECKOUT,!1)}initialize(){this.autoOpenDataStr=this.localDataService.GetLocalData(Ne.Q.AutoOpenData),this.lastCleanedDataStr=this.localDataService.GetLocalData(Ne.Q.LastCleanedData),this.initializeData()}}var Xe=Je,qe=class{static IsAttainableCoupon(e,t){const i=e?.minimumPurchase??e?.calculatedCutoffPrice??0;return e?.shortHeader&&void 0!==t&&i>t}static ShouldPromoteAttainableCoupon(e,t,i){const o=i&&t?i-t:0;if(!e||o<=0)return!1;let a=Number(e.amount);if(e.type.includes("Percent"))a=i*e.amount/100;else if("Amount"!==e.type)return!1;return o<a&&{couponSavings:a,amountToThreshold:o}}static GetSavingsAmount(e){if(!e)return null;const t=/(Percentage|Amount)Offer ([0-9]+)/.exec(e);return t&&t[1]&&t[2]?{amount:t[2],type:t[1]}:void 0}static GetSavingsString(e,t){if(!e)return null;if(e.type.includes("Percent"))return`${e.amount}% OFF`;if("Amount"===e.type){const i=`${Fe.iM.currency}${e.amount} OFF`;return(0,r.sk)(i,t)}return null}};class $e extends z.Z{constructor(e,t,i,o){super(e),(0,a.Z)(this,"Hostname",void 0),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"Pathname",void 0),this.Hostname=i,this.ContextID=t,this.Pathname=o}}var et=$e,tt=class extends et{constructor(t,i,o){super(e.Vm.AutoApplyCancelledMessage,t,i,o)}},it=class extends et{constructor(t,i,o){super(e.Vm.AutoApplyCompletedMessage,t,i,o)}},ot=class extends et{constructor(t,i,o){super(e.Vm.BackgroundAutoApplyCancelledMessage,t,i,o)}};class at extends ve{constructor(...e){super(...e),(0,a.Z)(this,"divIDContextID","contextID"),(0,a.Z)(this,"divIDCloseOverlay","#btnOverlayClose"),(0,a.Z)(this,"divIDCheckoutOverlay","#btnOverlayCheckout"),(0,a.Z)(this,"divIDOverlay","divOverlayWrapper"),(0,a.Z)(this,"txtCurrentCoupon","#txtProgressCouponTitle"),(0,a.Z)(this,"divIDTestingCoupon","#divOverlayTestingCouponsWrapper"),(0,a.Z)(this,"divIDProgressBar","#divOverlayBar"),(0,a.Z)(this,"divOverlayCancel",".overlayClose"),(0,a.Z)(this,"divWalletDrawerOverlay",".divWalletDrawerOverlay"),(0,a.Z)(this,"resultCouponPath","#txtResultPositiveCoupon"),(0,a.Z)(this,"resultPath","#divOverlayResultWrapper"),(0,a.Z)(this,"resultErrorPath","#divOverlayResultError"),(0,a.Z)(this,"resultNegativePath","#divOverlayResultNegative"),(0,a.Z)(this,"resultPositivePath","#divOverlayResultPositive"),(0,a.Z)(this,"resultNegativeOfferCashbackPath","#divOverlayResultNegativeOfferCashback"),(0,a.Z)(this,"titleClassPath",".txtOverlayTitle"),(0,a.Z)(this,"messageClassPath",".txtOverlayDefault"),(0,a.Z)(this,"resultWrapperPath",".resultWrapper"),(0,a.Z)(this,"buttonClosePath","#buttonClosePath"),(0,a.Z)(this,"titleProgressBar","#txtBarTitle"),(0,a.Z)(this,"currency",void 0)}HandleMessage(t){try{const i=t.Type;if(i===e.Vm.CloseOverlayMessage)this.CloseOverlay();else if(i===e.Vm.MoveProgressBarMessage){const e=t;this.MoveProgressBar(e.StartPos,e.EndPos,this.divIDProgressBar)}else{if(i!==e.Vm.UpdateCurrencyMessage)throw Error("Invalid messageType.");{const e=t;this.currency=e.Currency}}}catch(e){return(0,r.Md)(e.message)}return new ie}MoveProgressBar(e,t,i){let o=this.selectElement(document,i);if(!o){const a=this.selectElement(document,"#"+this.divIDOverlay);if(a){const r=a.shadowRoot;r&&(o=this.selectElement(r,i))}}if(o){let n=e;const s=setInterval(c,10);function c(){n>=100?(o.style.width="100%",clearInterval(s)):n<=t?(n++,o&&n<=100&&(o.style.width=n+"%")):clearInterval(s)}}}addListenerCancelOverlay(e,t){e&&e.forEach((e=>{e.addEventListener("click",(async()=>{document.body&&document.body.setAttribute("aria-hidden","false"),t&&(at.isAutoApplyCompleted?await this.platformInstance.SendMessage(new it(this.getContextID(this.divIDContextID),location.hostname,location.pathname)):(at.isAutoApplyCancelled=!0,await this.platformInstance.SendMessage(new tt(this.getContextID(this.divIDContextID),location.hostname,location.pathname))),t.remove())}))}))}addListenerCloseOverlay(e,t,i){e&&e.addEventListener("click",(async()=>{document.body&&document.body.setAttribute("aria-hidden","false"),t&&(await this.platformInstance.SendMessage(new it(this.getContextID(this.divIDContextID),location.hostname,location.pathname)),t.remove())}),!1)}CloseOverlay(){const e=this.selectElement(document,"#"+this.divIDOverlay);e&&e.remove()}}(0,a.Z)(at,"isAutoApplyCancelled",!1),(0,a.Z)(at,"isAutoApplySkipped",!1),(0,a.Z)(at,"isAutoApplyCompleted",!1),(0,a.Z)(at,"isAutoApplyPaused",!1);var rt=at;class nt extends n.Z{constructor(e,t,i,o,r,n,s,c,l,u,d,h,p){super(),(0,a.Z)(this,"CashbackCategory",void 0),(0,a.Z)(this,"CashbackCommissionType",void 0),(0,a.Z)(this,"CashbackCommissionValue",void 0),(0,a.Z)(this,"Domain",void 0),(0,a.Z)(this,"AffiliateNetworkName",void 0),(0,a.Z)(this,"Profile",void 0),(0,a.Z)(this,"IsRebatesUser",void 0),(0,a.Z)(this,"IsRebatesSupportedDomain",void 0),(0,a.Z)(this,"IsSignInSupportedDomain",void 0),(0,a.Z)(this,"MerchantFullName",void 0),(0,a.Z)(this,"ButtonPosition",void 0),(0,a.Z)(this,"FlyoutId",void 0),(0,a.Z)(this,"IsEstimatedCashback",void 0),(0,a.Z)(this,"PageType",void 0),this.CashbackCategory=e??"",this.CashbackCommissionType=t??"",this.CashbackCommissionValue=i??"",this.Domain=o??"",this.AffiliateNetworkName=r??"",this.Profile=n??"",this.IsRebatesUser=s,this.IsRebatesSupportedDomain=c??"",this.IsSignInSupportedDomain=l??!1,this.MerchantFullName=u??"",this.ButtonPosition=d??"",this.IsEstimatedCashback=h??!1,this.PageType=p??""}}var st=nt;class ct extends z.Z{constructor(t,i,o,r,n,s){super(e.Vm.CheckoutPageMessage),(0,a.Z)(this,"Command",void 0),(0,a.Z)(this,"DomPath",void 0),(0,a.Z)(this,"DomValue",void 0),(0,a.Z)(this,"SelectorType",void 0),(0,a.Z)(this,"AutoApplyScenario",void 0),(0,a.Z)(this,"OtherData",void 0),this.DomPath=i,this.DomValue=o,this.Command=t,this.SelectorType=r,this.AutoApplyScenario=n,this.OtherData=s}}var lt=ct,ut=i(56764),dt=i(3634),ht=i(59645),pt=i(36818);class gt extends z.Z{constructor(t,i){super(e.Vm.MoveProgressBarMessage),(0,a.Z)(this,"StartPos",void 0),(0,a.Z)(this,"EndPos",void 0),this.StartPos=t,this.EndPos=i}}var Ct=gt;class St extends z.Z{constructor(t,i,o,r,n){super(e.Vm.UpdateCurrentCouponMessage),(0,a.Z)(this,"CurrentCoupon",void 0),(0,a.Z)(this,"CurrentCouponIndex",void 0),(0,a.Z)(this,"TotalCoupons",void 0),(0,a.Z)(this,"CurrentBestDiscount",void 0),(0,a.Z)(this,"IsSuggestedCoupon",void 0),this.CurrentCoupon=t,this.CurrentCouponIndex=i,this.TotalCoupons=o,this.CurrentBestDiscount=r,this.IsSuggestedCoupon=n??!1}}var mt=St,At=class extends et{constructor(t,i,o,r,n){super(e.Vm.EdgeApplyCouponsMessage,i,o,r),(0,a.Z)(this,"checkoutPageData",void 0),(0,a.Z)(this,"startNew",void 0),this.checkoutPageData=t,this.startNew=n}},ft=class{constructor(e,t){(0,a.Z)(this,"messageType",void 0),(0,a.Z)(this,"result",void 0),(0,a.Z)(this,"bestCoupon",void 0),(0,a.Z)(this,"maxDiscount",void 0),(0,a.Z)(this,"initialPrice",void 0),(0,a.Z)(this,"errorName",void 0),this.messageType=e,this.result=t}SetPositiveResultInfo(e,t,i){this.bestCoupon=e,this.maxDiscount=t,this.initialPrice=i}SetErrorInfo(e){this.errorName=e}};let vt=function(e){return e[e.PopupClosed=1]="PopupClosed",e[e.AutoApplyCompleted=2]="AutoApplyCompleted",e[e.IsInCheckout=4]="IsInCheckout",e[e.LeftCheckout=8]="LeftCheckout",e[e.CartChanged=16]="CartChanged",e[e.AutoApplyCancelled=32]="AutoApplyCancelled",e}({});class Et{constructor(){(0,a.Z)(this,"Events",void 0),(0,a.Z)(this,"Hostname",void 0)}static CreateNew(e){const t=new Et;return t.Events=0,t.Hostname=e,t.NormalizeHostname(),t}static CreateFromObject(e){const t=new Et;return t.Events=e.Events,t.Hostname=e.Hostname,t.NormalizeHostname(),t}SetState(e,t){try{t?this.Events|=e:this.Events&=1023&~e}catch(e){throw Error((0,r.SM)(e.message,"Set State"))}}HasState(e){return this.Events&e}NormalizeHostname(){this.Hostname=(0,r.uE)(this.Hostname)}}var Pt=Et;let It=function(e){return e.expressCheckout="expressCheckout",e.calculatedCutOffFiltering="calculatedCutOffFiltering",e.useBackgroundAutoApplyResult="useBackgroundAutoApplyResult",e.onlineSelectorExtraction="onlineSelectorExtraction",e.autoTriggeredAutoApply="autoTriggeredAutoApply",e.applyCopiedCoupon="applyCopiedCoupon",e.discoverChatChips="discoverChatChips",e.productBestCoupon="productBestCoupon",e.aaEarlyReturn="aaEarlyReturn",e.exclusiveCoupon="exclusiveCoupon",e}({});var Tt=i(79249),Ot=i(23727);class yt extends z.Z{constructor(t,i){super(e.Vm.RunQuerySelectorAllOnBodyMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"selectors",void 0),this.ContextID=t,this.selectors=i}}var Dt=yt,bt=class{constructor(e){(0,a.Z)(this,"platformSpecific",void 0),(0,a.Z)(this,"isBgAAScenario",!1),(0,a.Z)(this,"bgAutoApplyCancelled",!1),(0,a.Z)(this,"isPDPBgAutoApply",!1),(0,a.Z)(this,"isBestCouponBgAutoApply",!1),this.platformSpecific=e}async IsFieldVisible(e,t,i){if(m.ZP.IsValidDataField(t)){const o=await this.SendDomMessage(e,new lt(Ce.CountMatchingElements,t,""),i,!1);return!!o&&o.NumElements>0}return!1}async IsFieldNotDisabled(e,t,i){if(m.ZP.IsValidDataField(t)){const o=await this.SendDomMessage(e,new lt(Ce.GetDisabledValue,t,""),i,!1);return!!o&&!o?.DisabledValue}return!1}async SendDomMessage(e,t,i,o){(this.isBgAAScenario||this.isPDPBgAutoApply)&&this.bgAutoApplyCancelled&&(0,r.TR)(Me.AutoApplyCancelled,"AutoApply Cancelled");let a=new ie;try{a=await this.platformSpecific.SendMessage(t,e)}catch(e){if(o){if(t instanceof lt){const o=t;throw Error((0,r.SM)(e.ErrorMsg,i,o.DomPath))}if(!e.ErrorName)throw Error((0,r.SM)(e.ErrorMsg,i));(0,r.TR)(e.ErrorName,e.ErrorMsg)}}return a}async getElementsBySelectors(e,t){return await this.SendDomMessage(e,new Dt(e,t),"RunQuerySelectorAllOnBodyMessage",!0)}};class Nt extends bt{constructor(t,i,o,r,n,s,c){super(t),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"stateService",void 0),(0,a.Z)(this,"broadcastChannelService",void 0),(0,a.Z)(this,"entryPointService",void 0),(0,a.Z)(this,"checkoutPageData",void 0),(0,a.Z)(this,"checkoutPageUrlData",void 0),(0,a.Z)(this,"state",void 0),(0,a.Z)(this,"timeoutHandler",void 0),(0,a.Z)(this,"contextId",void 0),this.logService=i,this.overlayService=o,this.edgeMessageService=r,this.contextId=e.og.FromBackground,this.stateService=n,this.broadcastChannelService=s,this.entryPointService=c}CheckIfBgAAIsEnabled(){return!!this.checkoutPageUrlData.backgroundAAEnabled&&this.checkoutPageUrlData.edgeEnabled}async SetUpBackgroundAutoApply(t,i,o,a){const r="SetUpBackgroundAutoApply";if(!this.InitializeCheckoutPageUrlData(t))return this.LogError(r,pe.x.BackgroundAAError,"InitializeCheckoutPageUrlData is false"),!1;const n=this.CheckIfBgAAIsEnabled();switch(i){case e.$o.BackgroundAutoApply:if(o&&n){this.PrepareBgAutoApplyBackgroundScenario();break}return!1===n&&this.LogError(r,pe.x.BackgroundAAError,"Called BackgroundAutoApply scenario when CheckIfBgAAIsEnabled is false"),!1;case e.$o.ForegroundAutoApply:if(n&&await this.PrepareBgAutoApplyForegroundScenario(t))return!1;!1===n&&this.LogError(r,pe.x.BackgroundAAError,"Called ForegroundAutoApply scenario when CheckIfBgAAIsEnabled is false");break;case e.$o.ProductPageBackgroundAutoApply:if(a){this.PrepareProductPageBackgroundScenario();break}return this.LogError(r,pe.x.BackgroundAAPDPDisabled,"Called ProductPageBackgroundAutoApply scenario when exp is off"),!1;case e.$o.BackgroundAutoApplyBestCoupon:if(a){this.PrepareBestCouponBackgroundScenario();break}return this.LogError(r,pe.x.BackgroundAAPDPDisabled,"Called BackgroundAutoApplyBestCoupon scenario when exp is off"),!1}return!0}GetBackgroundAutoApplyScenario(t,i,o,a){return!1===t.web_contents_is_hidden?i?e.$o.ForegroundAutoApply:void 0:!0===t.web_contents_is_hidden?!0===a?e.$o.BackgroundAutoApplyBestCoupon:!1===o?e.$o.BackgroundAutoApply:!0===t.is_pdp_scenario?e.$o.ProductPageBackgroundAutoApply:e.$o.BackgroundAutoApply:void 0}async PrepareBgAutoApplyForegroundScenario(t){if(this.state=await ho.GetApplicatorStateService().LoadCouponApplicatorState(),this.state){if(!this.state.BackgroundAAStatus.BgAutoApplyInProgress)return!1;if(this.state.BackgroundAAStatus.ForegroundApplyingBestCoupon){ho.GetLocalDataService().SaveLocalData(Ne.Q.ForegroundAutoApply,!0);const t=new At(this.checkoutPageData,e.og.FromBackground,(0,r.S8)(),location.pathname,!1);ho.GetBackgroundMessagingService().HandleMessage(t)}else this.CreateBroadcastChannel(t,this.state,!0)}else this.state=this.CreateState(),this.ClearUIState(),this.CreateBroadcastChannel(t,this.state);return!0}PrepareBgAutoApplyBackgroundScenario(){ho.GetLocalDataService().SaveLocalData(Ne.Q.BackgroundAutoApply,!0)}PrepareBestCouponBackgroundScenario(){ho.GetLocalDataService().SaveLocalData(Ne.Q.BestCouponBackgroundAutoApply,!0)}PrepareProductPageBackgroundScenario(){ho.GetLocalDataService().SaveLocalData(Ne.Q.ProductPageBackgroundAutoApply,!0)}async CreateBroadcastChannel(e,t,i){this.checkoutPageData=e,this.InitializeCheckoutPageUrlData(e)&&(this.broadcastChannelService.GetBgAutoApplyChannel(),this.broadcastChannelService.setOnMessageEventHandler((e=>{this.BackgroundAutoApplyMessageHandler(e)})),i||this.SendSubscribedToBroadcastChannelMessage(),this.SetBgAutoApplyTimeout(this.checkoutPageUrlData.backgroundAutoApplyStartTimeout??Nt.StartWaitTime,(()=>{this.SwitchToRegularAutoApply()})),await this.overlayService.OpenOverlay(this.contextId,t.BackgroundAAStatus.currentCoupon,t.BackgroundAAStatus.couponsTotal,t.MaxDiscount,this.checkoutPageUrlData,t.BackgroundAAStatus.currentCouponIndex,!0))}SetBgAutoApplyTimeout(e,t){this.timeoutHandler=window.setTimeout(t,e)}ClearBgAutoApplyTimeout(){this.timeoutHandler&&window.clearTimeout(this.timeoutHandler)}ResetBgAutoApplyTimeout(e,t){this.ClearBgAutoApplyTimeout(),this.SetBgAutoApplyTimeout(e,t)}async SwitchToRegularAutoApply(){this.ClearBgAutoApplyTimeout(),this.edgeMessageService.SendDestructBgAutoApplyMessage(),this.broadcastChannelService.Close();const t=ho.GetApplicatorStateService();let i=await t.LoadCouponApplicatorState();i||(i=this.state),i&&(i.BackgroundAAStatus=new Ot.Z),t.SaveCouponApplicatorState(i),ho.GetLocalDataService().SaveLocalData(Ne.Q.FallBackAutoApply,!0);const o=new At(this.checkoutPageData,e.og.FromBackground,(0,r.S8)(),location.pathname,!1);ho.GetBackgroundMessagingService().HandleMessage(o)}async CleanUpCancelledAA(){this.overlayService.CloseOverlay(this.contextId),this.edgeMessageService.SendDestructBgAutoApplyMessage();const t=ho.GetLogService();this.ClearBgAutoApplyTimeout(),this.broadcastChannelService.Close();const i=await this.stateService.LoadCouponApplicatorState();let o=new pt.Z((0,r.S8)(),this.entryPointService.GetEntryPoint());i?(this.stateService.SaveCouponApplicatorState(null),o=this.GetTelemetryDataFromState(i,e.ps.Cancelled)):o.SetResultData(e.ps.Cancelled,-1,"",[],0,0,!1,e.KE.BackgroundAutoApply,void 0,void 0,this.checkoutPageData.market),t.LogClientEventV2(e.in.Information,e.R.AutoApply,Me.AutoApplyCancelled,o,i?.ImpressionId)}SendSubscribedToBroadcastChannelMessage(){this.edgeMessageService.SendSubscribedToBroadcastChannelMessage()}async BackgroundAutoApplyMessageHandler(t){const i=this.checkoutPageUrlData.backgroundAutoApplyInProgressTimeout;this.ResetBgAutoApplyTimeout(i??Nt.InProgressWaitTime,(()=>{this.SwitchToRegularAutoApply()}));const o=JSON.parse(t.data),a=Tt.Z.CreateFromObject(o.state);if(o.messageType===h.AutoApplyStarted)return;if(null==a)throw this.ClearBgAutoApplyTimeout(),this.broadcastChannelService.Close(),this.stateService.SaveCouponApplicatorState(null),new Error("Auto Apply Error");if(o.messageType===h.AutoApplyFinished){if(this.ClearBgAutoApplyTimeout(),o.result===e.ps.Error){const t=o.errorName+":"+o.errorMessage;return this.overlayService.ShowResult(this.contextId,e.ps.Error,this.checkoutPageData.retailerData.domainName,t,a,this.checkoutPageData.cashback,e.KE.BackgroundAutoApply,this.checkoutPageData.coupons,void 0,void 0,void 0,void 0,this.checkoutPageData.market),this.broadcastChannelService.Close(),void this.stateService.SaveCouponApplicatorState(null)}a.BackgroundAAStatus.ForegroundApplyingBestCoupon=!0,this.stateService.SaveCouponApplicatorState(a),ho.GetLocalDataService().SaveLocalData(Ne.Q.ForegroundAutoApply,!0);const t=new At(this.checkoutPageData,e.og.FromBackground,(0,r.S8)(),location.pathname,!1);return void ho.GetBackgroundMessagingService().HandleMessage(t)}const n=a.BackgroundAAStatus;o.messageType===h.ProgressBarUpdate&&(this.stateService.SaveCouponApplicatorState(a),await this.SendDomMessage(this.contextId,new Ct(n.progressBarStartPos,n.progressBarEndPos),"Progress Bar Update",!0)),o.messageType===h.CouponUpdate&&(this.stateService.SaveCouponApplicatorState(a),await this.SendDomMessage(this.contextId,new mt(n.currentCoupon,n.currentCouponIndex,n.couponsTotal,a.MaxDiscount),"Current Coupon",!0))}async BackgroundAutoApplyCancelHandler(t){this.ResetBgAutoApplyTimeout(this.checkoutPageUrlData.backgroundAutoApplyCancelTimeout??Nt.CancelWaitTime,(()=>{this.CleanUpCancelledAA()}));const i=JSON.parse(t.data),o=Tt.Z.CreateFromObject(i.state);if(i.messageType===h.AutoApplyFinished)if(null!=o){if(i.result===e.ps.Cancelled){this.ClearBgAutoApplyTimeout(),this.broadcastChannelService.Close(),this.stateService.SaveCouponApplicatorState(null);const t=this.GetTelemetryDataFromState(o,e.ps.Cancelled);this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,Me.AutoApplyCancelled,t,o?.ImpressionId)}if(i.result===e.ps.Error){this.ClearBgAutoApplyTimeout(),this.broadcastChannelService.Close(),this.stateService.SaveCouponApplicatorState(null);const t=i.errorName+":"+i.errorMessage,a=this.GetTelemetryDataFromState(o,e.ps.Error);a.SetErrorData(e.ps.Error,i.errorName),this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,t,a)}this.overlayService.CloseOverlay(this.contextId)}else this.LogError("BackgroundAutoApplyCancelHandler",pe.x.UndefinedState,"Got null state in background script message");else o?.BackgroundAACancelled||this.SendCancelMesssageToBgAutoApply()}GetTelemetryDataFromState(t,i,o){const a=t?.MaxDiscount??0,n=t?.InitialPrice??0,s=t.BestCoupon?.couponCode,c=t.BestCoupon?.isStackable??!1,l=t?.StartTime?Date.now()-t.StartTime:-1,u=new pt.Z((0,r.S8)(),this.entryPointService.GetEntryPoint());return u.SetResultData(i,l,s,t?.CouponResults??[],a,n,c,o??e.KE.BackgroundAutoApply,void 0,void 0,this.checkoutPageData?.market,t?.Metadata),u.SetCurrencyInfo(t?.Currency??"",t?.PageCurrency??""),u}SendCancelMesssageToBgAutoApply(){this.broadcastChannelService.PostMessage(new ft(p.CancelAutoApply,e.ps.Cancelled)),this.ResetBgAutoApplyTimeout(this.checkoutPageUrlData.backgroundAutoApplyCancelTimeout??Nt.CancelWaitTime,(()=>{this.CleanUpCancelledAA()}))}LogError(e,t,i){const o={EntryPoint:this.entryPointService?.GetEntryPoint(),FunctionName:e},a=new me.Z(this.checkoutPageData?.retailerData.domainName??(0,r.S8)(),t??pe.x.BackgroundAAError,o,void 0);this.logService.LogClientErrorV2(i??"",a)}GetAutoApplyScenario(){let t=e.KE.AutoApplyCoupons;try{const i=ho.GetLocalDataService(),o=i.GetLocalData(Ne.Q.BackgroundAutoApply),a=i.GetLocalData(Ne.Q.ForegroundAutoApply),r=i.GetLocalData(Ne.Q.ProductPageBackgroundAutoApply),n=i.GetLocalData(Ne.Q.FallBackAutoApply),s=i.IsFeatureEnabled(It.useBackgroundAutoApplyResult);t=i.GetLocalData(Ne.Q.BestCouponBackgroundAutoApply)?e.KE.BestCouponBackgroundAutoApply:r?e.KE.ProductPageBackgroundAutoApply:o||a?e.KE.BackgroundAutoApply:s?e.KE.BackgroundAAResult:n?e.KE.FallBackAutoApply:t}catch(e){}return t}GetEdgeMessagingService(){return this.edgeMessageService}CreateState(){const e=Tt.Z.CreateNew(this.contextId,this.checkoutPageData.impressionId);return e.BackgroundAAStatus.couponsTotal=this.checkoutPageData.coupons.length,e.BackgroundAAStatus.currentCoupon=this.checkoutPageData.coupons[0].couponCode,e.BackgroundAAStatus.currentCouponIndex=0,e.BackgroundAAStatus.BgAutoApplyInProgress=!0,e.MaxDiscount=0,e.ImportOptions=ho.GetLocalDataService().GetLocalData(Ne.Q.ImportOptions),e.CashBackActive=ho.GetLocalDataService().GetLocalData(Ne.Q.CashBackActive),this.stateService.SaveCouponApplicatorState(e),e}InitializeCheckoutPageUrlData(e){this.checkoutPageData=e;const t=this.checkoutPageData.retailerData.GetCurrentCheckoutPage();if(t)return this.checkoutPageUrlData=t,!0;{const e="Called BackgroundAAService without checkout page data";return this.LogError("InitializeCheckoutPageUrlData",pe.x.AutoApplyWithoutCheckout,e),!1}}async ClearUIState(){await ho.GetApplicatorStateService().SaveUIState(new Pt)}}(0,a.Z)(Nt,"StartWaitTime",1e4),(0,a.Z)(Nt,"InProgressWaitTime",45e3),(0,a.Z)(Nt,"CancelWaitTime",1e4);var Rt=Nt;class _t{static GetInstance(){return this.Instance}}(0,a.Z)(_t,"Instance",new class{constructor(){(0,a.Z)(this,"ChannelName","BgAutoApplyChannel"),(0,a.Z)(this,"channel",void 0),this.channel=new BroadcastChannel(this.ChannelName)}GetBgAutoApplyChannel(){return this.channel||(this.channel=new BroadcastChannel(this.ChannelName)),this.channel}PostMessage(e){this.channel&&this.channel.postMessage(e)}GetNewInstance(){return new BroadcastChannel(this.ChannelName)}setOnMessageEventHandler(e){this.channel&&(this.channel.onmessage=e)}Close(){this.channel&&(this.channel.close(),this.channel=null)}});var kt=_t;class wt extends n.Z{constructor(t,i){super(),(0,a.Z)(this,"Status",void 0),(0,a.Z)(this,"EntryPoint",void 0),(0,a.Z)(this,"Domain",void 0),(0,a.Z)(this,"ECProcessTime",void 0),(0,a.Z)(this,"ECType",void 0),this.Status=t,this.ECProcessTime=0,this.EntryPoint=i??e.N9.Shopping}}var xt=wt;let Ut=function(e){return e.Start="START",e.Success="SUCCESS",e.Error="ERROR",e.Cancelled="CANCELLED",e.BNPLSuccess="BNPLSuccess",e.BNPLFailed="BNPLFailed",e}({});var Mt=i(17204);let Lt=function(e){return e.CCNUpdate="CCNUpdate",e.CCName="CCName",e.CCFirstName="CCFirstName",e.CCMiddleName="CCMiddleName",e.CCLastName="CCLastName",e.CCExpiry="CCExpiry",e.CCExpiryMonth="CCExpiryMonth",e.CCExpiryYear="CCExpiryYear",e.CCSecurityCode="CCSecurityCode",e}({});const Bt=()=>{const e=new Map;return e.set("ALABAMA","AL"),e.set("ALASKA","AK"),e.set("ARIZONA","AZ"),e.set("ARKANSAS","AR"),e.set("CALIFORNIA","CA"),e.set("COLORADO","CO"),e.set("CONNECTICUT","CT"),e.set("DELAWARE","DE"),e.set("DISTRICT OF COLUMBIA","DC"),e.set("WASHINGTON DC","DC"),e.set("FLORIDA","FL"),e.set("GEORGIA","GA"),e.set("HAWAII","HI"),e.set("IDAHO","ID"),e.set("ILLINOIS","IL"),e.set("INDIANA","IN"),e.set("IOWA","IA"),e.set("KANSAS","KS"),e.set("KENTUCKY","KY"),e.set("LOUISIANA","LA"),e.set("MAINE","ME"),e.set("MARYLAND","MD"),e.set("MASSACHUSETTS","MA"),e.set("MICHIGAN","MI"),e.set("MINNESOTA","MN"),e.set("MISSISSIPPI","MS"),e.set("MISSOURI","MO"),e.set("MONTANA","MT"),e.set("NEBRASKA","NE"),e.set("NEVADA","NV"),e.set("NEW HAMPSHIRE","NH"),e.set("NEW JERSEY","NJ"),e.set("NEW MEXICO","NM"),e.set("NEW YORK","NY"),e.set("NORTH CAROLINA","NC"),e.set("NORTH DAKOTA","ND"),e.set("OHIO","OH"),e.set("OKLAHOMA","OK"),e.set("OREGON","OR"),e.set("PENNSYLVANIA","PA"),e.set("RHODE ISLAND","RI"),e.set("SOUTH CAROLINA","SC"),e.set("SOUTH DAKOTA","SD"),e.set("TENNESSEE","TN"),e.set("TEXAS","TX"),e.set("UTAH","UT"),e.set("VERMONT","VT"),e.set("VIRGINIA","VA"),e.set("WASHINGTON","WA"),e.set("WEST VIRGINIA","WV"),e.set("WISCONSIN","WI"),e.set("WYOMING","WY"),e.set("VIRGIN ISLANDS","VI"),e.set("U.S. VIRGIN ISLANDS","VI"),e.set("PALAU","PW"),e.set("N. MARIANA ISLANDS","MP"),e.set("NORTHERN MARIANA ISLANDS","MP"),e.set("GUAM","GU"),e.set("AMERICAN SAMOA","AS"),e.set("MICRONESIA","FM"),e.set("MARSHALL ISLANDS","MH"),e};var Ft=i(33491);class Zt{constructor(){(0,a.Z)(this,"IsAutoApplyIncluded",void 0),(0,a.Z)(this,"CheckoutProgress",void 0),(0,a.Z)(this,"IsShippingOptionsDone",void 0),(0,a.Z)(this,"CouponApplicatorState",void 0)}static CreateFromObject(e){const t=new Zt;return e&&(void 0!==e.IsAutoApplyIncluded&&(t.IsAutoApplyIncluded=e.IsAutoApplyIncluded),void 0!==e.CheckoutProgress&&(t.CheckoutProgress=e.CheckoutProgress),void 0!==e.IsShippingOptionsDone&&(t.IsShippingOptionsDone=e.IsShippingOptionsDone),e.CouponApplicatorState&&(t.CouponApplicatorState=Tt.Z.CreateFromObject(e.CouponApplicatorState))),t}ToString(){return this.CouponApplicatorState&&this.CouponApplicatorState.StringifyMap(),JSON.stringify(this)}}var Gt=Zt,Ht=function(e){return e.ClickBefore="clickBefore",e.FirstName="firstName",e.MiddleName="middleName",e.LastName="lastName",e.Name="name",e.Address1="address1",e.Address2="address2",e.City="city",e.State="state",e.ZipCode="zipCode",e.Continue="continue",e.Continue2="continue2",e.Confirm="confirm",e.FieldError="fieldError",e.FormError="formError",e.CardType="cardType",e.ExpiryMonth="expiryMonth",e.ExpiryYear="expiryYear",e.ExpiryDate="expiryDate",e.Email="email",e.ConfirmEmail="confirmEmail",e.RefreshAfterContinue="refreshAfterContinue",e.Check="check",e.Signup="signUp",e}(Ht||{}),Vt=function(e){return e.ShippingAddress="ShippingAddress",e.ContactInfo="ContactInfo",e.ShippingOptions="ShippingOptions",e.Payment="Payment",e.PaymentIframe="PaymentIframe",e.BillingAddress="BillingAddress",e}(Vt||{}),Wt=function(e){return e.MonthYear="MonthYear",e.Month="Month",e.Year="Year",e}(Wt||{}),Kt=function(e){return e.First="First",e.Second="Second",e}(Kt||{}),zt=i(41290),Qt=class{constructor(e){(0,a.Z)(this,"platformSpecific",void 0),this.platformSpecific=e}async GetUX(t,i){let o=this.platformSpecific.GetUrl(t);i&&(o=o+"?"+new URLSearchParams(i));const a=await fetch(o).then((e=>e.text()));return a?(0,r.BE)(a,e.UA.PlainString,this.platformSpecific.GetAppInfoClientName()):a}GetUXStyles(e){}};function jt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function Yt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}var Jt=i(84830),Xt=class{constructor(e,t,i,o,r,n){(0,a.Z)(this,"EventType",void 0),(0,a.Z)(this,"JsonData",void 0),(0,a.Z)(this,"LogLevel",void 0),(0,a.Z)(this,"Message",void 0),(0,a.Z)(this,"ClientContext",void 0),(0,a.Z)(this,"ImpressionId",void 0),(0,a.Z)(this,"EventTime",void 0),this.LogLevel=e,this.EventType=t,this.JsonData=i,this.Message=o,this.ClientContext=n,this.ImpressionId=r,this.EventTime=(new Date).getTime()}ToString(){return JSON.stringify(this)}};class qt extends n.Z{constructor(){super()}}var $t=qt,ei=class{constructor(e){(0,a.Z)(this,"platformSpecific",void 0),this.platformSpecific=e}async LogMessage(t){const i=Date.now().toString();await this.LogClientEventV2(e.in.Debug,e.R.DebugMessage,i+": "+t,new $t)}async LogClientErrorV2(t,i){await this.LogClientEventV2(e.in.Error,e.R.ClientError,t,i)}},ti=class{},ii=i(71951),oi=i(31714),ai=class{constructor(e,t){(0,a.Z)(this,"messageType",void 0),(0,a.Z)(this,"result",void 0),(0,a.Z)(this,"state",void 0),(0,a.Z)(this,"errorName",void 0),(0,a.Z)(this,"errorMessage",void 0),this.messageType=e,this.state=t}SetErrorDetails(e,t){this.errorName=e,this.errorMessage=t}},ri=i(31024),ni=i(605);class si extends ni.Z{constructor(e,t,i,o){super(),(0,a.Z)(this,"wasTyped",void 0),(0,a.Z)(this,"wasVerified",void 0),this.couponCode=e,this.wasTyped=t,this.wasVerified=i,this.isStackable=o}}var ci=si,li=i(44092);class ui extends bt{constructor(t,i,o){super(t),(0,a.Z)(this,"checkoutPageUrlData",void 0),(0,a.Z)(this,"checkoutPageData",void 0),(0,a.Z)(this,"rewardsData",void 0),(0,a.Z)(this,"contextID",void 0),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"entryPointService",void 0),(0,a.Z)(this,"autoApplyScenario",e.KE.AutoApplyCoupons),this.logService=i,this.entryPointService=o}async WaitForOrderElement(e,t,i){if(!this.checkoutPageUrlData.supportedNoOrderTotal)return await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,t,"Check Order Data Exists")),i)}async WaitForOrderElementInBackground(){return await m.ZP.WaitForCondition((async()=>await this.GetOrderTotal()>0),3e3)}async GetPageCurrency(){if(this.checkoutPageUrlData.orderTotalDataElementSelector){const e="Get Currency",t=this.checkoutPageUrlData.orderTotalDataElementSelector.split(",");for(let i=0;i<t.length;i++){const o=t[i];try{return await this.GetCurrencyValue(o,e)}catch(a){if(a?.name===Me.AutoApplyCancelled)throw a;if(i===t.length-1){const t={DomElement:o,EntryPoint:this.entryPointService?.GetEntryPoint(),FunctionName:e,Scenario:this.autoApplyScenario},i=new me.Z(this.checkoutPageData.retailerData.domainName,pe.x.GetBoxValue,t,a.stack);return this.logService.LogClientErrorV2(a.message,i),"$"}}}}else if(this.checkoutPageUrlData.supportedNoOrderTotal){const e=(0,li.Lt)("pageCurrency");if(e)return e}return"$"}async GetOrderTotal(){if(this.checkoutPageUrlData.orderTotalDataElementSelector){const e="Get order total",t=this.checkoutPageUrlData.orderTotalDataElementSelector.split(",");for(let i=0;i<t.length;i++){const o=t[i];try{return await this.GetBoxValue(o,e)}catch(a){if(a?.name===Me.AutoApplyCancelled)throw a;if(i===t.length-1){const t={DomElement:o,EntryPoint:this.entryPointService?.GetEntryPoint(),FunctionName:e,Scenario:this.autoApplyScenario},i=new me.Z(this.checkoutPageData.retailerData.domainName,pe.x.GetBoxValue,t,a.stack);throw this.logService.LogClientErrorV2(a.message,i),a}}}}else if(this.checkoutPageUrlData.supportedNoOrderTotal){const e=(0,li.Lt)("orderTotal");if(e)return JSON.parse(e)}return-1}async GetOrderSubTotal(){if(this.checkoutPageUrlData.orderSubTotalElementSelector){const e="Get order subtotal",t=this.checkoutPageUrlData.orderSubTotalElementSelector.split(",");for(const i of t)try{return await this.GetBoxValue(i,e)}catch(e){if(e?.name===Me.AutoApplyCancelled)throw e;return-1}}return-1}async GetAppliedCoupon(){const e="Get applied coupon",t=this.checkoutPageUrlData.inputBoxSelector,i=this.checkoutPageUrlData.appliedCouponSelector??t;if(m.ZP.IsValidDataField(i))try{let o=(await this.SendDomMessage(this.contextID,new lt(Ce.GetAppliedCoupon,i,""),e,!0)).TextValue;if(!o&&i===t){const e=Pe.Z.GetFirstVisibleElement(t);o=(e?.getAttribute("value")??"").replace(/[^a-z0-9]/gim,"")}if(o&&!this.IsUserCouponInOurCorpus(o))return new ci(o,!1,!1,!1)}catch(t){const o={DomElement:i,EntryPoint:this.entryPointService?.GetEntryPoint(),FunctionName:e,Scenario:this.autoApplyScenario},a=new me.Z(this.checkoutPageData.retailerData.domainName,pe.x.GetAppliedCoupon,o,t.stack);this.logService.LogClientErrorV2(t.message,a)}}GetAutoApplyTime(e){return e?.StartTime?Date.now()-e.StartTime:-1}IsUserCouponInOurCorpus(e){return void 0!==this.checkoutPageData.coupons.find((t=>!t.isLowSuccessRateCoupon&&t.couponCode.toLowerCase()===e.toLowerCase()))}async GetBoxValue(e,t){if(m.ZP.IsValidDataField(e))try{const i=await this.SendDomMessage(this.contextID,new lt(Ce.GetTextValue,e,""),t,!0);return(0,be.K)(i.TextValue)}catch(e){(0,r.TR)(e?.name??"",e?.message)}return-1}async GetCurrencyValue(e,t){if(m.ZP.IsValidDataField(e))try{const i=await this.SendDomMessage(this.contextID,new lt(Ce.GetTextValue,e,""),t,!0);return(0,be.cU)(i.TextValue)}catch(e){(0,r.TR)(e?.name??"",e?.message)}return"$"}}(0,a.Z)(ui,"AutoTriggered"," AutoTriggered: true");var di=ui,hi=i(12953),pi=i(4872),gi=i(54774);class Ci extends z.Z{constructor(t,i){super(e.Vm.SelectorExtractionMessage),(0,a.Z)(this,"Command",void 0),(0,a.Z)(this,"InputPath",void 0),this.Command=t,this.InputPath=i}}var Si=Ci,mi=class extends lt{constructor(e,t,i,o=!1){super(t,"",""),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"Command",void 0),(0,a.Z)(this,"checkoutPageUrlData",void 0),(0,a.Z)(this,"shouldObserveStatusSelector",void 0),this.ContextID=e,this.Command=t,this.checkoutPageUrlData=i,this.shouldObserveStatusSelector=o}},Ai=i(57176),fi=i(93608),vi=i(52056),Ei=i(54869),Pi=i(31656),Ii=i(91495),Ti=i(57459);class Oi extends di{constructor(e,t,i,o,r,n,s,c,l){super(n,o,l),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"stateService",void 0),(0,a.Z)(this,"localDataService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"applied",!1),(0,a.Z)(this,"removed",!1),(0,a.Z)(this,"signal",ge.FixedWaitTime),(0,a.Z)(this,"restartAA",!1),(0,a.Z)(this,"extractedInputBox",""),(0,a.Z)(this,"extractedApplyButton",""),(0,a.Z)(this,"extractedOrderTotalElement",""),(0,a.Z)(this,"isAutoTriggered",!1),(0,a.Z)(this,"shownApplyCopiedShortcircuitOverlay",!1),(0,a.Z)(this,"lastCartExtractionId",null),(0,a.Z)(this,"earlyReturnVariant",void 0),(0,a.Z)(this,"isForegroundAAScenario",!1),this.checkoutPageData=e,this.contextID=t,this.stateService=i,this.overlayService=r,this.localDataService=s,this.edgeMessageService=c}SetRetailerData(e){this.checkoutPageData=e}SetRewardsData(e){this.rewardsData=e}SetCouponApplyState(e,t,i){!this.applied&&t&&(this.signal=e,this.applied=t),!this.removed&&i&&(this.signal=e,this.removed=i)}async ApplyCoupons(t,i){let o=null;if(this.ResetUIState(),!this.InitializeCheckoutPageUrlData())return!1;this.isAutoTriggered=this.localDataService.IsFeatureEnabled(It.autoTriggeredAutoApply),this.isBgAAScenario=this.localDataService.GetLocalData(Ne.Q.BackgroundAutoApply),this.isForegroundAAScenario=this.localDataService.GetLocalData(Ne.Q.ForegroundAutoApply),this.isPDPBgAutoApply=this.localDataService.GetLocalData(Ne.Q.ProductPageBackgroundAutoApply),this.isBestCouponBgAutoApply=this.localDataService.GetLocalData(Ne.Q.BestCouponBackgroundAutoApply);const a=this.localDataService.GetLocalData(Ne.Q.FallBackAutoApply),r=this.localDataService.IsFeatureEnabled(It.useBackgroundAutoApplyResult),n=this.localDataService.IsFeatureEnabled(It.applyCopiedCoupon),s=this.localDataService.IsFeatureEnabled(It.productBestCoupon),c=this.localDataService.IsFeatureEnabled(It.exclusiveCoupon);if(this.localDataService.IsFeatureEnabled(It.aaEarlyReturn)&&(this.earlyReturnVariant=this.localDataService.GetLocalData(Ne.Q.AAEarlyReturnVariant)),this.isForegroundAAScenario||(this.edgeMessageService.SendAutoApplyStartMessage(),Pi.R.isExperimentActive(pi.H.fetchRewardOfferDuringAA)&&this.edgeMessageService.FetchRewardsUserInfoWithPromotions()),(this.isBgAAScenario||this.isPDPBgAutoApply)&&this.SetUpBackgroundScriptMessageHandler(),this.isPDPBgAutoApply?this.autoApplyScenario=e.KE.ProductPageBackgroundAutoApply:this.isBgAAScenario||this.isForegroundAAScenario?this.autoApplyScenario=e.KE.BackgroundAutoApply:this.isBestCouponBgAutoApply?this.autoApplyScenario=e.KE.ProductBestCoupon:this.autoApplyScenario=r?e.KE.BackgroundAAResult:n?e.KE.ApplyCopiedCoupon:s?e.KE.ProductBestCoupon:a?e.KE.FallBackAutoApply:c?e.KE.ExclusiveCoupon:e.KE.AutoApplyCoupons,t)r?(o=this.GetBackgroundAutoApplyResultState(),await this.ReValidateBackgroundAutoApplyState(o)||(o=this.CreateState(),this.autoApplyScenario=e.KE.AutoApplyCoupons)):o=this.CreateState();else if(i)this.Cancel(o,this.autoApplyScenario);else{if(await this.IsFakeRefreshEvent()&&!this.isForegroundAAScenario&&!a)return!1;if(o=await this.LoadState(),null===o)o=this.CreateState();else if(this.isBgAAScenario&&o.BackgroundAACancelled)return this.Cancel(o,this.autoApplyScenario),!1;this.RestoreExtractedSelectors(o)}if(null!==o){this.isBgAAScenario&&ho.GetBroadcastChannelService().PostMessage(JSON.stringify(new ai(h.AutoApplyStarted,o)));let t=!1;return await this.ApplyCouponsAsync(o,this.autoApplyScenario).catch((async i=>{if(i.name===Me.Refresh)t=!0;else if(i.name===Me.AutoApplyCancelled||i.name===Me.AutoApplyPaused||i.name===Me.AutoApplySkipped){if(t=!1,this.restartAA)return;this.Cancel(o,this.autoApplyScenario,i.name===Me.AutoApplyPaused,i.name===Me.AutoApplySkipped)}else if(i.name===Me.InvalidInput){t=!1;const o=new pt.Z(this.checkoutPageData.retailerData.domainName,this.entryPointService?.GetEntryPoint());o.SetErrorData(e.ps.Error,i.name),o.AutoApplyScenario=this.autoApplyScenario,this.LogAutoApplyError(o,i.message),await this.WalletDrawerSendAutoApplyFailMessage()}else{if(o){if(this.isPDPBgAutoApply)return void await this.FinalizePDPBackgroundAutoApply(o,i?.name+":"+i?.message,e.ps.Error);if(this.isBgAAScenario){const t=new ai(h.AutoApplyFinished,o);return t.result=e.ps.Error,t.SetErrorDetails(i.name,i.message),ho.GetBroadcastChannelService().PostMessage(JSON.stringify(t)),void this.edgeMessageService.SendAutoApplyErrorMessage(i?.name)}if(this.isForegroundAAScenario){const t=new ft(p.FinishAutoApply,e.ps.Error);t.SetErrorInfo(i?.name),ho.GetBroadcastChannelService().PostMessage(t),ho.GetBroadcastChannelService().Close()}else this.edgeMessageService.SendAutoApplyErrorMessage(i?.name);if(!o.HideProgressOverlay||!this.shownApplyCopiedShortcircuitOverlay){this.shownApplyCopiedShortcircuitOverlay||(this.shownApplyCopiedShortcircuitOverlay=o.HideProgressOverlay);const t=i.name===Me.AutoApplyShortcircuit&&!this.EntryPointIsWallet();await this.showOverlayIfHidden("",0,o),await this.overlayService.ShowResult(this.contextID,e.ps.Error,this.checkoutPageData.retailerData.domainName,i?.name+":"+i?.message,o,this.checkoutPageData.cashback,this.autoApplyScenario,this.checkoutPageData.coupons,this.GetExtractedSelectors(),t,this.isAutoTriggered,this.GetLastCartExtractionId(),this.checkoutPageData.market)}}await this.WalletDrawerSendAutoApplyFailMessage()}})).finally((async()=>{t?this.SaveState(o):this.restartAA?this.Restart(o):this.ClearState()})),!0}return!1}async ApplyCouponsAsync(t,i){i!==e.KE.ApplyCopiedCoupon&&i!==e.KE.ProductBestCoupon&&i!==e.KE.ExclusiveCoupon&&(Pi.R.isExperimentActive(pi.H.aaWaitForBlockedCoupons)?(await this.AddSuggestedCoupons(t),await this.BlockCartInapplicableCoupons(t)):(this.BlockCartInapplicableCoupons(t),await this.AddSuggestedCoupons(t))),this.checkoutPageData.HasCoupons()||this.LogAndThrowError("ApplyCouponsAsync",pe.x.AutoApplyWithoutCoupons,"Called ApplyCoupons without coupons");let o=t.CouponsApplied.size;if(t.CouponsApplied.size>0){const e=this.checkoutPageData.coupons[t.CouponsApplied.size-1].couponCode,i=t.CouponsApplied.get(e);(i&&!i.wasVerified||o===this.checkoutPageData.coupons.length)&&(o-=1)}t.Currency&&await this.overlayService.UpdateCurrency(this.contextID,t.Currency);const a=this.checkoutPageData.coupons[o].couponCode;if(this.checkoutPageData.retailerData.hasWhitePageError||t.HideProgressOverlay||await this.overlayService.OpenOverlay(this.contextID,a,this.checkoutPageData.coupons.length,t.MaxDiscount,this.checkoutPageUrlData,o),m.ZP.IsValidDataField(this.checkoutPageUrlData.layoutClickSelector)){let e=this.checkoutPageUrlData.clickBeforeStartSelector;e?.indexOf(",")>=0&&(e=this.checkoutPageUrlData.clickBeforeStartSelector.substring(0,e.indexOf(",")));const t=this.checkoutPageUrlData.inputBoxSelector;let i=!1;m.ZP.IsValidDataField(e)&&(i=await this.IsFieldVisible(this.contextID,e,"Click Before visible")),i||(i=await this.IsFieldVisible(this.contextID,t,"Input box visible"));let o=!1;try{await this.GetOrderTotal()||(o=!0)}catch(e){}if((!i||o)&&(await this.SendDomMessage(this.contextID,new lt(Ce.Click,this.checkoutPageUrlData.layoutClickSelector,"",J.LayoutClick),"First Click to see checkout fields.",!1),o))try{await m.ZP.WaitForCondition((async()=>{const e=await this.GetOrderTotal();return Boolean(e)}),8e3)}catch(e){}}if(await this.WaitForOrderElement(this.contextID,this.checkoutPageUrlData.orderTotalDataElementSelector,8e3),this.isPDPBgAutoApply&&await this.WaitForOrderElement(this.contextID,this.checkoutPageUrlData.orderTotalDataElementSelector,3e4),this.isBgAAScenario||this.isPDPBgAutoApply){const e=await this.WaitForOrderElementInBackground();if(this.isPDPBgAutoApply&&!e)throw new Error(Me.InvalidCartValue)}this.localDataService.IsFeatureEnabled(It.onlineSelectorExtraction)&&!1!==this.checkoutPageData?.retailerData?.selectorExtractionEnabled&&await this.ExtractOrderTotalElementIfNotVisible(t),t.TrueInitialPrice||t.InitialPrice||(t.AppliedCoupon=await this.GetAppliedCoupon(),t.AppliedCoupon&&(t.TrueInitialPrice=await this.GetOrderTotal(),this.SaveState(t))),!t.TrueInitialPrice&&m.ZP.IsValidDataField(this.checkoutPageUrlData.removeCouponButtonSelector)&&(t.TrueInitialPrice=await this.GetOrderTotal(),this.SaveState(t)),t.InitialPrice||(await this.RemoveCoupon(!0),t.MaxDiscount=0,t.InitialPrice=await this.GetOrderTotal(),t.PageCurrency=await this.GetPageCurrency(),t.Currency=(0,be.Cl)(t.PageCurrency,(0,r.uf)(this.checkoutPageData?.market,this.checkoutPageData?.retailerData?.exclusiveMarket)),this.UpdateCurrency(t));let n=0,s=!1;const c=this.checkoutPageData.coupons;let l=this.checkoutPageData.retailerData.bestCouponLogicEnabled&&t.SuggestedCoupons?.length>0&&-1!==t.SuggestedCoupons.findIndex((e=>e.couponCode===t.BestCoupon?.couponCode))&&t.MaxDiscount>0;for(let i=0;i<c.length;i++){const o=c[i],a=o.couponCode,r=o.title,u=o.isStackable??!1;if(this.checkoutPageUrlData.successfulAlertSelector&&t.BestCoupon?.couponCode)break;if(this.earlyReturnVariant&&i>=Oi.EarlyReturnThreshold&&(this.earlyReturnVariant===oi.qw.ReturnAlways||this.earlyReturnVariant===oi.qw.ReturnIfSavingsFound&&t.MaxDiscount>0))break;const d=this.localDataService.GetLocalData(Ne.Q.ExpressCheckoutState);if(this.EntryPointIsWallet()&&d===V.CancelEC)return this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplyCancelled),this.LogCancelledStatus(t,this.autoApplyScenario),!0;const h=i===c.length-1,p=this.isCouponInapplicable(t,o,l,h);if(p){this.SaveInapplicableCouponStatus(t,o,p);continue}let g;this.checkoutPageUrlData.refreshAfterApplying||await this.MoveProgressBar(i,t),t.CouponsApplied.get(a)?.wasTyped||(this.checkoutPageUrlData.refreshAfterApplying&&await this.MoveProgressBar(i,t),g=await this.ApplyCoupon(a,t,i+1,c.length,t.MaxDiscount,u,void 0,void 0,c[i].suggestedCouponType));const C=t.CouponsApplied.get(a);if(C&&!C.wasVerified){await this.WasCouponAccepted();const d=await this.GetDiscount(t.InitialPrice,t.UnremovedDiscountSum,o);if(this.checkoutPageUrlData?.supportedNoOrderTotal&&await this.CouponApplied(this.checkoutPageUrlData.removeCouponButtonSelector)){this.SaveCouponDiscountStatus(t,d,a,r,u,o.attribution,o.isPrivateCoupon,o.suggestedCouponType,o.providerId,void 0,void 0,void 0,g,e.HC.Valid),s=!0;break}const h=await this.GetCouponStatusMessages(this.checkoutPageUrlData.errorMessageSelector,this.checkoutPageUrlData.couponSuccessMessageSelectors,this.checkoutPageUrlData.couponFailureMessageSelectors);if(this.SaveCouponDiscountStatus(t,d,a,r,u,o.attribution,o.isPrivateCoupon,o.suggestedCouponType,o.providerId,h.StatusMessage,h.SuccessMessages,h.FailureMessages,g),await this.CloseErrorMessage(),l=this.checkoutPageData.retailerData.bestCouponLogicEnabled&&t.SuggestedCoupons?.length>0&&-1!==t.SuggestedCoupons.findIndex((e=>e.couponCode===t.BestCoupon?.couponCode))&&t.MaxDiscount>0,i!==c.length-1&&!this.checkoutPageUrlData.successfulAlertSelector&&!l||t.BestCoupon?.couponCode!==a||this.IsUserCouponBetter(t)||this.isBgAAScenario||this.isPDPBgAutoApply)if(!this.checkoutPageUrlData.couponRemovalNotNeeded||this.isPDPBgAutoApply&&i===ci.length-1){const e=await this.GetOrderTotal(),i=await this.RemoveCoupon(void 0,t);e===await this.GetOrderTotal()&&d>0&&(t.UnremovedDiscountSum+=d),this.SaveRemoveCouponResult(t,i)}else{const e={CompletedSignal:ge.RemovalNotNeeded,WaitTime:-1};this.SaveRemoveCouponResult(t,e)}else t.BestCoupon.wasTyped=!0,n=d,t.BestCoupon.wasVerified=!0,this.SaveCouponStatus(t,a,!0,!0,u,!0)}}await this.MoveProgressBar(c.length-1,t);let u=!1;if(this.ShouldReApplyUserCoupon(t)&&(n=await this.GetUserCouponDiscount(t,c.length)??n,u=!0),this.isBgAAScenario){const e=new ai(h.AutoApplyFinished,t);return ho.GetBroadcastChannelService().PostMessage(JSON.stringify(e)),!0}if(this.isPDPBgAutoApply)return await this.FinalizePDPBackgroundAutoApply(t,Oi.AutoApplyComplete),!0;if(await this.MoveProgressBar(c.length-1,t),!this.checkoutPageUrlData?.supportedNoOrderTotal){n=await this.applyBestCoupon(t,c,n);const e=await this.GetOrderTotal();if(e>t.InitialPrice||e>t.TrueInitialPrice){const i={CouponResults:t.CouponResults,EntryPoint:this.entryPointService?.GetEntryPoint(),ExtractedSelectors:this.GetExtractedSelectors(),FinalDiscount:n,FinalPrice:e,InitialPrice:t.InitialPrice,Scenario:this.autoApplyScenario,TrueInitialPrice:t.TrueInitialPrice,CartExtractionId:this.GetLastCartExtractionId()},o=new me.Z(this.checkoutPageData.retailerData.domainName,pe.x.BetterInitialPrice,i,void 0);this.logService.LogClientErrorV2("",o)}}let d=Oi.AutoApplyComplete,g=e.ps.Negative;if(n>0||s?(d=this.updateMessageWithBrowserOptions(d),g=e.ps.Positive,this.isForegroundAAScenario||this.edgeMessageService.SendAutoApplyPositiveMessage(t.BestCoupon?.couponCode,t.InitialPrice,t.MaxDiscount)):this.isForegroundAAScenario||this.edgeMessageService.SendAutoApplyNegativeMessage(),this.isForegroundAAScenario){const i=new ft(p.FinishAutoApply,g);g===e.ps.Positive&&i.SetPositiveResultInfo(t.BestCoupon?.couponCode,t.InitialPrice,t.MaxDiscount),ho.GetBroadcastChannelService().PostMessage(i)}if(this.EntryPointIsWallet()&&setTimeout((()=>{let i=null;g===e.ps.Positive&&(i={couponCode:t.BestCoupon?.couponCode,isStackable:t.BestCoupon?.isStackable}),this.localDataService.GetLocalData(Ne.Q.WalletDrawerShouldSkipCoupon)&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplySkipped,JSON.stringify({succeeded:!1})),this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplyDone,JSON.stringify({finalDiscount:n>0?n:0,bestCoupon:i}))}),1e3),(this.autoApplyScenario!==e.KE.ApplyCopiedCoupon||g!==e.ps.Negative&&!u)&&(this.autoApplyScenario!==e.KE.ProductBestCoupon&&this.autoApplyScenario!==e.KE.ExclusiveCoupon?(await this.showOverlayIfHidden(a,o,t),await this.overlayService.ShowResult(this.contextID,g,this.checkoutPageData.retailerData.domainName,d,t,this.checkoutPageData.cashback,i,this.checkoutPageData.coupons,this.GetExtractedSelectors(),void 0,this.isAutoTriggered,this.GetLastCartExtractionId(),this.checkoutPageData.market,this.rewardsData)):this.logSavings(t,g,i,d)),this.CreateAndSaveTransactionToEdgeLocalStore(t,i,g,n),this.isForegroundAAScenario&&ho.GetBroadcastChannelService().Close(),g===e.ps.Negative||n<=0){let e=Ii.Q.UnsuccessfulAutoApplyCount;e?e++:e=1;const t="UnsuccessfulAutoApplyCount";vi.Z.SendNumberStorageMessage(t,e)}g===e.ps.Negative&&this.ClearInputBoxValue(),this.edgeMessageService.SetStorageValue(ii.y$.autoApplyStorageKey,JSON.stringify({value:ii.M4.ActionDetected}));try{if(Ei.Z.GetSuggestedCouponService().IsSuggestedCouponsEnhancementExpEnabled()&&t?.CouponResults){const e=Ei.Z.GetSuggestedCouponService().GetUpdatedAllSuggestedCouponsHistory(t.CouponResults);this.edgeMessageService.SetStorageValue("SuggestedCoupons",JSON.stringify({value:e}))}}catch(e){}return(0,Ft.Xo)(ii.y$.autoApplyStorageKey,ii.M4.ActionDetected),!0}async UpdateCurrency(e){e.HideProgressOverlay||await this.overlayService.UpdateCurrency(this.contextID,e.Currency)}async ClearUIState(){await this.SaveUIState(new Pt)}async UpdateUIState(e,t){const i=await this.GetUIState(e);return!!i&&(i.Events|=t.Events,await this.SaveUIState(i),!0)}async GetUIState(e){return await this.stateService.GetUIState(e)}async CancelBackgroundAutoApply(){if(!this.bgAutoApplyCancelled){const e=await this.LoadState();e&&(e.BackgroundAACancelled=!0,this.bgAutoApplyCancelled=!0,this.SaveState(e))}}async ExtractOrderTotalElementIfNotVisible(e){if(!this.checkoutPageUrlData?.supportedNoOrderTotal&&!await this.IsFieldVisible(this.contextID,this.checkoutPageUrlData.orderTotalDataElementSelector,"Order total visible")){const t=await m.ZP.MeasureExecutionTime((async()=>{const e=await this.SendDomMessage(this.contextID,new Si(Ce.ExtractOrderTotal),"Extracting order total element selector",!0);this.extractedOrderTotalElement=e.Selector}),"Extracting order total element if invisible");this.LogSelectorExtractionPerf(t,"OrderTotalElementExtraction"),this.checkoutPageUrlData.orderTotalDataElementSelector=e.ExtractedOrderTotalElement=this.extractedOrderTotalElement}}CreateAndSaveTransactionToEdgeLocalStore(t,i,o,a){try{if(o===e.ps.Positive&&a>0){const o=new gi.Z({});o.EventInfoTime=(new Date).toISOString(),o.Domain=this.checkoutPageData?.retailerData?.domainName,o.BestCoupon=t.BestCoupon?.couponCode,o.Discount=a.toString(),t?.InitialPrice&&(o.StartingPrice=t.InitialPrice.toString()),o.AutoApplyScenario=i;const r=t.StartTime?Date.now()-t.StartTime:-1;r>0&&(o.AutoApplyProcessTime=r.toString()),ho.GetEdgeMessageService().SaveTransactionToEdgeLocalStore(e.Sl.AutoApplyTransactionsKey,JSON.stringify(o))}}catch(e){this.LogError("CreateAndSaveTransactionToEdgeLocalStore",pe.x.SavingsFoundTransactionFailure,e?.message)}}ShouldReApplyUserCoupon(t){if(t.AppliedCoupon&&t.TrueInitialPrice){if(this.IsUserCouponBetter(t))return!0;{let i="";try{i=btoa(t.AppliedCoupon.couponCode)}catch{}const o=t.InitialPrice-t.TrueInitialPrice,a={CouponResults:t.CouponResults,DiscountFromServerCoupons:t.MaxDiscount,DiscountFromUserCoupon:o,EntryPoint:this.entryPointService?.GetEntryPoint(),FinalDiscount:t.MaxDiscount,InitialPrice:t.InitialPrice,Scenario:this.autoApplyScenario,TrueInitialPrice:t.TrueInitialPrice},r="User had a coupon we didn't have",n=new hi.Z(i,this.checkoutPageData.retailerData.domainName,e.M_.CouponNotInOurCorpus,location.pathname,JSON.stringify(a));this.logService.LogClientEventV2(e.in.Information,e.R.CollectedCoupons,r,n,t?.ImpressionId)}}return!1}IsUserCouponBetter(e){if(e.AppliedCoupon&&e.TrueInitialPrice){const t=e.InitialPrice-e.TrueInitialPrice;if(e.MaxDiscount<=0&&t>=0||t>0&&t>e.MaxDiscount)return!0}return!1}async GetUserCouponDiscount(t,i){const o=await this.ApplyUserCoupon(t,i),a=t.MaxDiscount;let r="";try{r=t.AppliedCoupon?btoa(t.AppliedCoupon.couponCode):""}catch{}const n={CouponResults:t.CouponResults,DiscountFromServerCoupons:a,EntryPoint:this.entryPointService?.GetEntryPoint(),FinalDiscount:o,InitialPrice:t.InitialPrice,Scenario:this.autoApplyScenario,TrueInitialPrice:t.TrueInitialPrice};if(t.AppliedCoupon&&o&&o>0&&o>=a){t.MaxDiscount=o,t.BestCoupon=new ci(t.AppliedCoupon.couponCode,!0,!0,!1),this.SaveState(t);const i="User coupon had the best or similar discount",a=new hi.Z(r,this.checkoutPageData.retailerData.domainName,e.M_.BetterInitialPrice,location.pathname,JSON.stringify(n));return this.logService.LogClientEventV2(e.in.Information,e.R.CollectedCoupons,i,a,t?.ImpressionId),o}{const i="User coupon did not have a better discount",o=new hi.Z(r,this.checkoutPageData.retailerData.domainName,e.M_.UserCouponFailed,location.pathname,JSON.stringify(n));this.logService.LogClientEventV2(e.in.Information,e.R.CollectedCoupons,i,o,t?.ImpressionId),await this.CloseErrorMessage(),await this.RemoveCoupon()}}async ApplyUserCoupon(e,t){if(e.AppliedCoupon){let i;return e.AppliedCoupon.wasTyped||await this.ApplyCoupon(e.AppliedCoupon.couponCode,e,t,t,e.MaxDiscount,e.AppliedCoupon.isStackable,!1,!0),e.AppliedCoupon.wasVerified||(i=await this.GetDiscount(e.InitialPrice,e.UnremovedDiscountSum),this.SaveCouponStatus(e,e.AppliedCoupon.couponCode,!0,!0,e.AppliedCoupon.isStackable,!1,!0)),i}}async SaveUIState(e){this.stateService.SaveUIState(e)}async WaitForRefresh(e){return await m.ZP.WaitForCondition((async()=>window.overlayunloaded),e)}async LoadState(){return await this.stateService.LoadCouponApplicatorState()}ClearState(){this.SaveState(null)}CreateState(){const t=Tt.Z.CreateNew(this.contextID,this.checkoutPageData.impressionId);return t.ImportOptions=this.localDataService.GetLocalData(Ne.Q.ImportOptions),t.CashBackActive=this.localDataService.GetLocalData(Ne.Q.CashBackActive),t.HideProgressOverlay=this.autoApplyScenario===e.KE.ApplyCopiedCoupon||this.autoApplyScenario===e.KE.ProductBestCoupon||this.autoApplyScenario===e.KE.ExclusiveCoupon,this.isBgAAScenario&&(t.BackgroundAAStatus.BgAutoApplyInProgress=!0),this.stateService.SaveCouponApplicatorState(t),t}SaveState(e){(this.isBgAAScenario||this.isPDPBgAutoApply)&&this.bgAutoApplyCancelled&&!e?.BackgroundAACancelled||this.stateService.SaveCouponApplicatorState(e)}async AddSuggestedCoupons(e){try{e.SuggestedCoupons||(this.isPDPBgAutoApply&&await Ei.Z.GetSuggestedCouponService().Update(Ai.s3.CheckoutPage,this.checkoutPageData.coupons,this.checkoutPageUrlData?.suggestedCouponElementSelector,this.checkoutPageUrlData?.suggestedCouponRegex,this.checkoutPageData.impressionId,!0,this.checkoutPageData.suppressedCoupons),e.SuggestedCoupons=Ei.Z.GetSuggestedCouponService().GetSuggestedCoupons(),this.SaveState(e)),this.checkoutPageData.coupons=Ti.Z.AddSuggestedCoupons(this.checkoutPageData.coupons,e.SuggestedCoupons)}catch(e){this.LogError("AddSuggestedCoupons",pe.x.GetSuggestedCoupon,e?.message)}}async BlockCartInapplicableCoupons(e){try{if(!e.CartBlockedCoupons){const t=await Ei.Z.GetCartExtractionService().WaitForBlockedCouponsThenGetCartData();e.CartBlockedCoupons=t?.BlockedCouponsData?.BlockedCoupons??[],e.Metadata??={},e.Metadata.CartModelRunDebugInfo={BlockedCoupons:t?.BlockedCouponsData?.BlockedCoupons,OriginalCoupons:t?.BlockedCouponsData?.OriginalCoupons,OriginalCartExtractionId:t?.ExtractionId},this.SaveState(e)}this.checkoutPageData.coupons=Ti.Z.HandleCartModelBlockedCoupons(this.checkoutPageData.coupons,e.CartBlockedCoupons)}catch(e){this.LogError("BlockCartInapplicableCoupons",pe.x.CartBlockedCoupons,e?.message)}}RestoreExtractedSelectors(e){e&&(e.ExtractedInputBox&&(this.extractedInputBox=this.checkoutPageUrlData.inputBoxSelector=e.ExtractedInputBox),e.ExtractedApplyButton&&(this.extractedApplyButton=this.checkoutPageUrlData.applyButtonSelector=e.ExtractedApplyButton),e.ExtractedOrderTotalElement&&(this.checkoutPageUrlData.orderTotalDataElementSelector=e.ExtractedOrderTotalElement))}async CloseModalDialogOnRetailerPage(){const e=this.checkoutPageUrlData.closeModal;if(e&&await this.IsFieldVisible(this.contextID,e,"close modal visible")){const t=await this.CouponApplied(this.checkoutPageUrlData.removeCouponButtonSelector);await this.SendDomMessage(this.contextID,new lt(Ce.Click,e,""),"Close modal",!1),await this.WaitForCouponApply(t)}}async ApplyCoupon(e,t,i,o,a,n,s,c,l){this.EntryPointIsWallet()&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplyProgress,JSON.stringify({coupon:e,currentCouponIndex:i,totalCoupons:o,currentBestDiscount:a,isBestCoupon:s||c}));const u=l&&l===fi.d.NewSuggestedCoupon&&Ei.Z.GetSuggestedCouponService().IsSuggestedCouponsEnhancementExpEnabled();this.UpdateCurrentCoupon(e,i,o,a,t,u);const d=await this.CouponApplied(this.checkoutPageUrlData.removeCouponButtonSelector);if(this.checkoutPageUrlData.waitBeforeTypingNextCoupon&&await m.ZP.Sleep(this.checkoutPageUrlData.waitBeforeTypingNextCoupon),await this.TypeCoupon(e,t),this.SaveCouponStatus(t,e,!0,!1,n,s,c),this.checkoutPageData.retailerData.shortCircuitAAEnabled&&!await m.ZP.WaitForCondition((async()=>{const e=Pe.Z.GetFirstVisibleElement(this.checkoutPageUrlData.applyButtonSelector);return e&&!e?.disabled&&!e?.classList.contains("disabled")}),Oi.WaitTime))throw(0,r.TR)(Me.AutoApplyShortcircuit,"Auto Apply Short-Circuited");const h=this.checkoutPageUrlData.applyButtonSelector;await this.setupDOMMutationObserver(),this.applied=!1;const p=await this.ClickApplyButton(h);if(this.localDataService.IsFeatureEnabled(It.onlineSelectorExtraction)&&!1!==this.checkoutPageData?.retailerData?.selectorExtractionEnabled&&!this.extractedApplyButton&&!p){let e;await this.disconnectDOMMutationObserver();const i=await m.ZP.MeasureExecutionTime((async()=>{e=await this.SendDomMessage(this.contextID,new Si(Ce.ExtractApplyButton,""===this.extractedInputBox?this.checkoutPageUrlData.inputBoxSelector:this.extractedInputBox),"Extracting apply button selector",!0),this.extractedApplyButton=e.Selector}),"Extracting apply button");this.LogSelectorExtractionPerf(i,"ApplyButtonExtraction"),await this.setupDOMMutationObserver(),t.ExtractedApplyButton=this.extractedApplyButton}this.SaveCouponStatus(t,e,!0,!1,n,s,c);const g=await this.WaitForCouponApply(d);return await this.disconnectDOMMutationObserver(),await this.CloseModalDialogOnRetailerPage(),this.IsDomMutationEnabled()&&this.applied||this.checkoutPageUrlData.refreshAfterApplying&&await this.WaitForRefresh(4e3)&&(0,r.TR)(Me.Refresh),this.checkoutPageData.retailerData.hasWhitePageError||t.HideProgressOverlay||await this.showOverlayIfHidden(e,i,t),g}isCouponInapplicable(t,i,o,a){if(!(a&&t.CouponResults.filter((e=>e.ApplyWaitCompletedSignal!==ge.NotApplied)).length<=0)){if(o)return e.HC.SuggestedCouponSuccesfullyApplied;if((!i.suggestedCouponType||i.suggestedCouponType===fi.d.NotSuggestedCoupon)&&i.isLowSuccessRateCoupon)return e.HC.LowSuccess;if(i.isBlockedByCart)return e.HC.BlockedByCart;if(this.localDataService.IsFeatureEnabled(It.calculatedCutOffFiltering)&&t.InitialPrice&&i.calculatedCutoffPrice&&t.InitialPrice<i.calculatedCutoffPrice)return e.HC.CalculatedCutOffPriceNotMet;if(t.InitialPrice&&i.minimumPurchase&&t.InitialPrice<i.minimumPurchase)return e.HC.MinPurchaseNotMet;if(this.checkoutPageData.retailerData.couponsFilteringEnabled&&t.MaxDiscount){if(i.discountPercent&&i.discountPercent<=this.GetDiscountPercent(t.MaxDiscount,t.InitialPrice)+.25)return e.HC.WorseDiscountPercent;if(i.discountValue&&i.discountValue<=t.MaxDiscount)return e.HC.WorseDiscountValue}}}async WaitForCouponApply(e){let t=!1;const i=(new Date).getTime();let o=ge.FixedWaitTime;if(this.IsDomMutationEnabled()){t=await m.ZP.WaitForCondition((async()=>this.applied),this.checkoutPageUrlData.waitAfterApplyingCurrentCoupon);const e=this.checkoutPageUrlData.couponApplyMinWaitTime??3e3;t&&(await m.ZP.WaitForCondition((async()=>(new Date).getTime()-i>e),e),o=this.signal)}else!e&&m.ZP.IsValidDataField(this.checkoutPageUrlData.removeCouponButtonSelector)&&Oi.WaitTime>=this.checkoutPageUrlData.waitAfterApplyingCurrentCoupon&&!0!==this.checkoutPageUrlData.refreshAfterApplying?await m.ZP.WaitForCondition((async()=>await this.CouponApplied(this.checkoutPageUrlData.removeCouponButtonSelector)),Oi.WaitTime)&&(o=ge.RemoveButtonDetected):this.checkoutPageUrlData.waitAfterApplyingCurrentCoupon>0&&await m.ZP.Sleep(this.checkoutPageUrlData.waitAfterApplyingCurrentCoupon);return{CompletedSignal:o,WaitTime:(new Date).getTime()-i}}async GetDiscount(e,t,i){if(this.checkoutPageUrlData.orderTotalDataElementSelector){const i=await this.GetOrderTotal(),o=Pi.R.isExperimentActive(pi.H.couponValidityFix)?t:void 0;if(e>0&&i>0)return e-(o||0)-i}else if(this.checkoutPageUrlData?.supportedNoOrderTotal&&!await this.WasCouponRejected()&&await m.ZP.WaitForCondition((async()=>await this.CouponApplied(this.checkoutPageUrlData.removeCouponButtonSelector)),1e4)&&i&&e>0){if(i.discountValue)return i.discountValue;if(i.discountPercent)return e*i.discountPercent/100}return 0}GetDiscountPercent(e,t){return Math.round(e/t*100*100)/100}async RemoveCoupon(e,t){let i,o=this.checkoutPageUrlData.removeCouponButtonSelector,a="";const n=this.GetRemoveButtonActionLink(this.checkoutPageUrlData);if(2===n.length&&(a=n[0],o=n[1]),await this.IsFieldVisible(this.contextID,a,"Click before remove visible")&&(await this.IsFieldVisible(this.contextID,o,"Remove path visible")||await this.SendDomMessage(this.contextID,new lt(Ce.Click,a,""),"click before remove",!1)),await this.IsFieldVisible(this.contextID,o,"Remove coupon")){if(this.isPDPBgAutoApply&&e)throw new Error(Me.CouponAlreadyApplied);if(await this.setupDOMMutationObserver(),this.removed=!1,await this.SendDomMessage(this.contextID,new lt(Ce.Click,o,""),"Remove coupon",!1),i=await this.WaitForCouponRemoval(o),await this.disconnectDOMMutationObserver(),await this.CloseModalDialogOnRetailerPage(),this.IsDomMutationEnabled()&&this.removed||this.checkoutPageUrlData.refreshAfterRemoving&&await this.WaitForRefresh(4e3)&&(0,r.TR)(Me.Refresh),t){const e=t?.CouponsApplied.size-1??0,i=this.checkoutPageData?.coupons[e]?.couponCode??"";this.checkoutPageData.retailerData.hasWhitePageError||t.HideProgressOverlay||await this.showOverlayIfHidden(i,e,t)}}return i}async WaitForCouponRemoval(e){let t=!1;const i=(new Date).getTime();if(this.IsDomMutationEnabled()){t=await m.ZP.WaitForCondition((async()=>this.removed),this.checkoutPageUrlData.waitBeforeReApplyingNextCoupon);const e=this.checkoutPageUrlData.couponRemoveMinWaitTime??3e3;t&&await m.ZP.WaitForCondition((async()=>(new Date).getTime()-i>e),e)}else m.ZP.IsValidDataField(e)&&Oi.WaitTime>=this.checkoutPageUrlData.waitBeforeReApplyingNextCoupon&&!0!==this.checkoutPageUrlData.refreshAfterRemoving?(await m.ZP.WaitForCondition((async()=>!this.CouponApplied(e)),Oi.WaitTime),await this.CouponApplied(e)&&this.LogError("Failed to remove applied coupon",pe.x.RemoveCouponFailure,"Called RemoveCoupon on a checkout page")):this.checkoutPageUrlData.waitBeforeReApplyingNextCoupon>0&&await m.ZP.Sleep(this.checkoutPageUrlData.waitBeforeReApplyingNextCoupon);return{CompletedSignal:t?this.signal:ge.FixedWaitTime,WaitTime:(new Date).getTime()-i}}async CloseErrorMessage(){const e=this.checkoutPageUrlData.errorMessageCloseButtonSelector;m.ZP.IsValidDataField(e)&&(await this.SendDomMessage(this.contextID,new lt(Ce.Click,e,""),"Close error message",!1),await m.ZP.WaitForCondition((async()=>await!this.ErrorMessageButtonExists()),Oi.WaitTime))}async CouponApplied(e){return await this.IsFieldVisible(this.contextID,e,"Coupon applied")}async WasCouponAccepted(){return await this.IsFieldVisible(this.contextID,this.checkoutPageUrlData.couponAcceptedMessageElementSelector,"Was coupon accepted")}async WasCouponRejected(){return!!this.checkoutPageUrlData.errorMessageSelector&&await this.IsFieldVisible(this.contextID,this.checkoutPageUrlData.errorMessageSelector,"Was coupon rejected")}async ErrorMessageButtonExists(){return await this.IsFieldVisible(this.contextID,this.checkoutPageUrlData.errorMessageCloseButtonSelector,"Error message button exists")}async ClickBeforeStart(){const e=this.checkoutPageUrlData.clickBeforeStartSelector;m.ZP.IsValidDataField(e)&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(this.contextID,e,"Wait for button to become visible")),Oi.WaitTime),await this.SendDomMessage(this.contextID,new lt(Ce.Click,e,""),"Click before button",!0))}async GetCouponStatusMessages(e,t,i){const o={errorMessageSelector:e,couponSuccessMessageSelectors:t,couponFailureMessageSelectors:i};return await this.SendDomMessage(this.contextID,new lt(Ce.GetCouponStatusMessages,"","",void 0,void 0,o),"Coupon input box",!0)}async TypeCoupon(e,t){const i=""===this.extractedInputBox?this.checkoutPageUrlData.inputBoxSelector:this.extractedInputBox;await this.IsFieldVisible(this.contextID,i,"Type coupon")||await this.ClickBeforeStart(),await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(this.contextID,i,"Type coupon")),5e3);const o=await this.SetInputBoxValue(i,e);if(this.localDataService.IsFeatureEnabled(It.onlineSelectorExtraction)&&!1!==this.checkoutPageData?.retailerData?.selectorExtractionEnabled&&!o){const i=await m.ZP.MeasureExecutionTime((async()=>{const e=await this.SendDomMessage(this.contextID,new Si(Ce.ExtractInputBox),"Extracting input box selector",!0);this.extractedInputBox=e.Selector}),"Extracting input box");this.LogSelectorExtractionPerf(i,"InputBoxExtraction"),this.checkoutPageUrlData.inputBoxSelector=t.ExtractedInputBox=this.extractedInputBox,await this.SetInputBoxValue(this.extractedInputBox,e)}this.checkoutPageUrlData.waitAfterTypingCoupon&&await m.ZP.Sleep(this.checkoutPageUrlData.waitAfterTypingCoupon)}async SetInputBoxValue(e,t){return(await this.SendDomMessage(this.contextID,new lt(Ce.SetBoxValue,e,t.trim(),void 0,this.autoApplyScenario),"Coupon input box",!0)).SelectorSuccess}async ClearInputBoxValue(){const e=""===this.extractedInputBox?this.checkoutPageUrlData.inputBoxSelector:this.extractedInputBox;await this.IsFieldVisible(this.contextID,e,"Type coupon")&&await this.SetInputBoxValue(e,"")}async ClickApplyButton(e){return(await this.SendDomMessage(this.contextID,new lt(Ce.Click,e,"",J.Apply,this.autoApplyScenario),"Coupon apply",!0)).SelectorSuccess}LogSelectorExtractionPerf(t,i){this.logService.LogClientEventV2(e.in.Information,e.R.EdgeFlyoutStatus,t.toString(),new ht.Z(e.xu.PerfSelectorExtraction,void 0,void 0,this.checkoutPageData.retailerData.domainName,i))}GetRemoveButtonActionLink(e){return e.removeCouponButtonSelector?e.removeCouponButtonSelector.split(";"):[]}SaveCouponStatus(e,t,i,o,a,r,n){if(r&&e.BestCoupon)e.BestCoupon.wasTyped=i,e.BestCoupon.wasVerified=o,e.BestCoupon.isStackable=a;else if(n&&e.AppliedCoupon)e.AppliedCoupon.wasTyped=i,e.AppliedCoupon.wasVerified=o;else{const r=new ci(t,i,o,a);e.CouponsApplied.set(t,r)}this.UpdateCurrency(e),this.SaveState(e)}SaveCouponDiscountStatus(t,i,o,a,n,s,c,l,u,d,h,p,g,C){i>=0&&(!t.MaxDiscount||i>t.MaxDiscount)&&(t.MaxDiscount=i,t.BestCoupon=new ci(o,!1,!1,n),t.BestCoupon.discountValue=i);const S={Applicability:C??(i>0?e.HC.Valid:e.HC.NotApplicable),ApplyWaitCompletedSignal:g?.CompletedSignal||ge.Refresh,ApplyWaitTime:g?.WaitTime||-1,Attribution:s,Code:o,Title:a,Discount:Math.round(100*i)/100,DiscountPercent:this.GetDiscountPercent(i,t.InitialPrice),RemoveWaitCompletedSignal:void 0,RemoveWaitTime:void 0,StatusMessage:d,SuccessMessages:h,FailureMessages:p,IsPrivateCoupon:c,SuggestedCouponType:l??fi.d.NotSuggestedCoupon,ProviderId:u};t.CouponResults.push(S);const m=new ci(o,!0,!0,n);t.CouponsApplied.set(o,m),this.isPDPBgAutoApply&&(t.BackgroundAAStatus.result=e.ps.InProgress,t.BackgroundAAStatus.pageUrl=(0,r.Ek)(),t.BackgroundAAStatus.domainName=this.checkoutPageData.retailerData.domainName,this.UpdateBackgroundAAState(t)),this.UpdateCurrency(t),this.SaveState(t)}UpdateBackgroundAAState(e){this.edgeMessageService.SetStorageValue(ri.Z.GetBackgroundAAKeyName(),JSON.stringify({value:e?.ToString()}))}SaveRemoveCouponResult(e,t){const i=e.CouponResults[e.CouponResults.length-1];i.RemoveWaitCompletedSignal=t?.CompletedSignal||ge.NoRemoveButton,i.RemoveWaitTime=t?.WaitTime||-1,this.SaveState(e)}SaveInapplicableCouponStatus(e,t,i){if(!e.CouponsApplied.get(t.couponCode)?.wasVerified){const o={CompletedSignal:ge.NotApplied,WaitTime:-1};this.SaveCouponDiscountStatus(e,-1,t.couponCode,t.title,t.isStackable??!1,t.attribution,t.isPrivateCoupon,t.suggestedCouponType,t.providerId,void 0,void 0,void 0,o,i)}}LogCancelledStatus(t,i){const o=new pt.Z(this.checkoutPageData.retailerData.domainName,this.entryPointService?.GetEntryPoint()),a=this.GetAutoApplyTime(t);o.SetResultData(e.ps.Cancelled,a,void 0,t?.CouponResults??[],0,t?.InitialPrice??0,!1,i,this.GetExtractedSelectors(),this.GetLastCartExtractionId(),this.checkoutPageData.market,t?.Metadata),o.SetCurrencyInfo(t?.Currency??"",t?.PageCurrency??""),o.SetErrorData(e.ps.Cancelled,Me.AutoApplyCancelled);let r=Me.AutoApplyCancelled;if(this.isAutoTriggered&&(r+=Oi.AutoTriggered),this.isBgAAScenario){const i=new ai(h.AutoApplyFinished,t);i.result=e.ps.Cancelled,ho.GetBroadcastChannelService().PostMessage(JSON.stringify(i)),ho.GetBroadcastChannelService().Close()}else this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,r,o,this.checkoutPageData.impressionId);if(this.isForegroundAAScenario){const t=new ft(p.FinishAutoApply,e.ps.Cancelled);ho.GetBroadcastChannelService().PostMessage(t),ho.GetBroadcastChannelService().Close()}else this.edgeMessageService.SendAutoApplyCancelledMessage();this.ClearState()}LogAutoApplyError(t,i){if(!this.isBgAAScenario){let o=i;this.isAutoTriggered&&(o+=Oi.AutoTriggered),this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,o,t)}if(this.isForegroundAAScenario){const i=new ft(p.FinishAutoApply,e.ps.Error);i.SetErrorInfo(t.ErrorName??""),ho.GetBroadcastChannelService().PostMessage(i),ho.GetBroadcastChannelService().Close()}else if(this.edgeMessageService.SendAutoApplyErrorMessage(t.ErrorName),this.isBgAAScenario){const o=new ai(h.AutoApplyFinished,null);return o.result=e.ps.Error,o.SetErrorDetails(t.ErrorName??"",i),void ho.GetBroadcastChannelService().PostMessage(JSON.stringify(o))}}GetExtractedSelectors(){return{ApplyButton:""!==this.extractedApplyButton?this.extractedApplyButton:void 0,InputBox:""!==this.extractedInputBox?this.extractedInputBox:void 0,OrderTotalElement:""!==this.extractedOrderTotalElement?this.extractedOrderTotalElement:void 0}}GetLastCartExtractionId(){return null===this.lastCartExtractionId&&(this.lastCartExtractionId=Ei.Z.GetCartExtractionService().GetLastCartExtractionId()),this.lastCartExtractionId}async MoveProgressBar(e,t){if(!t.HideProgressOverlay){if(this.isBgAAScenario&&t&&this.checkoutPageData.coupons.length>0){const i=this.overlayService.GetPositions(e,this.checkoutPageData.coupons.length);t.BackgroundAAStatus.progressBarStartPos=i[0],t.BackgroundAAStatus.progressBarEndPos=i[1];const o=new ai(h.ProgressBarUpdate,t);ho.GetBroadcastChannelService().PostMessage(JSON.stringify(o))}await this.overlayService.MoveProgressBar(this.contextID,e,this.checkoutPageData.coupons.length)}}async UpdateCurrentCoupon(e,t,i,o,a,r){if(this.isBgAAScenario&&a){a.BackgroundAAStatus.currentCoupon=e,a.BackgroundAAStatus.currentCouponIndex=t,a.BackgroundAAStatus.couponsTotal=i;const o=new ai(h.CouponUpdate,a);ho.GetBroadcastChannelService().PostMessage(JSON.stringify(o))}a.HideProgressOverlay||await this.overlayService.UpdateCurrentCoupon(this.contextID,e,t,i,o,r)}ResetUIState(){this.SaveUIState(Pt.CreateNew((0,r.S8)()))}LogAndThrowError(e,t,i){throw this.LogError(e,t,i),new Error(i)}EntryPointIsWallet(){return this.entryPointService?.GetEntryPoint()===e.N9.Wallet}LogError(e,t,i){const o={EntryPoint:this.entryPointService?.GetEntryPoint(),FunctionName:e,Scenario:this.autoApplyScenario},a=new me.Z(this.checkoutPageData.retailerData.domainName,t,o,void 0);this.logService.LogClientErrorV2(i??"",a)}async setupDOMMutationObserver(){this.IsDomMutationEnabled()&&await this.SendDomMessage(this.contextID,new mi(this.contextID,Ce.setUpMutationObserver,this.checkoutPageUrlData,this.IsDomMutationEnabled()),"set dom mutation observer",!0)}IsDomMutationEnabled(){return this.checkoutPageUrlData.domMutationEnabled||!Pi.R.isExperimentActive(pi.H.domMutationReverseFlight)&&!this.checkoutPageUrlData.refreshAfterApplying&&!this.checkoutPageUrlData.refreshAfterRemoving}async disconnectDOMMutationObserver(){this.IsDomMutationEnabled()&&await this.SendDomMessage(this.contextID,new lt(Ce.DisconnectDOMMutationObserver,"",""),"disconnect mutation observer",!0)}async IsFakeRefreshEvent(){return!0!==this.checkoutPageUrlData.refreshAfterApplying&&!0!==this.checkoutPageUrlData.refreshAfterRemoving&&await this.overlayService.OverlayVisible(this.contextID)}InitializeCheckoutPageUrlData(){const e=this.checkoutPageData.retailerData.GetCurrentCheckoutPage();return e?(this.checkoutPageUrlData=e,!0):(this.LogError("ApplyCouponsAsync",pe.x.AutoApplyWithoutCheckout,"Called ApplyCoupons when not on a checkout page"),!1)}SetUpBackgroundScriptMessageHandler(){ho.GetBroadcastChannelService().GetBgAutoApplyChannel(),ho.GetBroadcastChannelService().setOnMessageEventHandler((async t=>{const i=t.data;i.messageType===p.FinishAutoApply&&(i.result===e.ps.Positive?this.edgeMessageService.SendAutoApplyPositiveMessage(i.bestCoupon,i.initialPrice,i.maxDiscount):i.result===e.ps.Negative?this.edgeMessageService.SendAutoApplyNegativeMessage():i.result===e.ps.Cancelled?this.edgeMessageService.SendAutoApplyCancelledMessage():this.edgeMessageService.SendAutoApplyErrorMessage(i.errorName),ho.GetBroadcastChannelService().Close()),i.messageType===p.CancelAutoApply&&this.CancelBackgroundAutoApply(),i.messageType===p.RestartAutoApply&&(this.restartAA=!0,this.CancelBackgroundAutoApply())}))}async FinalizePDPBackgroundAutoApply(t,i,o){let a=o;a||(a=t.MaxDiscount>0?e.ps.Positive:e.ps.Negative);const n=ho.GetBackgroundAutoApplyService().GetTelemetryDataFromState(t,a,e.KE.ProductPageBackgroundAutoApply);n.ExtractedSelectors=this.GetExtractedSelectors(),n.CartExtractionId=this.GetLastCartExtractionId(),this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,i,n,t?.ImpressionId),t.BackgroundAAStatus.result=a,t.BackgroundAAStatus.pageUrl=(0,r.Ek)(),t.BackgroundAAStatus.domainName=this.checkoutPageData.retailerData.domainName,this.UpdateBackgroundAAState(t),await this.CheckIfCartValueIncreased(t,a),o===e.ps.Positive?this.edgeMessageService.SendAutoApplyPositiveMessage(t.BestCoupon?.couponCode,t.InitialPrice,t.MaxDiscount):o===e.ps.Negative?this.edgeMessageService.SendAutoApplyNegativeMessage():o===e.ps.Error?this.edgeMessageService.SendAutoApplyErrorMessage():this.edgeMessageService.SendAutoApplyCancelledMessage()}async applyBestCoupon(e,t,i){return e&&e.BestCoupon&&(this.isForegroundAAScenario&&await this.RemoveCoupon(),e.BestCoupon.wasTyped||await this.ApplyCoupon(e.BestCoupon.couponCode,e,t.length,t.length,e.MaxDiscount,e.BestCoupon.isStackable,!0),e.BestCoupon.wasVerified||(0===(i=await this.GetDiscount(e.InitialPrice,0,e.BestCoupon))&&e.MaxDiscount>0&&await m.ZP.WaitForCondition((async()=>(i=await this.GetDiscount(e.InitialPrice,0))>0),Oi.WaitTime),this.SaveCouponStatus(e,e.BestCoupon.couponCode,!0,!0,e.BestCoupon.isStackable,!0))),i}async CheckIfCartValueIncreased(t,i){try{const o=await this.GetOrderTotal();if(o>t.InitialPrice){const a={BackgroundAutoApplyResult:i,CouponResults:t.CouponResults,EntryPoint:this.entryPointService?.GetEntryPoint(),FinalPrice:o,InitialPrice:t.InitialPrice,Scenario:e.KE.ProductPageBackgroundAutoApply},r=new me.Z(this.checkoutPageData.retailerData.domainName,pe.x.BetterInitialPrice,a,void 0);this.logService.LogClientErrorV2("",r)}}catch(e){}}async Cancel(t,i,o=!1,a=!1){this.isPDPBgAutoApply&&(t&&(t.BackgroundAAStatus.result=e.ps.Cancelled,t.BackgroundAAStatus.pageUrl=(0,r.Ek)(),t.BackgroundAAStatus.domainName=this.checkoutPageData.retailerData.domainName),this.UpdateBackgroundAAState(t));let n=0;if((i===e.KE.AutoApplyCoupons||i===e.KE.FallBackAutoApply)&&t&&t.MaxDiscount>0){const a=this.checkoutPageData.coupons;if(n=await this.applyBestCoupon(t,a,0),o){let o=Oi.AutoApplyComplete,a=e.ps.Negative;n>0?(a=e.ps.Positive,o=this.updateMessageWithBrowserOptions(o),this.isForegroundAAScenario||this.edgeMessageService.SendAutoApplyPositiveMessage(t.BestCoupon?.couponCode,t.InitialPrice,t.MaxDiscount)):this.isForegroundAAScenario||this.edgeMessageService.SendAutoApplyNegativeMessage(),o+=" - User Clicked Pause",await this.overlayService.ShowResult(this.contextID,a,this.checkoutPageData.retailerData.domainName,o,t,this.checkoutPageData.cashback,i,this.checkoutPageData.coupons,this.GetExtractedSelectors(),void 0,this.isAutoTriggered,this.GetLastCartExtractionId(),this.checkoutPageData.market)}}if(!0===o||a||(this.overlayService.CloseOverlay(this.contextID),this.LogCancelledStatus(t,i)),a&&this.EntryPointIsWallet()){if(this.LogCancelledStatus(t,i),await this.CloseModalDialogOnRetailerPage(),await m.ZP.Sleep(3e3),n>0){const e={couponCode:t?.BestCoupon?.couponCode,isStackable:t?.BestCoupon?.isStackable};this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplySkipped,JSON.stringify({succeeded:!1})),this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplyDone,JSON.stringify({finalDiscount:n,bestCoupon:e}))}else this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplySkipped,JSON.stringify({succeeded:!0}));this.localDataService.SaveLocalData(Ne.Q.WalletDrawerShouldSkipCoupon,!1)}}async Restart(t){this.restartAA=!1,this.bgAutoApplyCancelled=!1,this.ClearState();const i=new pt.Z(this.checkoutPageData.retailerData.domainName,this.entryPointService?.GetEntryPoint());i.AutoApplyScenario=e.KE.ProductPageBackgroundAutoApply,i.AutoApplyProcessTime=this.GetAutoApplyTime(t),i.ExtractedSelectors=this.GetExtractedSelectors(),i.CartExtractionId=this.GetLastCartExtractionId(),i.Market=this.checkoutPageData.market,this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,"Auto Apply Restarted",i),await this.RemoveCoupon(),location.reload()}GetBackgroundAutoApplyResultState(){try{const e=ho.GetLocalDataService().GetLocalData(Ne.Q.BackgroundAutoApplyState);if(e)return Tt.Z.CreateFromObject(JSON.parse(e))}catch(e){this.LogError("GetBackgroundAAState",pe.x.ErrorParsingBackgroundAutoApplyState,e?.message)}return null}async ReValidateBackgroundAutoApplyState(e){if(!e)return!1;const t=await this.GetOrderTotal(),i=await this.GetOrderSubTotal();if(!ri.Z.ValidateBgAAState(e,t,i)){ri.Z.CanCurrentPageDeleteBgaaState(e.BackgroundAAStatus.pageUrl)?this.edgeMessageService.DeleteStorageValue(ri.Z.GetBackgroundAAKeyName()):(e.BackgroundAAStatus.expiredState=!0,this.UpdateBackgroundAAState(e));let t="Called edge driver with expired bgaa state.";try{window.ResetBackgroundAAValidationMessage()}catch(e){t+=" Unable to clear validation"}return this.LogError("ValidateBackgroundAAState",pe.x.ExpiredBackgroundAAState,t),!1}return e.StartTime=Date.now(),this.SaveState(e),await this.RemoveCoupon(!0),!0}async showOverlayIfHidden(e,t,i){!1!==await this.overlayService.OverlayVisible(this.contextID)||this.EntryPointIsWallet()||await this.overlayService.OpenOverlay(this.contextID,e,this.checkoutPageData.coupons.length,i.MaxDiscount,this.checkoutPageUrlData,t)}logSavings(t,i,o,a){const r=t.StartTime?Date.now()-t.StartTime:-1,n=new pt.Z(this.checkoutPageData.retailerData.domainName,this.entryPointService?.GetEntryPoint());n.SetResultData(i,r,t.BestCoupon?.couponCode,t.CouponResults??[],t.MaxDiscount??0,t.InitialPrice??0,t.BestCoupon?.isStackable??!1,o,this.GetExtractedSelectors(),this.GetLastCartExtractionId(),this.checkoutPageData.market,t?.Metadata),n.SetCurrencyInfo(t.Currency??"",t.PageCurrency??""),this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,a,n)}updateMessageWithBrowserOptions(e){const t=this.localDataService.GetLocalData(Ne.Q.ImportOptions);return t&&t.shouldShowImportCheckBox&&t.primaryBrowserName?"Finished Auto apply with import Browser options":e}async WalletDrawerSendAutoApplyFailMessage(){this.EntryPointIsWallet()&&(this.localDataService.GetLocalData(Ne.Q.WalletDrawerShouldSkipCoupon)&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AutoApplySkipped,JSON.stringify({succeeded:!0})),this.edgeMessageService.SendEdgeDriverStateChangeMessage(Me.AutoApplyFail))}}(0,a.Z)(Oi,"WaitTime",2e3),(0,a.Z)(Oi,"AutoApplyComplete","Finished auto applying coupons."),(0,a.Z)(Oi,"EarlyReturnThreshold",10);var yi=Oi;class Di extends ti{static GetInstance(){return this.Instance||(this.Instance=new Di(ho.GetApplicatorStateService(),ho.GetLogService(),ho.GetOverlayService(),ho.GetPlatformInstance(),ho.GetLocalDataService(),ho.GetEdgeMessageService(),ho.GetEntryPointService())),this.Instance}constructor(e,t,i,o,r,n,s){super(),(0,a.Z)(this,"couponApplicatorMap",void 0),(0,a.Z)(this,"stateService",void 0),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"platformInstance",void 0),(0,a.Z)(this,"localDataService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"entryPointService",void 0),this.couponApplicatorMap=new Map,this.stateService=e,this.logService=t,this.overlayService=i,this.platformInstance=o,this.localDataService=r,this.edgeMessageService=n,this.entryPointService=s}ApplyCoupons(e,t,i,o,a){this.GetApplicator(e,t).ApplyCoupons(i,o).then((e=>{a&&a(e)})).catch((()=>{a&&a(!1)}))}async UpdateUIState(e,t,i,o){const a=this.GetApplicator(e,o);return await a.UpdateUIState(t,i)}UpdateRewardsData(e,t){return this.GetApplicator(e).SetRewardsData(t)}async ClearAllStates(){for(const e of this.couponApplicatorMap.keys()){const t=this.couponApplicatorMap.get(e);await(t?.ClearUIState())}}async GetUIState(e,t,i){const o=this.GetApplicator(e,i);return await o.GetUIState(t)}SetCouponApplyState(e,t,i,o){this.GetApplicator(e).SetCouponApplyState(t,i,o)}GetApplicator(e,t){let i=this.couponApplicatorMap.get(e);if(i)t&&i.SetRetailerData(t);else{if(!t)throw Error("CheckoutPageData must be there.");i=new yi(t,e,this.stateService,this.logService,this.overlayService,this.platformInstance,this.localDataService,this.edgeMessageService,this.entryPointService),this.couponApplicatorMap.set(e,i)}return i}}(0,a.Z)(Di,"Instance",void 0);var bi=Di;class Ni{static GetInstance(){return this.Instance||(this.Instance=bi.GetInstance()),this.Instance}}(0,a.Z)(Ni,"Instance",void 0);var Ri=Ni,_i=class{constructor(e){(0,a.Z)(this,"logService",void 0),this.logService=e}async HandleMessage(t){const i=t,o=new ie;if(!i)return o;const a=i.Type;if(a===e.Vm.TelemetryMessage){const e=i;this.logService.LogClientEventV2(e.LogLevel,e.EventType,e.Message,e.Data)}else if(a===e.Vm.ClosedPopupMessage||a===e.Vm.AutoApplyCompletedMessage||a===e.Vm.AutoApplyCancelledMessage){const t=i,o=t.Hostname,r=await Ri.GetInstance().GetUIState(t.ContextID,o);let n=!1;r&&(a===e.Vm.ClosedPopupMessage?(r.SetState(vt.PopupClosed,!0),n=!0):a===e.Vm.AutoApplyCompletedMessage?(r.SetState(vt.AutoApplyCompleted,!0),r.SetState(vt.CartChanged,!1),n=!0):a===e.Vm.AutoApplyCancelledMessage&&(r.SetState(vt.AutoApplyCancelled,!0),n=!0)),n&&await Ri.GetInstance().UpdateUIState(t.ContextID,o,r)}else if(a===e.Vm.DOMMutationMessage){const e=i;await Ri.GetInstance().SetCouponApplyState(e.ContextID,e.couponResultSignal,e.isApplyReady,e.isRemoveReady)}return o}},ki=i(64865),wi=i(79308);class xi extends z.Z{constructor(t){super(e.Vm.CheckoutProgressMessage),(0,a.Z)(this,"Status",void 0),this.Status=t}}var Ui=xi;class Mi extends z.Z{constructor(){super(e.Vm.CloseOverlayMessage)}}var Li=Mi;class Bi extends z.Z{constructor(t,i,o,r,n,s,c,l){super(e.Vm.CreateOverlayMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"CurrentCoupon",void 0),(0,a.Z)(this,"CurrentCouponIndex",void 0),(0,a.Z)(this,"TotalCoupons",void 0),(0,a.Z)(this,"ProgBarStart",void 0),(0,a.Z)(this,"ProgBarEnd",void 0),(0,a.Z)(this,"InnerHTML",void 0),(0,a.Z)(this,"CurrentBestDiscount",void 0),this.ContextID=t,this.CurrentCoupon=i,this.ProgBarStart=n,this.ProgBarEnd=s,this.InnerHTML=l,this.CurrentCouponIndex=o,this.TotalCoupons=r,this.CurrentBestDiscount=c}}var Fi=Bi;class Zi extends z.Z{constructor(t,i,o,r,n){super(e.Vm.ECCreateOverlayMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"InlineCSS",void 0),(0,a.Z)(this,"InlineHtml",void 0),(0,a.Z)(this,"checkoutProgress",void 0),(0,a.Z)(this,"IsAutoApplyIncluded",void 0),this.ContextID=t,this.InlineCSS=i,this.InlineHtml=o,this.checkoutProgress=n,this.IsAutoApplyIncluded=r}}var Gi=Zi;class Hi extends z.Z{constructor(t,i,o){super(e.Vm.ECCreateUpdatePaymentOverlayMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"InlineCSS",void 0),(0,a.Z)(this,"InlineHtml",void 0),this.ContextID=t,this.InlineCSS=i,this.InlineHtml=o}}var Vi=Hi;class Wi extends z.Z{constructor(t,i,o,r,n,s){super(e.Vm.ECShowResultMessage),(0,a.Z)(this,"IsECSuccess",void 0),(0,a.Z)(this,"IsAutoApplyIncluded",void 0),(0,a.Z)(this,"CheckoutProgress",void 0),(0,a.Z)(this,"InitialPrice",void 0),(0,a.Z)(this,"BestCoupon",void 0),(0,a.Z)(this,"MaxDiscount",void 0),this.IsECSuccess=t,this.IsAutoApplyIncluded=i,this.CheckoutProgress=s,this.InitialPrice=r,this.BestCoupon=o,this.MaxDiscount=n}}var Ki=Wi,zi=class extends Fi{constructor(t,i,o,r,n,s,c,l,u,d,h){super(t,i,o,r,n,s,l,c),(0,a.Z)(this,"inlineCSS",void 0),(0,a.Z)(this,"retailerData",void 0),(0,a.Z)(this,"bgAAScenario",void 0),this.inlineCSS=u,this.retailerData=d,this.bgAAScenario=h,this.Type=e.Vm.EdgeCreateOverlayMessage}};class Qi extends z.Z{constructor(t,i,o,r,n){super(e.Vm.ShowResultMessage),(0,a.Z)(this,"Result",void 0),(0,a.Z)(this,"Discount",void 0),(0,a.Z)(this,"OriginalPrice",void 0),(0,a.Z)(this,"BestCoupon",void 0),(0,a.Z)(this,"IsStackable",void 0),this.Result=t,this.Discount=i,this.OriginalPrice=o,this.BestCoupon=r,this.IsStackable=n}}var ji=Qi,Yi=class extends ji{constructor(t,i,o,r,n,s,c,l,u){super(t,i,o,r,s),(0,a.Z)(this,"cashBackInfo",void 0),(0,a.Z)(this,"coupons",void 0),(0,a.Z)(this,"isShortcircuit",void 0),(0,a.Z)(this,"rewardsData",void 0),this.Type=e.Vm.EdgeShowResultMessage,this.cashBackInfo=n,this.coupons=c,this.isShortcircuit=l,this.rewardsData=u}};class Ji extends z.Z{constructor(t,i){super(e.Vm.InstantAddToCartMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"GroceryAddToCartData",void 0),this.ContextID=t,this.GroceryAddToCartData=i}}var Xi=Ji;class qi extends z.Z{constructor(t,i){super(e.Vm.PrintableGroceryCouponsMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"IFrameSrc",void 0),this.ContextID=t,this.IFrameSrc=i}}var $i=qi;class eo extends z.Z{constructor(t,i){super(e.Vm.SuccessInstantAddToCartMessage),(0,a.Z)(this,"ContextID",void 0),(0,a.Z)(this,"GroceryAddToCartData",void 0),this.ContextID=t,this.GroceryAddToCartData=i}}var to=eo;class io extends z.Z{constructor(t){super(e.Vm.UpdateCurrencyMessage),(0,a.Z)(this,"Currency",void 0),this.Currency=t}}var oo=io;class ao extends z.Z{constructor(t){super(e.Vm.WalletDrawerCloseMessage),(0,a.Z)(this,"IsStopProgress",void 0),this.IsStopProgress=t}}var ro=ao;class no extends z.Z{constructor(t){super(e.Vm.WalletDrawerCreateOverlayMessage),(0,a.Z)(this,"ContextID",void 0),this.ContextID=t}}var so=no;class co extends z.Z{constructor(){super(e.Vm.WalletDrawerSkipCouponMessage)}}var lo=co;class uo extends Ue{static GetBackgroundMessagingService(){return this.backgroundMessagingService}static GetApplicatorStateService(){return this.applicatorStateService}static GetLogService(){return this.logService}static GetOverlayService(){return this.overlayService}static GetCheckoutService(){return this.checkoutService}static GetCheckoutPaymentUpdateService(){return this.checkoutPaymentUpdateService}static GetEdgeMessageService(){return this.edgeMessageService}static GetOtherSellersService(){return this.otherSellersService}static GetBackgroundAutoApplyService(){return this.backgroundAutoApplyService}static GetBroadcastChannelService(){return this.broadcastChannelService}static GetClippingService(){return this.clippingService}static GetWalletDrawerService(){return this.walletDrawerService}static GetEntryPointService(){return this.entryPointService}static GetInstantAddToCartService(){return this.instantAddToCartService}static GetICDriverService(){return this.icDriverService}static GetUXDataService(){return this.uxDataService}static GetClippingServiceLogger(){return this.clippingServiceLogger}}(0,a.Z)(uo,"entryPointService",new class{constructor(e){(0,a.Z)(this,"localDataService",void 0),this.localDataService=e}GetEntryPoint(){return this.localDataService.GetLocalData(Ne.Q.UseWalletDrawer)?e.N9.Wallet:e.N9.Shopping}}(uo.GetLocalDataService())),(0,a.Z)(uo,"edgeMessageService",new Le),(0,a.Z)(uo,"uxDataService",new class extends Qt{constructor(e){super(e),(0,a.Z)(this,"overlayUX",void 0),(0,a.Z)(this,"overlayCSS",void 0),(0,a.Z)(this,"imageEndPoint","https://www.bing.com/api/shopping/v1/ux/images/"),(0,a.Z)(this,"isMobile",void 0),this.isMobile=this.IsPlatformMobile("Android")||this.IsPlatformMobile("iPhone")}async GetUX(t){return t===e.k2.Overlay?(this.overlayUX=this.GetOverlayHtml(),this.overlayCSS=this.GetOverlayCSS()+this.GetBNPLTotalAmountStyles(),this.isMobile&&(this.overlayCSS+=this.GetEdgeMobileStyles()),this.overlayUX):t===e.k2.ECOverlay?this.GetECOverlayHtml():super.GetUX(t)}GetUXStyles(t){return t===e.k2.Overlay?this.overlayCSS:t===e.k2.ECOverlay?this.GetECOvelayCSS()+this.GetBNPLTotalAmountStyles()+this.GetOverlayCSS():void 0}IsPlatformMobile(e){return!!e&&-1!==navigator.userAgent.indexOf(e)}GetEdgeMobileStyles(){return"\n        .resultWrapper{\n            height: fit-content;\n        }\n        .divOverlayContentWrapper{\n            max-width: 700px;\n            min-width: unset;\n            height: min-content;\n            margin: 20px;\n            top: 0px;\n            left: 0px;\n            align-self: center;\n            flex-direction: column;\n            justify-content: space-between;\n            position: relative;\n            border-radius: 4px;\n            background: linear-gradient(0deg, #FFFFFF, #FFFFFF);\n            overflow: hidden;\n            z-index: 21;\n        }\n        .mainModals{\n            width: 100%;\n        }\n        .textContent{\n            margin: 10px 20px !important;\n        }\n        .txtCashbackUpsellPrivacy{\n            position: initial;\n            margin: 20px;\n        }\n        .imgCBTag{\n            height: 30px;\n        }\n        #btnSolidColorNeg{\n            position: initial;\n            width: 100%;\n        }\n        .txtCashbackUpsellTitle, .txtCashbackUpsellStoreName, .txtCashbackUpsellOffer{\n            position: initial;\n            width: initial;\n            height: initial;\n        }\n        @media (orientation: portrait){\n            .divOverlayFooter{\n                gap: 12px;\n                padding: 12px;\n                flex-direction: column-reverse;\n                height: fit-content;\n            }\n            #txtProgressTitle, #txtPositiveHeader, #txtResultNegativeTitle,\n            #txtResultShortcircuitTitle, #txtResultErrorTitle, #txtResultNegativeDetails{\n                text-align: center;\n            }\n            .divOverlayFooter > div{\n                margin: unset !important;\n            }\n            #btnOverlayCancel, #btnOverlayRebates, .imgOverlayExtensionIcon{\n                margin: unset;\n            }\n        }\n        @media (orientation: landscape){\n            .mainModals{\n                height: 0;\n                flex-grow: 1;\n                overflow-y: scroll;\n            }\n            .divOverlayContentWrapper{\n                height: 95%;\n            }\n        }"}GetBNPLTotalAmountStyles(){return"\n        #bnplContinueButton {\n            width: auto;\n            min-width: 180px;\n            height: 40px;\n            display: block;\n            align-self: center;\n            padding: 5px;\n            align-items: center;\n            color: #FFFFFF;\n            outline:none;\n            box-sizing: border-box;\n            fill: inherit;\n            background: linear-gradient(90.05deg, #8300D4 0.59%, #0048D4 67.54%, #00D4A1 104.11%);\n            border-radius: 8px;\n            border:none;\n            border-color: transparent;\n            text-align: center;\n            cursor: pointer;\n            z-index: 25;\n            font-weight: 600;\n        }\n        #bnplContinueButton:hover {\n            outline: 2px solid transparent;\n            background: linear-gradient(90.05deg, #9E00FF 0.59%, #0048D4 67.54%, #00FFC2 104.11%);\n            color: #FFFFFF;\n        }\n        #bnplContinueButton:focus {\n            box-shadow: 0 0 0 2px inset #fbfdfe, 0 0 0 1px #878787;\n            border: 1px solid #878787;\n        }\n\n        #bnplTotalAmountContainer {\n            border-top: 1px solid rgba(0, 0, 0, 0.09);\n            display: flex;\n            flex: 1 0 100%;\n            flex-direction: column;\n        }\n        .bnpl-top-banner-section {\n            padding: 14px;\n            font-size: 14px;\n            text-align: center;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n        }\n        .bnpl-top-banner-icon {\n            display: block;\n            width: 23px;\n            height: 23px;\n            margin-left: 6px;\n        }\n        @media (prefers-color-scheme: light) {\n            .bnpl-top-banner-section {\n                background: #EFF6FC;\n            }\n            .bnpl-top-banner-section-exp3 {\n                background: linear-gradient(90deg, #FFF9D9 0%, #E9FBFF 53.12%, #DDEBFF 100%) !important;\n            }\n        }\n        @media (prefers-color-scheme: dark) {\n            .bnpl-top-banner-section {\n                background: #004C87;\n            }\n            .bnpl-top-banner-section-exp3 {\n                background: linear-gradient(270deg, #4C6945 -1.16%, #427681 46.78%, #5D497C 99.98%) !important;\n            }\n        }\n        .bnplLogo {\n            padding-top: 26px;\n            display: flex;\n            justify-content: center;\n            width: 97px;\n            margin: 0 auto;\n        }\n        .bnplTitleSection {\n            padding-top: 20px;\n            text-align: center;\n            display: contents;\n        }\n        .bnplTitle {\n            line-height: 36px;\n            font-size: 28px;\n            font-weight: 500;\n        }\n        .bnplSubTitle {\n            font-size: 16px;\n            line-height: 22px;\n        }\n        .bnplFeeDescription {\n            font-size: 8px;\n            line-height: 11px;\n            width: 320px;\n            margin-inline: auto;\n            font-family: 'Segoe UI', sans-serif;\n        }\n        .bnplShoppingCartValue {\n            padding-top: 22px;\n            padding-bottom: 8px;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            position: relative;\n        }\n        .bnplShoppingCartValue::after {\n            position: absolute;\n            bottom: 0;\n            left: 0;\n            right: 0;\n            width: 230px;\n            height: 1px;\n            content: '';\n            background: #C6C3C5;\n            margin: auto;\n        }\n        .bnplCartValueInput {\n            width: 200px;\n            font-size: 40px;\n            line-height: 1.21;\n            height: 52px;\n            border: none !important;\n            box-shadow: none !important;\n            text-align: center;\n            padding: 0;\n            transition: none;\n            font-weight: 500;\n            outline: none;\n            background: transparent;\n            font-family: 'Segoe UI', sans-serif;\n        }\n        .bnplAmountReminder {\n            text-align: center;\n            font-size: 12px;\n        }\n        .bnplLicense {\n            text-align: center;\n            margin-top: 48px;\n            padding: 0 42px 10px;\n        }\n        .bnplLicense .bnplLicenseText {\n            font-size: 10px;\n        }\n        .bnplLicense .bnplLicenseText a {\n            color: #0066B4;\n        }\n        .bnplErrorMsgContainer {\n            margin: 0 10px 13px;\n        }\n        .bnplErrorMsg {\n            padding: 9px;\n            background-color: #FDE7E9;\n            border-radius: 4px;\n            display: flex;\n            align-items: center;\n        }\n        .bnplErrorIcon {\n            width: 20px;\n            height: 20px;\n            margin-right: 10px;\n        }\n        #bnplErrorText {\n            font-size: 12px;\n        }\n        .bnplTotalAmountFooter {\n            width: auto;\n            height: 64px;\n            display: flex;\n            flex-direction: row;\n            justify-content: space-between;\n            align-items: center;\n            border-top: 1px solid rgba(0, 0, 0, 0.09);\n            background: linear-gradient(180deg, #EEFCFF 20.31%, #F5F9FF 46.88%, #FFFFFF 98.44%);\n            box-sizing: border-box;\n        }\n        #bnplContinueButton:disabled {\n            opacity: 0.3;\n            cursor: not-allowed;\n        }\n        .bnplFooterBtns {\n            display: flex;\n            align-items: center;\n        }\n        #bnplFooterCancel {\n            color: #0066B4;\n            font-size: 14px;\n            margin-right: 12px;\n            cursor: pointer;\n            text-decoration: none;\n        }\n        #bnplContinueButton {\n            margin-right: 24px;\n        }\n        @media (prefers-color-scheme: dark) {\n            #bnplTotalAmountContainer {\n                border-top: 1px solid rgb(255, 255, 255, 0.09);\n            }\n            .bnplCartValueInput {\n                color: #FFFFFF;\n            }\n            .bnplLicense .bnplLicenseText a {\n                color: #86BFEB;\n            }\n            .bnplTotalAmountFooter {\n                background: #424242;\n            }\n            #bnplFooterCancel {\n                color: #86BFEB;\n            }\n        }\n        @media (forced-colors: active) {\n            #bnplContinueButton {\n                background-color: Highlight;\n                forced-color-adjust: none;\n                color: highlightText;\n            }\n            #bnplContinueButton:hover {\n                background: highlighttext;\n                color: highlight;\n                border: 1px solid highlight;\n            }\n            #bnplContinueButton:focus {\n                box-shadow: 0 0 0 2px HighlightText inset;\n                border-color: buttonText;\n            }\n            #bnplContinueButton:focus-visible {\n                border: 1px solid buttontext;\n                box-shadow: highlighttext 0px 0px 0px 2px inset;\n            }\n        }\n        @media (-ms-high-contrast: active) {\n            .bnplErrorIcon svg {\n                fill: ButtonText;\n            }\n        }"}GetResultNegativeContainer(){return`\n        <div class="resultWrapper">\n            <div class="overlayContent" id="divOverlayResultNegative" style="${this.isMobile?"box-sizing: border-box; padding-left: 20px; padding-right: 20px;":""}" >\n                <div id="txtContentNegative" style="display: flex; flex-direction: column; ${this.isMobile?"width: 0; flex-grow: 1;":""}">\n                    <div id="txtResultNegativeCashbackHeader" style="display: flex; flex-direction: row; align-items: center;"></div>\n                    <div class="txtLarge" id="txtResultNegativeTitle" role="heading" aria-level="1"></div>\n                    <div id="divOverlayResultExpressCheckoutNegative" class="divOverlayHide" style="margin-top:30px;">\n                        <div id="divOverlayResultCheckoutTitle">\n                            <p class="txtMedium" id="txtECNegativeHeader" style="line-height:24px;color:rgba(0, 0, 0, 0.83);" role="heading" aria-level="1"></p>\n                        </div>\n                        <div id="divOverlayResultCheckoutDetails">\n                            <svg style="margin:auto; margin-top:10px; margin-bottom:5px" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n                            <rect x="1" y="8" width="30" height="16" rx="1" fill="#1F65F1"/>\n                            <rect x="1" y="10" width="30" height="3" fill="#1243A6"/>\n                            <rect x="2" y="14" width="14" height="4" rx="1" fill="#F5F5F5"/>\n                            <circle cx="24" cy="20" r="7.5" fill="white" stroke="#FFAC01"/>\n                            <path d="M21.5947 20.2495L20.3906 20.4561L21.2344 21.4624L20.6104 21.8931L19.96 20.7505L19.3096 21.8931L18.6812 21.4624L19.5293 20.4561L18.3208 20.2495L18.5713 19.5464L19.7007 19.999L19.5601 18.6982H20.3599L20.2192 19.999L21.3486 19.5464L21.5947 20.2495ZM25.5059 20.2495L24.3018 20.4561L25.1455 21.4624L24.5215 21.8931L23.8711 20.7505L23.2207 21.8931L22.5923 21.4624L23.4404 20.4561L22.2319 20.2495L22.4824 19.5464L23.6118 19.999L23.4712 18.6982H24.271L24.1304 19.999L25.2598 19.5464L25.5059 20.2495ZM29.417 20.2495L28.2129 20.4561L29.0566 21.4624L28.4326 21.8931L27.7822 20.7505L27.1318 21.8931L26.5034 21.4624L27.3516 20.4561L26.1431 20.2495L26.3936 19.5464L27.5229 19.999L27.3823 18.6982H28.1821L28.0415 19.999L29.1709 19.5464L29.417 20.2495Z" fill="#1F65F1"/>\n                            <path d="M3 20H7" stroke="#F5F5F5" stroke-linecap="round"/>\n                            <path d="M3 22H6" stroke="#F5F5F5" stroke-linecap="round"/>\n                            </svg>\n                            <p class="txtSmall"\n                                id="txtResultNegativeCheckoutCvv" style="margin-left:3px;color: rgba(0, 0, 0, 0.55);"></p>\n                        </div>\n                    </div>\n                    <a class="txtSmall" id="txtResultNegativeCashbackOfferDetails" style="width: 295px; margin-top: 7px; font-size: 12px; line-height: 20px;"></a>\n                    <p class="txtMedium" id="txtResultNegativeDetails" style="margin-top: 10px; font-size: 16px; line-height: 24px; color: #767676;"></p>\n                    <div id="divOverlayAttCouponNeg" class="divOverlayHide">\n                        <div id="divOverlayPromptNeg"><div id="iconPromptNeg" aria-hidden="true"></div><p class="txtLarge" id="txtAttCouponPromptNeg"></p></div>\n                        <p class="txtLarge" id="txtAttCouponTitleNeg" role="heading" aria-level="2" style="font-size: 20px;"></p>\n                        <div id="btnColorfulNeg"><button class="txtMedium" id="btnContinueShoppingNeg"></button></div>\n                    </div>\n                    ${this.GetReceiptScannerBanner()}\n                </div>\n                <video aria-hidden="true" name="media" class="vdoAutoApply"><source id="vdoResultNegative" type="video/mp4"></video>\n            </div>\n        </div>\n        `}GetResultNegativeUpsellRewardsContainer(){return`\n        <div class="resultWrapper">\n            <div class="overlayContent" id="divResultNegativeUpsellRewardsContainer" style="${this.isMobile?"box-sizing: border-box; padding-left: 20px; padding-right: 20px;":""}" >\n                <div id="divResultNegativeUpsellRewardsContent" style="display: flex; flex-direction: column; ${this.isMobile?"width: 0; flex-grow: 1;":""}">\n                    <div class="txtLarge" id="divResultNegativeUpsellRewardsTitle" role="heading" aria-level="1">\n                    </div>\n                    <p class="txtMedium" id="pResultNegativeUpsellRewardsSubtitle" style="margin-top: 10px; font-size: 16px; line-height: 24px; color: #767676;"></p>\n                    <hr id="hrResultNegativeUpsellRewards" style="color: #EBEBEB; margin-top: 4%; width: 364px; display: none;" />\n                    <div class="txtMedium" style="margin-top: 10px; font-size: 16px; line-height: 24px; color: #767676;">\n                        <img id="imgResultNegativeUpsellRewardsLogo" style="width:28px; height:28px; vertical-align:middle; padding-bottom:6px;"></img>\n                        <span style="font-weight: 600;" id="spanResultNegativeUpsellRewardsPointsLeft"></span>\n                        <span id="spanResultNegativeUpsellRewardsPointsSuffix"></span>\n                    </div>\n                </div>\n                <video aria-hidden="true" name="media" class="vdoAutoApply">\n                    <source id="vdoResultNegativeUpsellRewards" type="video/mp4">\n                </video>\n            </div>\n        </div>\n        `}GetNegativeCashbackUpsellContainer(){return this.isMobile?'\n            <div class="resultWrapper">\n                <div class="overlayContent" id="divOverlayResultNegativeCashbackUpsell" style="margin-top: 10px; display: flex; flex-direction: column;">\n                    <div style="display:flex;">\n                        <div class="textContent" id="txtContentNegativeCashbackUpsell" style="display: flex; flex-direction: column; gap: 20px;">\n                            <p class="txtCashbackUpsellTitle"\n                                id="txtResultNegativeCashbackUpsellTitle" ></p>\n                            <div style="display: flex; gap: 8px;">\n                                <img class="imgStoreLogo" id="imgStoreLogo" style="width:16px; height:16px; position: initial;"></img>\n                                <p class="txtCashbackUpsellStoreName" id="txtStore"></p>\n                            </div>\n                            <div class="txtCashbackUpsellOffer"\n                                id="txtResultNegativeCashbackUpsellDetails"></div>\n                                <a id=infoIcon class="infoIcon" part="control" href="#" style="display:inline-block;"></a>\n                            <div id="btnSolidColorNeg"><button class="txtMedium" id="btnJoinAndActivate" style="color:#FFFFFF"></button></div>\n                            <div id="divOverlayAttCouponNeg" class="divOverlayHide">\n                                <div id="divOverlayPromptNeg"><div id="iconPromptNeg" aria-hidden="true"></div><p class="txtLarge" id="txtAttCouponPromptNeg"></p></div>\n                                <p class="txtLarge" id="txtAttCouponTitleNeg" role="heading" aria-level="2" style="font-size: 20px;"></p>\n                                <div id="btnContinueShoppingNeg"><button class="txtMedium" id="btnCashbackUpsellCloseOverlay" style="color:#FFFFFF"></button></div>\n                            </div>\n                        </div>\n                        <video aria-hidden="true" name="media" class="vdoAutoApply"><source id="vdoResultNegativeCashbackUpsell" type="video/mp4"></video>\n                    </div>\n                    <p class="txtCashbackUpsellPrivacy" id="txtCashbackUpsellPrivacyTerms"></p>\n                </div>\n            </div>\n            ':'\n            <div class="resultWrapper">\n                <div class="overlayContent" id="divOverlayResultNegativeCashbackUpsell" >\n                    <div class="textContent" id="txtContentNegativeCashbackUpsell" style="display: flex; flex-direction: column; top: 0px;">\n                        <p class="txtCashbackUpsellTitle"\n                            id="txtResultNegativeCashbackUpsellTitle" ></p>\n                        <p class="txtCashbackUpsellStoreName" id="txtStore"></p>\n                        <img class="imgStoreLogo" id="imgStoreLogo" style="position:absolute; left:41px; top: 83px; width:16px; height:16px;"></img>\n                        <div class="txtCashbackUpsellOffer" id="txtResultNegativeCashbackUpsellDetails"></div>\n                        <a id=infoIcon class="infoIcon" part="control" href="#" style="display:inline-block; position: absolute;"></a>\n                        <div id="btnSolidColorNeg"><button class="txtMedium" id="btnJoinAndActivate" style="color:#FFFFFF"></button></div>\n                        <p class="txtCashbackUpsellPrivacy" id="txtCashbackUpsellPrivacyTerms"></p>\n                        <div id="divOverlayAttCouponNeg" class="divOverlayHide">\n                            <div id="divOverlayPromptNeg"><div id="iconPromptNeg" aria-hidden="true"></div><p class="txtLarge" id="txtAttCouponPromptNeg"></p></div>\n                            <p class="txtLarge" id="txtAttCouponTitleNeg" role="heading" aria-level="2" style="font-size: 20px;"></p>\n                            <div id="btnContinueShoppingNeg"><button class="txtMedium" id="btnCashbackUpsellCloseOverlay" style="color:#FFFFFF"></button></div>\n                        </div>\n                    </div>\n                    <video aria-hidden="true" name="media" class="vdoAutoApply"><source id="vdoResultNegativeCashbackUpsell" type="video/mp4"></video>\n                </div>\n            </div>\n            '}GetShortcircuitResultContainer(){return'\n        <div class="resultWrapper">\n            <div class="overlayContent" id="divOverlayResultShortCircuit">\n                <p class="txtLarge" id="txtResultShortcircuitTitle" role="heading" aria-level="1" style="font-size: 18px"></p>\n                <p class="txtMedium txtshortcircuitDetails" id="txtResultShortcircuitDetails"></p>\n                <button id="btnResultShortcircuitCoupon">\n                    <p id="txtResultShortcircuitCouponCode"></p>\n                    <p id="txtResultShortcircuitCouponDesc" style="margin: 0"></p>\n                </button>\n                <p class="txtMedium txtshortcircuitDetails" id="txtResultShortcircuitCalltoAction"></p>\n            </div>\n        </div>\n        '}GetBNPLTotalAmountContainer(){return`\n        <div id="bnplTotalAmountContainer" class="divOverlayHide">\n            <div class="bnpl-top-banner-section">\n                <p class="txtMedium" id="bnpl-top-banner-content"></p>\n                <img class="bnpl-top-banner-icon" src="${this.imageEndPoint}autoApply/EEPositiveIcon.png" aria-hidden="true"></img>\n            </div>\n            <div class="bnplLogo"></div>\n            <div class="bnplTitleSection" id="wallet-extra-title">\n                <p class="bnplTitle txtLarge"></p>\n                <p class="bnplSubTitle txtSmall divOverlayHide"></p>\n                <p class="bnplFeeDescription divOverlayHide"></p>\n            </div>\n            <div class="bnplShoppingCartValue">\n                <input type="text" class="bnplCartValueInput" aria-labelledby="wallet-extra-title" required />\n            </div>\n            <p class="bnplAmountReminder txtSmall"></p>\n            <div class="bnplLicense">\n                <p class="bnplMsDescription txtSmall"></p>\n                <p class="bnplLicenseText txtSmall"></p>\n            </div>\n            <div class="bnplErrorMsgContainer divOverlayHide">\n                <div class="bnplErrorMsg">\n                    <div class="bnplErrorIcon">\n                        <svg fill="#A80000" width="20" height="20" viewBox="0 0 20 20" aria-hidden=true>\n                            <path\n                            d='M10 2a8 8 0 110 16 8 8 0 010-16zm0 10.5a.75.75 0 100 1.5.75.75 0 000-1.5zM10 6a.5.5 0 00-.5.41v4.68a.5.5 0 001 0V6.41A.5.5 0 0010 6z'\n                            fillRule='nonzero'\n                            />\n                        </svg>\n                    </div>\n                    <span id="bnplErrorText" class="txtSmall"></span>\n                </div>\n            </div>\n        </div>`}GetSocialSharingOverlayRefresh(){return"\n            #divOverlayShare {\n                max-width: 283px;\n                width: 100%;\n                box-sizing: border-box;\n                border-radius: 4px;\n                flex-direction: column;\n                justify-content: flex-start;\n                align-self: flex-start;\n                margin-top: 15px;\n                grid-gap: 4px;\n                grid-template-columns: auto 40px 40px;\n            }\n            #txtOverlayShare {\n                font-family: 'Segoe UI', sans-serif;\n                font-size: 14px;\n                font-style: normal;\n                font-weight: normal;\n                line-height: 20px;\n                margin: 8px;\n                grid-column-start: 1;\n                grid-column-end: 2;\n                text-align: start;\n                margin-left: 0px;\n                margin-right: 0px;\n            }\n            .btnSocialSharing {\n                border-color: transparent;\n                background: transparent;\n                cursor: pointer;\n                width: 40px;\n                height: auto;\n                place-self: center;\n                align-items: center;\n                justify-content: center;\n                display: flex;\n            }"}GetOverlayFooter(){return`\n        <div class="divOverlayFooter">\n            <div style="display:flex; flex-direction: row;">\n                <img aria-hidden="true" class="imgOverlayExtensionIcon"/>\n                <p aria-hidden="true" id="edgeShoppingLabel" class="txtMedium txtClientName"></p>\n            </div>\n            <div style="display: flex; flex-direction: row; margin-right: 24px; align-items: center;${this.isMobile?" flex-wrap: wrap; justify-content: center; gap: 8px;":""}">\n                <button id="btnOverlayRebates" class="txtSmall" style="display: none;"></button>\n                <button id="btnOverlayClose" class="txtMedium" autofocus></button>\n            </div>\n        </div>`}GetBNPLTotalAmountFooter(){return'\n        <div class="bnplTotalAmountFooter divOverlayHide">\n            <div style="display:flex; flex-direction: row;">\n                <img aria-hidden="true" class="imgOverlayExtensionIcon"/>\n                <p class="txtMedium txtClientName"></p>\n            </div>\n            <div class="bnplFooterBtns">\n                <a class="txtSmall overlayClose" id="bnplFooterCancel" href="javascript:void(0)" role="button"></a>\n                <button id="bnplContinueButton" class="txtSmall"></button>\n            </div>\n        </div>'}GetReceiptScannerBanner(){return`\n        <div class="receiptScannerBanner divOverlayHide">\n            <img class="receiptScannerBannerImg" src="${this.imageEndPoint}groceriesCashback/receiptScannerBanner/receiptScannerDealBanner-CouponOverlayV2.svg"></img>\n        </div>`}GetECOvelayCSS(){return"\n        #mainOverlayWrapper {\n            position: relative;\n            width: 100%;\n            height: 100%;\n            display: flex;\n            justify-content: center;\n        }\n        .divOverlayContentWrapper{\n            width: auto;\n            height: auto;\n            min-width: 500px;\n            flex-direction: column;\n            justify-content: space-between;\n            place-self: center;\n            position: absolute;\n            border: 1px solid transparent;\n            border-radius: 4px;\n            background: linear-gradient(0deg, #FFFFFF, #FFFFFF);\n            background: #FFFFFF;\n            overflow:hidden;\n            z-index: 21;\n        }\n        .mainModals {\n            width: 500px;\n            height: 100%;\n            display: flex;\n            flex-direction: column;\n            align-content: center;\n            align-self: center;\n            max-height: calc(100vh - 64px); /* 64px is the footer height */\n            overflow: auto;\n        }\n        .imgOverlayExtensionIcon {\n            width: auto;\n            height: auto;\n            margin: 24px;\n            margin-right: 0px;\n            z-index: 25;\n        }\n        .txtLarge {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 24px;\n            font-style: normal;\n            color: rgba(0, 0, 0, 0.83);\n            font-weight: 600;\n            line-height: 28px;\n            margin: 0px;\n        }\n        .txtMedium {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 14px;\n            font-style: normal;\n            color: rgba(0, 0, 0, 0.83);\n            font-weight: normal;\n            line-height: 20px;\n            margin: 0px;\n        }\n        .txtSmall {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 12px;\n            font-style: normal;\n            color: rgba(0, 0, 0, 0.83);\n            font-weight: normal;\n            line-height: 16px;\n            margin: 0px;\n        }\n        .divOverlayShow{\n            display: flex;\n        }\n        .divOverlayInlineShow{\n            display: inline;\n        }\n        .divOverlayGridShow{\n            display: grid;\n        }\n        .divOverlayHide{\n            display: none !important;\n        }\n        .overlayContent {\n            width: calc(100% - 30px);\n            align-self: center;\n            display: flex;\n            background-color: transparent;\n            flex-direction: column;\n            justify-content: flex-start;\n            align-content: center;\n            align-items: center;\n            text-align: center;\n            margin: 0px;\n            margin-top: 48px;\n            margin-bottom: 25px;\n            flex-grow: 2;\n            z-index: 1;\n        }\n        #txtBarTitle,\n        #txtBarCheckoutTitle {\n            width: calc(100% - 90px);\n            text-align: center;\n            align-self: center;\n        }\n        #txtProgressCouponTitle {\n            width: calc(100% - 90px);\n            text-align: center;\n            align-self: center;\n            margin-bottom: 15px;\n        }\n        #txtProgressTitle {\n            width: calc(100% - 90px);\n        }\n        .txtClientName {\n            font-weight: 500;\n            align-self: center;\n            margin-left: 5px;\n            margin-right: 5px;\n        }\n        #btnOverlayCancel {\n            width: auto;\n            min-width: 133px;\n            height: 32px;\n            display: block;\n            margin: 24px;\n            align-self: center;\n            padding: 5px;\n            align-items: center;\n            border-radius: 2px;\n            border-color: transparent;\n            background: rgba(0, 0, 0, 0.07);\n            outline:none;\n            box-sizing: border-box;\n            fill: inherit;\n            text-align: center;\n            cursor: pointer;\n            z-index: 25;\n        }\n        #btnOverlayClose, #btnOverlayCheckout {\n            width: auto;\n            min-width: 133px;\n            height: 32px;\n            display: block;\n            align-self: center;\n            padding: 5px;\n            align-items: center;\n            color: #FFFFFF;\n            box-sizing: border-box;\n            fill: inherit;\n            background-color: #0078D4;\n            border-radius: 2px;\n            border-color: transparent;\n            text-align: center;\n            cursor: pointer;\n            z-index: 25;\n        }\n        #btnOverlayRebates {\n            width: auto;\n            min-width: 133px;\n            height: 32px;\n            align-self: center;\n            margin-right: 8px;\n            padding: 5px;\n            align-items: center;\n            border-radius: 2px;\n            border-color: transparent;\n            background: rgba(0, 0, 0, 0.07);\n            outline:none;\n            box-sizing: border-box;\n            fill: inherit;\n            text-align: center;\n            cursor: pointer;\n            z-index: 25;\n        }\n        .closeIcon {\n            width: auto;\n            height: auto;\n            position: absolute;\n            right: 12px;\n            top: 12px;\n            cursor: pointer;\n            z-index: 25;\n        }\n        .resultWrapper {\n            width: 100%;\n            height: 100%;\n            top: 0px;\n            left: 0px;\n            flex-direction: column;\n            justify-content: stretch;\n            align-items: center;\n            border-radius: 4px;\n            background: transparent;\n            z-index: 21;\n        }\n        #divOverlayResultSavings {\n            display: flex;\n            align-self: center;\n            justify-content: center;\n            flex-direction: column;\n            text-align: center;\n            width: calc(100% - 165px);\n        }\n        #divOverlayResultPositive {\n            width: inherit;\n        }\n        #divPositiveCouponDetails {\n            width: 100%;\n            display: flex;\n            flex-direction: column;\n            justify-content: center;\n            text-align: center;\n            margin-top: 16px;\n            color: rgba(0, 0, 0, 0.55);\n        }\n        #divOverlayResultNegative {\n            width: 100%;\n            display: flex;\n            flex-direction: row;\n            justify-content: center;\n            text-align: start;\n            margin-top: 0px;\n            margin-bottom: 0px;\n        }\n        .txtOverlayResultPositive {\n            margin-top: 0px;\n            margin-bottom: 15px;\n            letter-spacing: unset;\n        }\n        #divOverlayResultCoupon {\n            display: flex;\n            flex-direction: column;\n            justify-content: center;\n            align-self: center;\n            margin-top: 15px;\n        }\n        #divOverlayShare {\n            width: 283px;\n            border: 1px solid rgba(0, 0, 0, 0.09);\n            box-sizing: border-box;\n            border-radius: 4px;\n            flex-direction: column;\n            justify-content: center;\n            align-self: center;\n            margin-top: 15px;\n            grid-gap: 4px;\n            grid-template-columns: 50% auto auto;\n        }\n        #txtOverlayShare {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 14px;\n            font-style: normal;\n            font-weight: normal;\n            line-height: 20px;\n            margin: 8px;\n            grid-column-start: 1;\n            grid-column-end: 2;\n            text-align: start;\n        }\n        .btnSocialSharing {\n            border-color: transparent;\n            background: transparent;\n            cursor: pointer;\n            width: 40px;\n            height: auto;\n            place-self: center;\n            align-items: center;\n            display: flex;\n            justify-content: center;\n        }\n        #txtResultPositiveCoupon {\n            display: inline;\n            margin-right: 1px;\n            align-self: center;\n            text-transform: uppercase;\n            font-weight: 600;\n            letter-spacing: unset;\n        }\n        .divOverlayFooter {\n            width: auto;\n            height: 64px;\n            display: flex;\n            flex-direction: row;\n            justify-content: space-between;\n            align-items: center;\n            border-top: 1px solid rgba(0, 0, 0, 0.09);\n            background: #F7F7F7;\n            box-sizing: border-box;\n        }\n        #btnOverlayClose:hover, #btnOverlayCheckout:hover {\n            outline: 2px solid transparent;\n            background-color: ButtonFace;\n            color: ButtonText;\n            border-color: ButtonText;\n        }\n        #btnOverlayCancel:hover {\n            outline: 2px solid transparent;\n            background-color: ButtonFace;\n            color: ButtonText;\n            border-color: ButtonText;\n        }\n        #btnOverlayRebates:hover {\n            outline: 2px solid transparent;\n            background-color: ButtonFace;\n            color: ButtonText;\n            border-color: ButtonText;\n        }\n        #btnOverlayClose:focus, #btnOverlayCheckout:focus {\n            border-color: #000000;\n            box-shadow: 0 0 0px 2px #ffffff inset;\n        }\n        #btnOverlayCancel:focus {\n            border-color: #000000;\n            box-shadow: 0 0 0px 2px #ffffff inset;\n        }\n        #btnOverlayRebates:focus {\n            border-color: #000000;\n            box-shadow: 0 0 0px 2px #ffffff inset;\n        }\n        #divImportBrowser {\n            flex-direction: column;\n            align-self: center;\n            margin-top: 15px;\n        }\n        #divJoinRebates {\n            flex-direction: column;\n            align-self: center;\n            margin-top: 10px;\n            width: calc(100% - 100px);\n        }\n        #divImportBrowserWrapper {\n            width: calc(100% - 60px);\n            display: flex;\n            flex-direction: row;\n            align-self: center;\n            margin-top: 15px;\n        }\n        #divJoinRebatesWrapper {\n            display: flex;\n            flex-direction: row;\n            align-self: center;\n            margin-top: 15px;\n        }\n        .hrDivider {\n            width: calc(100% - 20px);\n            margin-bottom: 16px;\n            height: 0px;\n            border: 1px solid rgba(0, 0, 0, 0.1);\n            border-width: 0px;\n            border-top-width: 1px;\n            position: absolute;\n            left: 0;\n            right: 0;\n        }\n        #txtJoinRebates {\n            width: 100%;\n            display: flex;\n            flex-direction: column;\n            flex-grow: 2;\n            margin: 20px;\n            margin-left: 0px;\n            justify-content: center;\n        }\n        #imgPositiveResult {\n            position: absolute;\n            align-self: center;\n            margin-top: 13px;\n        }\n        /* The dots/bullets/indicators */\n        .dot {\n        cursor: pointer;\n        height: 8px;\n        width: 8px;\n        margin: 0 2px;\n        background-color: #bbb;\n        border-radius: 50%;\n        display: inline-block;\n        transition: background-color 0.6s ease;\n        }\n        .active, .dot:hover {\n        background-color: #717171;\n        }\n        /* Fading animation */\n        .fade {\n        -webkit-animation-name: fade;\n        -webkit-animation-duration: 1.5s;\n        animation-name: fade;\n        animation-duration: 1.5s;\n        }\n        @-webkit-keyframes fade {\n        from {opacity: .4}\n        to {opacity: 1}\n        }\n        @keyframes fade {\n        from {opacity: .4}\n        to {opacity: 1}\n        }\n        .show {\n            display:flex;\n        }\n        .hide {\n            display:none;\n        }\n        .ecspan {\n            color: rgba(0, 0, 0, 0.83);\n            display: inline;\n        }\n        .ecspangrey {\n            color: grey;\n        }\n        @media (prefers-color-scheme: dark) {\n            div, span, p {\n              color: #FFFFFF!important;\n            }\n            .closeIcon > svg > path {\n                fill: #FFFFFF;\n            }\n            .divOverlayFooter {\n                background: #424242;\n            }\n            .divOverlayContentWrapper {\n                background: #4A4A4A;\n            }\n            #btnOverlayCancel {\n                background: rgba(255, 255, 255, 0.09);\n                color: #FFFFFF;\n            }\n            #btnOverlayRebates {\n                background: rgba(255, 255, 255, 0.09);\n                color: #FFFFFF;\n            }\n            #divOverlayShare {\n                border: 1px solid rgba(255, 255, 255, 0.09);\n            }\n            #divOverlayResultNegative {\n                margin-top: 20px;\n                margin-bottom: 20px;\n            }\n            .ecspan {\n                color: #FFFFFF;\n            }\n        }\n        @media (forced-colors: active) {\n            #btnOverlayClose, #btnOverlayCheckout {\n                background-color: Highlight;\n                forced-color-adjust: none;\n                color: highlightText;\n            }\n            .btnCashbackUpsellCloseOverlay{\n                color:buttontext;\n                border-color:buttontext;\n            }\n            #btnOverlayCancel {\n                background-color: Highlight;\n                forced-color-adjust: none;\n                color: highlightText;\n            }\n            #btnOverlayClose: focus, #btnOverlayCheckout:focus {\n                box-shadow: 0 0 0 2px HighlightText inset;\n                border-color: buttonText;\n            }\n            #btnOverlayCancel: focus {\n                box-shadow: 0 0 0 2px HighlightText inset;\n                border-color: buttonText;\n            }\n            #btnOverlayRebates: focus {\n                box-shadow: 0 0 0 2px HighlightText inset;\n                border-color: buttonText;\n            }\n            #imgPositiveResult {\n                display: none;\n            }\n            .btnSocialSharing {\n                border: none;\n            }\n            #divOverlayProgress {\n                border: 1px solid buttontext;\n            }\n            .textContent {\n                width: calc(100% - 40px);\n            }\n        }\n        @media (max-width: 500px) {\n            .divOverlayContentWrapper{\n                max-width: 500px;\n                height: 100%;\n                top: 0px;\n                left: 0px;\n                align-self: center;\n                flex-direction: column;\n                justify-content: space-between;\n                position: relative;\n                border-radius: 4px;\n                background: linear-gradient(0deg, #FFFFFF, #FFFFFF);\n                overflow:auto;\n                z-index: 21;\n            }\n            .overlayContent {\n                margin-top: 0px;\n                margin-bottom: 0px;\n            }\n            .resultWrapper {\n                height: auto;\n                width: auto;\n                max-width: 500px;\n                top: 0px;\n                left: 0px;\n                flex-direction: column;\n                align-items: center;\n                border-radius: 4px;\n                background: transparent;\n                z-index: 21;\n            }\n            .mainModals {\n                width: 100%;\n                height: 100%;\n                display: flex;\n                flex-direction: column;\n                align-content: center;\n                align-self: center;\n            }\n            #txtBarTitle {\n                width: 100%;\n            }\n            #txtProgressTitle {\n                width: 100%;\n            }\n            .txtSmall {\n                display: inline-block;\n            }\n            .txtMedium {\n                display: inline-block;\n            }\n            .txtLarge {\n                display: inline-block;\n            }\n            .divOverlayFooter {\n                width: 100%;\n            }\n        }"}GetECOverlayHtml(){return`\n        <div id="mainOverlayWrapper"><div role="dialog" aria-labelledby="txtProgressTitle" class="divOverlayHide divOverlayContentWrapper divOverlayContentWrapperCheckout" id="divOverlayTestingCouponsWrapper" aria-modal="true">\n            <div class="mainModals mainModalsCheckout">\n                <div class="overlayContent overlayContentCheckout">\n                    <p aria-live="polite" role="heading" aria-level="1" class="txtLargeCheckout txtProgressTitleCheckout" id="txtProgressTitle"></p>\n                    <span id="spanTestingCoupons" role="alert" style="top: 0px; position: fixed;\n                    opacity: 0;"></span>\n                    <div id="divOverlayProgressCheckout">\n                        <div id="divOverlayBar" class="divOverlayBarCheckout" aria-hidden="true"></div>\n                    </div>\n                    <p id="txtBarCheckoutTitle" class="divOverlayHide txtSmall txtBarCheckoutTitleCheckout" style="margin: 16px 0;color: rgba(0, 0, 0, 0.55);" aria-hidden="true"></p>\n                </div>\n            </div>\n            <div class="divOverlayFooter">\n                <div style="display:flex; flex-direction: row;">\n                    <img aria-hidden="true" class="imgOverlayExtensionIcon"/>\n                    <p class="txtMedium txtClientName"></p>\n                </div>\n                <button id="btnOverlayCancel" class="txtSmall overlayClose" autofocus></button>\n            </div>\n        </div>\n        <div class="divOverlayHide divOverlayContentWrapper divOverlayContentWrapperCheckout" id="divOverlayResultWrapper" role="dialog" aria-live="assertive" aria-relevant="text" aria-hidden="true" aria-modal="true">\n            <div class="mainModals mainModalsCheckout">\n                <div class="resultWrapper divOverlayHide">\n                    <div class="overlayContent overlayContentCheckout" id="divOverlayResultPositive">\n                        <div id="divOverlayResultSavings" class="divOverlayHide">\n                            <p class="txtLargeCheckout txtOverlayResultPositive" id="txtPositiveHeader" role="heading" aria-level="1"></p>\n                        </div>\n                        <div id="divOverlayResultCoupon" class="divOverlayHide">\n                            <div style="display: flex; flex-direction: row; justify-content: center; align-self: center;">\n                                <span class="txtMedium"\n                                id="txtResultPositiveCouponDetails" style="margin-left:3px; font-size: 16px; line-height: 24px;"></span>\n                            </div>\n                            <div id="divPositiveCouponDetails">\n                            </div>\n                        </div>\n                        <div id="divOverlayResultCheckoutTitle">\n                            <p class="txtLargeCheckout txtOverlayResultPositive" id="txtECPositiveHeader" role="heading" aria-level="1"></p>\n                            <img id="divCVVSVG" src="${this.imageEndPoint}autoApply/EEPositiveIcon.png" aria-hidden="true"></img>\n                        </div>\n                        <div id="divOverlayResultCheckoutDetails">\n                            <p class="txtSmall"\n                                id="txtResultPositiveCheckoutCvv" style="margin-left:3px;color: rgba(0, 0, 0, 0.55);"></p>\n                        </div>\n                    </div>\n                </div>\n                <div class="resultWrapper divOverlayHide">\n                    <div class="overlayContent overlayContentCheckout">\n                        <p class="txtLargeCheckout"\n                                id="txtECResultNegativeTitle" role="heading" aria-level="1"></p>\n                        <div id="divOverlayResultCheckoutTitle">\n                            <p class="txtLargeCheckout txtOverlayResultPositive" id="txtECNegativeHeader" role="heading" aria-level="1"></p>\n                        </div>\n                        <div id="divOverlayResultCheckoutDetails">\n                            <p class="txtSmall"\n                                id="txtResultNegativeCheckoutCvv" style="margin-left:3px;color: rgba(0, 0, 0, 0.55);"></p>\n                        </div>\n                    </div>\n                </div>\n                ${this.GetBNPLTotalAmountContainer()}\n            </div>\n            <div class="divOverlayFooter divOverlayShow">\n                <div style="display:flex; flex-direction: row;">\n                    <img aria-hidden="true" class="imgOverlayExtensionIcon"/>\n                    <p class="txtMedium txtClientName"></p>\n                </div>\n                <div style="display: flex; flex-direction: row; margin-right: 24px; align-items: center;">\n                    <button id="btnOverlayCheckout" class="txtSmall" autofocus></button>\n                </div>\n            </div>\n            ${this.GetBNPLTotalAmountFooter()}\n        </div></div>`}GetOverlayCSS(){return`\n        #mainOverlayWrapper {\n            --text-green-savings-color: #008A21;\n        }\n        #mainOverlayWrapper {\n            position: relative;\n            width: 100%;\n            height: 100%;\n            display: flex;\n            justify-content: center;\n        }\n        .divOverlayContentWrapper {\n            width: auto;\n            height:  auto;\n            min-width: 700px;\n            flex-direction: column;\n            justify-content: space-between;\n            place-self: center;\n            position: absolute;\n            border: 1px solid transparent;\n            border-radius: 4px;\n            background: linear-gradient(0deg, #FFFFFF, #FFFFFF);\n            background: #FFFFFF;\n            overflow:hidden;\n            z-index: 21;\n        }\n        .divOverlayContentWrapperCheckout {\n            min-width: 500px;\n        }\n        .mainModals {\n            width: 700px;\n            height: 100%;\n            display: flex;\n            flex-direction: column;\n            align-content: center;\n            align-self: center;\n        }\n        .mainModalsCheckout {\n            width: 500px;\n        }\n        .divCommissionValue {\n            display: inline-block;\n            margin: 0px;\n            vertical-align: text-bottom;\n        }\n        .spanCommissionValue {\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            height: 28px;\n            line-height: 22px;\n            font-size: 20px;\n            background: #3267FA;\n            border-radius: 6px 0px 0px 6px;\n            color: #fff;\n            font-weight: 500;\n            float: left;\n            padding: 0px 1px 0px 6px;\n            margin-right: -1px;\n        }\n        .spanCommissionValueSmall {\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            height: 20px;\n            line-height: 16px;\n            font-size: 12px;\n            background: #3267FA;\n            border-radius: 4px 0px 0px 4px;\n            color: #fff;\n            font-weight: 400;\n            float: left;\n            padding: 0px 2px 0px 4px;\n            margin-right: -1px;\n        }\n        .imgCBTag {\n            display: none;\n        }\n        .imgCashbackActivatedResultNegative {\n            height: 20px;\n        }\n        .imgOverlayExtensionIcon {\n            width: auto;\n            height: auto;\n            margin: 24px;\n            margin-right: 0px;\n            z-index: 25;\n        }\n        .txtLarge {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 24px;\n            font-style: normal;\n            color: rgba(0, 0, 0, 0.83);\n            font-weight: 600;\n            line-height: 28px;\n            margin: 0px;\n        }\n        .txtLargeCheckout {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 26px;\n            font-style: normal;\n            color: rgba(0, 0, 0, 0.83);\n            font-weight: 600;\n            line-height: 36px;\n            margin: 0px;\n        }\n        .txtMedium {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 14px;\n            font-style: normal;\n            color: rgba(0, 0, 0, 0.83);\n            font-weight: normal;\n            line-height: 20px;\n            margin: 0px;\n        }\n        .txtSmall {\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 12px;\n            font-style: normal;\n            color: rgba(0, 0, 0, 0.83);\n            font-weight: normal;\n            line-height: 16px;\n            margin: 0px;\n        }\n        .textContent {\n            display: flex;\n            flex-direction: column;\n            align-items: flex-start;\n            justify-content: center;\n            min-height: 300px;\n            margin-top: 10px;\n            margin-bottom: 10px;\n            margin-left: 20px;\n            width: 100%;\n            max-width: 350px;\n        }\n        .txtCashbackUpsellOffer {\n            position: absolute;\n            display: inline-block;\n            width: 343px;\n            height: 64px;\n            left: 40px;\n            top: 105px;\n            font-family: 'Segoe UI', sans-serif;\n            font-style: normal;\n            font-size: 26px;\n            font-weight: 600;\n            line-height: 28px;\n            margin-top: 0px;\n            margin-bottom: 0px;\n            color: #1A1A1A;\n        }\n        .txtCashbackUpsellStoreName{\n            position: absolute;\n            margin-top:0px;\n            margin-bottom:0px;\n            width: 343px;\n            height: 16px;\n            left: 61px;\n            top: 83px;\n            font-family: 'Segoe UI Variable Static Small', sans-serif;\n            font-style: normal;\n            font-weight: 400;\n            font-size: 12px;\n            line-height: 16px;\n            align-items: center;\n            text-align: left;\n            color: #1A1A1A;\n        }\n        .txtResultNegativeCashbackHeader{\n            font-size: 14px;\n            font-weight: 400;\n            line-height: 20px;\n            margin-left: 7.33px;\n        }\n        .txtCashbackUpsellTitle{\n            position: absolute;\n            margin-top: 0px;\n            margin-bottom: 0px;\n            width: 450px;\n            height: 20px;\n            left: 40px;\n            top: 40px;\n            font-family: 'Segoe UI', sans-serif;\n            font-style: normal;\n            font-weight: 400;\n            font-size: 14px;\n            line-height: 20px;\n            color: #1A1A1A;\n        }\n        .txtCashbackUpsellPrivacy{\n            position: absolute;\n            left: 6.14%;\n            right: 44.7%;\n            top: 64.96%;\n            bottom: 27.49%;\n            font-family: 'Segoe UI Variable Static Small', sans-serif;\n            font-style: normal;\n            font-weight: 400;\n            font-size: 10px;\n            line-height: 14px;\n            color: #7A7A7A;\n        }\n        .txtCashbackUpsellCloseOverlay{\n            font-family: 'Segoe UI Variable Static Text', sans-serif;\n            font-style: normal;\n            font-weight: 400;\n            font-size: 14px;\n            line-height: 20px;\n            color: #036AC4;\n        }\n        .imgStoreLogo{\n            position: absolute;\n            margin-top: 0px;\n            margin-bottom: 0px;\n            width: 16px;\n            height: 16px;\n            left: 41px;\n            top: 83px;\n        }\n        .vdoAutoApply {\n            max-height: 300px;\n        }\n        .divOverlayShow{\n            display: flex;\n        }\n        .divOverlayBlockShow {\n            display: block;\n        }\n        .divOverlayInlineShow{\n            display: inline;\n        }\n        .divOverlayGridShow{\n            display: grid;\n        }\n        .divOverlayHide{\n            display: none!important;\n        }\n        .overlayContent {\n            width: calc(100% - 30px);\n            align-self: center;\n            display: flex;\n            background-color: transparent;\n            flex-direction: row;\n            justify-content: flex-start;\n            align-content: center;\n            align-items: center;\n            text-align: left;\n            margin: 0px;\n            flex-grow: 2;\n            z-index: 1;\n            min-height: 250px;\n        }\n        .overlayContentCheckout {\n            min-height: 172px;\n            flex-direction: column;\n            justify-content: center;\n            text-align: center;\n        }\n        #txtBarTitle,\n        #txtBarCheckoutTitle {\n            width: 100%;\n            text-align: center;\n            align-self: flex-start;\n            text-align: left;\n        }\n        #txtProgressCouponTitle {\n            width: 100%;\n            text-align: center;\n            align-self: flex-start;\n            margin-bottom: 15px;\n            text-align: left;\n        }\n        #divOverlayProgress {\n            width: 100%;\n            align-self: flex-start;\n            margin-top: 12px;\n            margin-bottom: 12px;\n            background-color: rgba(0, 0, 0, 0.07);\n            border-radius: 8px;\n        }\n        #txtProgressTitle {\n            width: 100%;\n            align-text: start;\n            margin-bottom: 40px;\n            font-weight: 500;\n        }\n        .txtProgressTitleCheckout {\n            margin-bottom: 23px!important;\n            margin-top: 53px!important;\n        }\n        .txtClientName {\n            font-weight: 400;\n            align-self: center;\n            margin-left: 5px;\n            margin-right: 5px;\n        }\n        #divOverlayBar {\n            width: 1%;\n            height: 8px;\n            background: linear-gradient(90deg, #CB5CFF 0%, #35CFFF 50%, #64E816 100%);\n            border-radius: 8px;\n        }\n        .divOverlayBarCheckout {\n            background: linear-gradient(90deg, #E70780 0%, #FFA318 32.29%, #01C190 58.33%, #01ADA5 70.83%, #00A9FF 98.96%)!important;\n        }\n        .txtSavingsColor {\n            color: var(--text-green-savings-color);\n            font-size: 28px;\n            line-height: 33px;\n            font-weight: 500;\n        }\n        #btnOverlayCancel {\n            width: auto;\n            min-width: 130px;\n            height: 38px;\n            display: block;\n            margin: 24px;\n            align-self: center;\n            padding: 5px 10px;\n            align-items: center;\n            border-radius: 8px;\n            background: #FFFFFF;\n            border: 1px solid #008076;\n            outline:none;\n            box-sizing: border-box;\n            fill: inherit;\n            text-align: center;\n            cursor: pointer;\n            z-index: 25;\n            color: #008076;\n            font-weight: 600;\n        }\n        #btnOverlayClose, #btnOverlayCheckout {\n            box-sizing: border-box;\n            width: auto;\n            min-width: 196px;\n            height: 40px;\n            display: block;\n            align-self: center;\n            padding: 5px;\n            align-items: center;\n            color: #FFFFFF;\n            box-sizing: border-box;\n            background: linear-gradient(#036EC9,#036EC9) padding-box, linear-gradient(180deg, #1C7DCE 90%, #024C8B 100%) border-box;\n            border-radius: 8px;\n            fill: inherit;\n            border-color: transparent;\n            text-align: center;\n            cursor: pointer;\n            z-index: 25;\n            font-weight: 600;\n            border: 1px solid transparent;\n        }\n        #btnOverlayRebates {\n            width: auto;\n            min-width: 196px;\n            height: 38px;\n            display: block;\n            margin-right: 8px;\n            align-self: center;\n            padding: 5px;\n            align-items: center;\n            border-radius: 8px;\n            background: #FFFFFF;\n            border: 1px solid #008076;\n            outline:none;\n            box-sizing: border-box;\n            fill: inherit;\n            text-align: center;\n            cursor: pointer;\n            z-index: 25;\n            color: #008076;\n            font-weight: 600;\n        }\n        .closeIcon {\n            width: auto;\n            height: auto;\n            position: absolute;\n            right: 12px;\n            top: 12px;\n            cursor: pointer;\n            z-index: 25;\n        }\n        .resultWrapper {\n            width: 100%;\n            height: 100%;\n            top: 0px;\n            left: 0px;\n            flex-direction: column;\n            justify-content: stretch;\n            align-items: center;\n            border-radius: 4px;\n            background: transparent;\n            z-index: 21;\n        }\n        #divOverlayResultSavings {\n            display: flex;\n            align-self: flex-start;\n            justify-content: center;\n            flex-direction: column;\n            text-align: left;\n            width: 100%;\n        }\n        #divOverlayResultPositive {\n            width: inherit;\n        }\n        #divPositiveCouponDetails {\n            width: 100%;\n            display: flex;\n            flex-direction: row;\n            justify-content: flex-start;\n            text-align: left;\n            color: rgba(0, 0, 0, 0.55);\n            grid-template-rows: auto 5% auto;\n            align-items: baseline;\n        }\n        #divOverlayResultNegative {\n            width: 100%;\n            display: flex;\n            flex-direction: row;\n            justify-content: center;\n            text-align: left;\n            margin-top: 0px;\n            margin-bottom: 0px;\n        }\n        .txtOverlayResultPositive {\n            margin-top: 0px;\n            margin-bottom: 15px;\n            letter-spacing: unset;\n            font-weight: 500;\n        }\n        #divOverlayResultCoupon {\n            display: flex;\n            flex-direction: column;\n            justify-content: center;\n            align-self: flex-start;\n            margin-top: 10px;\n            row-gap: 3px;\n        }\n        ${this.GetSocialSharingOverlayRefresh()}\n        #txtResultPositiveCoupon {\n            display: inline;\n            margin-right: 1px;\n            align-self: flex-start;\n            text-transform: uppercase;\n            font-weight: 600;\n            letter-spacing: unset;\n            text-align: left;\n        }\n        .divOverlayFooter {\n            width: auto;\n            height: 64px;\n            display: flex;\n            flex-direction: row;\n            justify-content: space-between;\n            align-items: center;\n            border-top: 1px solid rgba(0, 0, 0, 0.09);\n            background: linear-gradient(180deg, #EEFCFF 20.31%, #F5F9FF 46.88%, #FFFFFF 98.44%);\n            box-sizing: border-box;\n        }\n        #btnOverlayClose:hover, #btnOverlayCheckout:hover {\n            background: #006cbe;\n            color: #FFFFFF;\n        }\n        #btnOverlayCancel:hover, #btnOverlayRebates:hover {\n            outline: 2px solid transparent;\n            background: linear-gradient(267.73deg, #F0FEFF -9.53%, #DBFFFB 45.72%, #F8FDFF 97.76%);\n            color: #008076;\n            border-color: #008076;\n        }\n        #btnOverlayClose:focus, #btnOverlayCheckout:focus {\n            box-shadow: 0 0 0 2px inset #fbfdfe, 0 0 0 1px #878787;\n            border: 1px solid #878787;\n        }\n        #btnOverlayCancel:focus {\n            box-shadow: 0 0 0 2px inset #fbfdfe, 0 0 0 1px #878787;\n            border: 1px solid #878787;\n        }\n        #btnOverlayRebates:focus {\n            box-shadow: 0 0 0 2px inset #fbfdfe, 0 0 0 1px #878787;\n            border: 1px solid #878787;\n        }\n        #divImportBrowser {\n            flex-direction: column;\n            align-self: flex-start;\n            margin-top: 15px;\n        }\n        #divJoinRebates {\n            flex-direction: column;\n            align-self: flex-start;\n            margin-top: 10px;\n            width: 100%;\n        }\n        #divImportBrowserWrapper {\n            width: calc(100% - 60px);\n            display: flex;\n            flex-direction: row;\n            align-self: flex-start;\n            margin-top: 15px;\n        }\n        #divJoinRebatesWrapper {\n            display: flex;\n            flex-direction: row;\n            align-self: flex-start;\n            margin-top: 10px;\n        }\n        .hrDivider {\n            width: 100%;\n            height: 0px;\n            border: 1px solid rgba(0, 0, 0, 0.1);\n            border-width: 0px;\n            border-top-width: 1px;\n            left: 0;\n            right: 0;\n        }\n        #txtJoinRebates {\n            width: 100%;\n            display: flex;\n            flex-direction: column;\n            flex-grow: 2;\n            margin: 20px;\n            margin-left: 0px;\n            justify-content: center;\n        }\n        #divOverlayResultCheckoutTitle {\n            display: flex;\n            flex-direction: row;\n            column-gap: 4px;\n            justify-content: center;\n            align-items: center;\n            margin-bottom: 23px;\n        }\n        #txtECPositiveHeader {\n            margin: 0px;\n        }\n        #txtBarCheckoutTitle {\n            text-align: center;\n        }\n        .txtBarCheckoutTitleCheckout {\n            margin-bottom: 41px!important;\n        }\n        #divOverlayProgressCheckout {\n            width: calc(100% - 50px);\n            align-self: center;\n            margin-top: 12px;\n            margin-bottom: 12px;\n            background-color: rgba(0, 0, 0, 0.07);\n            border-radius: 8px;\n        }\n        #imgPositiveResult {\n            position: absolute;\n            align-self: center;\n            margin-top: 13px;\n        }\n        #divOverlayPromptPos, #divOverlayPromptNeg {\n            display: flex;\n            column-gap: 9px;\n        }\n        #divIconPromptPos, #divIconPromptNeg {\n            width: 24px;\n            height: 24px;\n        }\n        #txtAttCouponPromptPos, #txtAttCouponPromptNeg {\n            font-size: 18px;\n            line-height: 24px;\n            color: #949494;\n        }\n        #btnColorfulPos, #btnColorfulNeg {\n            background: linear-gradient(88.14deg, #018DC8 0.49%, #01CC83 53.44%, #0CBFC9 104.22%);\n            height: 36px;\n            width: auto;\n            max-width: 147px;\n            border-radius: 8px;\n            padding: 1.5px;\n            margin-top: 16px;\n        }\n        #btnTransparentNeg{\n            background: transparent;\n            border-color: #1C7DCE;\n            border-radius: 4px;\n            position: absolute;\n            width: 258px;\n            height: 32px;\n            left: 369px;\n            top: 319px;\n            display: flex;\n            flex-direction: row;\n            justify-content: center;\n            align-items: center;\n            padding: 2px;\n        }\n        #btnSolidColorNeg {\n            background: linear-gradient(0deg, #036EC9, #036EC9), linear-gradient(180deg, #1C7DCE 90%, #024C8B 100%);\n            border-radius:4px;\n            width: 200px;\n            height: 32px;\n            left: 40px;\n            top: 190px;\n            padding: 2px;\n            position: absolute;\n        }\n        #btnContinueShoppingPos, #btnContinueShoppingNeg {\n            background: white;\n            height: calc(100%);\n            width: calc(100%);\n            border-radius: 6px;\n            line-height: 20px;\n            color: #008076;\n            font-weight: 500;\n            border: none;\n            cursor: pointer;\n        }\n        #btnJoinAndActivate{\n            background: linear-gradient(0deg, #036EC9, #036EC9), linear-gradient(180deg, #1C7DCE 90%, #024C8B 100%);\n            border-radius:4px;\n            border-color: transparent;\n            height: calc(100%);\n            width: calc(100%);\n            font-weight:400;\n            font-size: 14px;\n            line-height:20px;\n        }\n        #btnCashbackUpsellCloseOverlay{\n            background: transparent;\n            justifyContent: center;\n            border-style:solid;\n            border-radius: 4px;\n            width: 258px;\n            height: 32px;\n            font-weight: 400;\n        }\n        #infoIcon {\n            display: inline-flex;\n            position: relative;\n            margin-left: 4px;\n        }\n        #infoTooltip.rightPositioned {\n            left: -150%;;\n        }\n        #infoTooltip {\n            display: none;\n            position: absolute;\n            top: 100%;\n            right: 150%;\n            margin-top: 5px;\n            margin-right: -30px;\n            background: #FFFFFF;\n            font-family: Segoe UI;\n            font-size: 14px;\n            line-height: 20px;\n            text-align: left;\n            box-shadow: 0px 12.8px 28.8px rgba(0, 0, 0, 0.13), 0px 0px 9.2px rgba(0, 0, 0, 0.11);\n            border-radius: 4px;\n            padding: 12px;\n            padding-bottom: 10px;\n            z-index: 900;\n            max-width: 300px;\n            width: max-content;\n        }\n        #infoTooltip.rightPositioned:before {\n            left: 10px;\n        }\n        #infoTooltip:before {\n            content: " ";\n            width: 0;\n            height: 0;\n            border-left: 10px solid transparent;\n            border-right: 10px solid transparent;\n            border-bottom: 6px solid #FFFFFF;\n            position: absolute;\n            top: -5px;\n            right: 10px;\n        }\n        #infoIcon:hover > #infoTooltip {\n            display: block;\n        }\n        #infoIcon:focus-visible > #infoTooltip,\n        #infoIcon:focus-within > #infoTooltip {\n            display: block;\n        }\n        #infoIcon:focus-visible,\n        #infoIcon:focus-within {\n            outline: none;\n        }\n        #infoIcon:focus-visible > svg {\n            outline: none;\n            box-shadow: 0px 0px 0px 2px #898989;\n            border-radius: 50%;\n        }\n        #countdown-container {\n            fill: rgb(255, 255, 255);\n            left: 50%;\n            display: inline;\n            top: 50%;\n            margin-left:310px;\n            background: transparent;\n            border: unset;\n            cursor: pointer;\n            transform: translate(-50%, -50%);\n            padding:0;\n        }\n        #countdown-svg {\n            width: 30px;\n            height: 30px;\n            display:block;\n            margin:auto;\n            transform: rotateY(-180deg) rotateZ(-90deg) scale(1,-1);\n        }\n        #countdown-circle {\n            stroke-dasharray: 81.6px;\n            stroke-dashoffset: 0px;\n            stroke-linecap: round;\n            stroke-width: 1.3px;\n            stroke: #4F94D3;\n            fill: none;\n            animation: countdown 10s linear 1 forwards;\n        }\n        #back-countdown-circle {\n            stroke-dasharray: 81.6px;\n            stroke-dashoffset: 0px;\n            stroke-linecap: round;\n            stroke-width: 1px;\n            stroke: #afacac;\n            fill: none;\n        }\n        @keyframes countdown {\n            from {\n                stroke-dashoffset: 81.6px;\n            }\n            to {\n                stroke-dashoffset: 0px;\n            }\n        }\n        @media (-ms-high-contrast: active) {\n            #flyoutClose {\n                fill: ButtonText;\n            }\n            #shopping-tag-icon path {\n                d: path("M12 5C12.5523 5 13 4.55228 13 4C13 3.44772 12.5523 3 12 3C11.4477 3 11 3.44772 11 4C11 4.55228 11.4477 5 12 5ZM9.12922                 4.30281e-05C8.59514 -0.00345791 8.08184 0.206807 7.7037 0.583987L1.02216 7.24852C0.239412 8.02928 0.238604 9.297 1.02036                 10.0788L5.96875 15.0271C6.7498 15.8082 8.01613 15.8082 8.79718 15.0271L15.428 8.39633C15.8038 8.02054 16.0146 7.51063 16.0138                 6.97917L16.0065 2.02911C16.0049 0.930807 15.1179 0.0393006 14.0196 0.032101L9.12922 4.30281e-05ZM8.4099 1.29199C8.59897 1.1034                8.85562 0.998271 9.12266 1.00002L14.013 1.03208C14.5622 1.03568 15.0057 1.48143 15.0065 2.03058L15.0138 6.98065C15.0142 7.24637                14.9088 7.50133 14.7209 7.68923L8.09007 14.32C7.69955 14.7106 7.06638 14.7106 6.67586 14.32L1.72746 9.37164C1.33659 8.98077 1.33699                 8.34691 1.72836 7.95653L8.4099 1.29199Z");\n                fill: ButtonText;\n                transform: scale(0.85);\n            }\n            #countdown-circle{\n                stroke: Text;\n            }\n            #back-countdown-circle {\n                display: none;\n            }\n        }\n        #offerDetails {\n            color: #036AC4;\n            text-decoration: none;\n            cursor: pointer;\n        }\n        #offerDetails:hover,\n        #offerDetails:focus-visible {\n            text-decoration: underline;\n            outline: none;\n        }\n        #alternateLabel {\n            font-size: 14px;\n            font-weight: 600;\n        }\n        #nonstackOr {\n            color: #616161;\n            margin-left: 30px;\n        }\n        .radioWrapper {\n            display: flex;\n            flex-direction: row;\n        }\n        .radioWrapper input {\n            opacity: 0;\n            width: 28px;\n        }\n        label#recommendedLabel {\n            display: flex;\n            flex-direction: column;\n        }\n        .radioWrapper input + label {\n            display: block;\n            position: relative;\n            cursor: pointer;\n        }\n        .radioWrapper input + label::before {\n            content: '';\n            position: absolute;\n            display: inline-block;\n            height: 16px;\n            width: 16px;\n            left: -34px;\n            border-radius: 50%;\n            box-sizing: border-box;\n            border: 1px solid #616161;\n        }\n        .radioWrapper input + label#recommendedLabel::before {\n            top: 10px;\n        }\n        .radioWrapper input + label#alternateLabel::before {\n            top: 3px;\n        }\n        .radioWrapper input + label::after {\n            content: '';\n            position: absolute;\n            display: inline-block;\n            left: -30px;\n            width: 8px;\n            height: 8px;\n            border-radius: 50%;\n        }\n        .radioWrapper input + label#recommendedLabel::after {\n            top: 14px;\n        }\n        .radioWrapper input + label#alternateLabel::after {\n            top: 7px;\n        }\n        .radioWrapper input:checked + label::before {\n            border: 1px solid #0F6CBD;\n        }\n        .radioWrapper input:checked + label::after {\n            background: #0F6CBD;\n        }\n        .radioWrapper input:focus-visible + label::before {\n            outline: black solid 1.5px;\n        }\n        /* The dots/bullets/indicators */\n        .dot {\n            cursor: pointer;\n            height: 8px;\n            width: 8px;\n            margin: 0 2px;\n            background-color: #bbb;\n            border-radius: 50%;\n            display: inline-block;\n            transition: background-color 0.6s ease;\n        }\n        .active, .dot:hover {\n            background-color: #717171;\n        }\n        /* Fading animation */\n        .fade {\n            -webkit-animation-name: fade;\n            -webkit-animation-duration: 1.5s;\n            animation-name: fade;\n            animation-duration: 1.5s;\n        }\n        @-webkit-keyframes fade {\n            from {opacity: .4}\n            to {opacity: 1}\n        }\n        @keyframes fade {\n            from {opacity: .4}\n            to {opacity: 1}\n        }\n        .show {\n            display:flex;\n        }\n        .hide {\n            display:none;\n        }\n        .ecspan {\n            color: rgba(0, 0, 0, 0.83);\n            display: inline;\n        }\n        #divOverlayResultError, #divOverlayResultShortCircuit {\n            flex-direction: column;\n            justify-content: center;\n        }\n        .txtshortcircuitDetails {\n            margin-top: 15px;\n            width: calc(100% - 100px);\n            font-size: 16px;\n            line-height: 24px;\n            text-align: center;\n        }\n        #btnResultShortcircuitCoupon {\n            cursor: pointer;\n            margin-top: 15px;\n            width: 350px;\n            height: 100px;\n            border-radius: 10px;\n            border-style: dashed;\n            border-width: 1px;\n            border-color: #A6C6E3;\n            display: flex;\n            flex-direction: column;\n            justify-content: space-around;\n            align-items: center;\n            padding: 10px;\n            background-color: transparent;\n        }\n        #btnResultShortcircuitCoupon:hover {\n            background-color: rgba(0, 87, 173, 0.05);\n        }\n        #pauseComponent {\n            width: 100%;\n        }\n        #txtResultShortcircuitCouponCode {\n            margin: 0;\n            font-size: 26px;\n            color: #0056AE;\n            font-weight: bold\n        }\n        @media (-ms-high-contrast: active) {\n            .radioWrapper input:checked + label::after {\n                background: WindowText;\n            }\n            .imgCBTag {\n                display: none!important;\n            }\n            #infoTooltip p {\n                color: WindowText!important;\n            }\n            #offerDetails {\n                color: LinkText;\n            }\n        }\n        @media (prefers-color-scheme: dark) {\n            #mainOverlayWrapper {\n                --text-green-savings-color:#35D95B;\n            }\n            div, span, p {\n              color: #FFFFFF!important;\n            }\n            .txtMedium {\n                color: rgb(255 255 255 / 83%);\n            }\n            #nonstackOr {\n                color: #EBEBEB;\n            }\n            .radioWrapper input + label::before {\n                border: 1px solid #EBEBEB;\n            }\n            .radioWrapper input:focus-visible + label::before {\n                outline: white solid 1.5px;\n            }\n            #offerDetails {\n                color: #63ADE5;\n            }\n            .radioWrapper input:checked + label::before {\n                border: 1px solid #63ADE5;\n            }\n            .radioWrapper input:checked + label::after {\n                background: #63ADE5;\n                forced-color-adjust: none;\n            }\n            .closeIcon > svg > path {\n                fill: #FFFFFF;\n            }\n            .divOverlayFooter {\n                background: #424242;\n            }\n            .divOverlayContentWrapper {\n                background: #4A4A4A;\n            }\n            #btnOverlayCancel {\n                background: rgba(255, 255, 255, 0.09);\n                color: #FFFFFF;\n            }\n            #txtCopyToClipboard {\n                background: #454446;\n            }\n            #btnOverlayRebates {\n                background: rgba(255, 255, 255, 0.09);\n                color: #FFFFFF;\n            }\n            .ecspan {\n                color: #FFFFFF;\n            }\n            .overlayContent {\n                background: #454446;\n            }\n            .mainModals {\n                background: #454446;\n            }\n            #btnContinueShoppingPos, #btnContinueShoppingNeg {\n                background: #454446;\n                color: #02d9c8;\n            }\n            #infoTooltip {\n                background: #3b3b3b;\n            }\n            #infoTooltip .txtSmall {\n                color: #FFFFFF;\n            }\n            #infoTooltip::before {\n                border-bottom: 6px solid #3b3b3b;\n            }\n            #infoIcon svg path {\n                fill: #FFFFFF;\n            }\n            #infoIcon:focus-visible > svg {\n                outline: none;\n                box-shadow: 0px 0px 0px 1px #FFFFFF;\n                border-radius: 50%;\n            }\n        }\n        @media (forced-colors: active) {\n            #btnOverlayClose, #btnOverlayCheckout {\n                background: Highlight;\n                forced-color-adjust: none;\n                color: highlightText;\n            }\n            #btnCashbackUpsellCloseOverlay{\n                color:buttontext;\n                border-color:buttontext;\n            }\n            #btnOverlayClose:hover, #btnOverlayCheckout:hover {\n                background: highlighttext;\n                color: highlight;\n                border: 1px solid highlight;\n            }\n            #btnOverlayCancel {\n                background: Highlight;\n                forced-color-adjust: none;\n                color: highlightText;\n            }\n            #btnOverlayCancel:hover {\n                background: highlighttext;\n                color: highlight;\n                border: 1px solid highlight;\n            }\n            #divOverlayBar {\n                background: Highlight;\n                forced-color-adjust: none;\n            }\n            #btnOverlayClose:focus-visible, #bnplContinueButton:focus-visible, #btnOverlayCheckout:focus-visible {\n                outline: 2px solid transparent;\n                border: 1px solid buttontext;\n                box-shadow: highlighttext 0px 0px 0px 2px inset;\n            }\n            #btnOverlayCancel:focus-visible {\n                box-shadow: 0 0 0 2px HighlightText inset;\n                border-color: buttonText;\n            }\n            #btnOverlayRebates:hover, #btnOverlayRebates:focus-visible {\n                outline: 2px solid transparent;\n                background: highlighttext;\n                color: highlight;\n                border: 1px solid highlight;\n            }\n            #imgPositiveResult {\n                display: none;\n            }\n            .vdoAutoApply {\n                display: none;\n            }\n            .btnSocialSharing {\n                border: none;\n            }\n            #divOverlayProgress {\n                border: 1px solid buttontext;\n            }\n            .textContent {\n                width: calc(100% - 40px);\n            }\n        }\n        @media (max-width: 700px) {\n            .divOverlayContentWrapper{\n                max-width: 700px;\n                height: 100%;\n                top: 0px;\n                left: 0px;\n                align-self: flex-start;\n                flex-direction: column;\n                justify-content: space-between;\n                position: relative;\n                border-radius: 4px;\n                background: linear-gradient(0deg, #FFFFFF, #FFFFFF);\n                overflow:auto;\n                z-index: 21;\n            }\n            .textContent {\n                min-height: unset;\n            }\n            .overlayContent {\n                margin-top: 0px;\n                margin-bottom: 0px;\n            }\n            .resultWrapper {\n                height: 100%;\n                width: auto;\n                max-width: 700px;\n                top: 0px;\n                left: 0px;\n                flex-direction: column;\n                align-items: center;\n                border-radius: 4px;\n                background: transparent;\n                z-index: 21;\n            }\n            .mainModals {\n                width: 100%;\n                height: 100%;\n                display: flex;\n                flex-direction: column;\n                align-content: center;\n                align-self: center;\n            }\n            #txtBarTitle {\n                width: 100%;\n            }\n            #txtProgressTitle {\n                width: 100%;\n            }\n            #divOverlayProgress {\n                width: 100%;\n                align-self: flex-start;\n                margin-top: 12px;\n                margin-bottom: 12px;\n                background-color: rgba(0, 0, 0, 0.07);\n                border-radius: 8px;\n            }\n            #divOverlayBar {\n                width: 1%;\n                height: 8px;\n                background-color: #0078D4;\n                border-radius: 8px;\n            }\n            .txtSmall {\n                display: inline-block;\n            }\n            .txtMedium {\n                display: inline-block;\n            }\n            .txtLarge {\n                display: inline-block;\n            }\n            .divOverlayFooter {\n                width: 100%;\n            }\n            .vdoAutoApply {\n                display: none;\n            }\n        }`}GetOverlayHtml(){return`<div id="mainOverlayWrapper"><div role="dialog" aria-labelledby="txtProgressTitle" class="divOverlayHide divOverlayContentWrapper" id="divOverlayTestingCouponsWrapper" aria-modal="true">\n        <div class="mainModals">\n            <div class="overlayContent">\n                <div class="textContent">\n                    <p aria-live="polite" role="heading" aria-level="1" class="txtLarge" id="txtProgressTitle"></p>\n                    <span id="spanTestingCoupons" role="alert" style="top: 0px; position: fixed;\n                    opacity: 0;"></span>\n                    <p id="txtBarCheckoutTitle" class="divOverlayHide txtSmall" style="margin: 16px 0;color: rgba(0, 0, 0, 0.55);" aria-hidden="true"></p>\n                    <p id="txtBarTitle" class="txtSmall" ></p>\n                    <div id="divOverlayProgress">\n                        <div id="divOverlayBar" aria-hidden="true"></div>\n                    </div>\n                    <span class="txtMedium" id="txtProgressCouponTitle"></span>\n                    <p id="txtECCurrentProgressTitle" class="divOverlayHide txtSmall"></p>\n                    ${this.GetReceiptScannerBanner()}\n                </div>\n                <video aria-hidden="true" muted="true" loop name="media" class="vdoAutoApply"><source id="vdoTestingCoupons" type="video/mp4"></video>\n            </div>\n        </div>\n        <div class="divOverlayFooter">\n            <div style="display:flex; flex-direction: row;">\n                <img aria-hidden="true" class="imgOverlayExtensionIcon"/>\n                <p class="txtMedium txtClientName"></p>\n            </div>\n            <button id="btnOverlayCancel" class="txtMedium overlayClose" autofocus></button>\n        </div>\n    </div>\n    <div class="divOverlayHide divOverlayContentWrapper" id="divOverlayResultWrapper" role="dialog" aria-live="assertive" aria-relevant="text" aria-hidden="true" aria-modal="true">\n        <div class="mainModals">\n            <div class="resultWrapper">\n                <div class="overlayContent" id="divOverlayResultPositive">\n                    <div class="textContent" style="margin-left: 36px;">\n                        <div id="divOverlayResultSavings">\n                            <p class="txtLarge txtOverlayResultPositive" id="txtPositiveHeader" role="heading" aria-level="1"></p>\n                        </div>\n                        <div id="divOverlayResultCoupon">\n                            <div style="display: flex; flex-direction: row; align-self: flex-start;">\n                                <span class="txtMedium" id="txtResultPositiveCouponDetails" style="font-size: 12px; line-height: 20px; text-align: left;"></span>\n                            </div>\n                            <div class="txtMedium" id="txtResultPositiveCashBackDetails" style="display: none; margin-bottom: 10px; font-size: 12px; line-height: 20px; text-align: left;"></div>\n                            <div id="divPositiveCouponDetails">\n                            </div>\n                        </div>\n                        <div id="divOverlayAttCouponPos" class="divOverlayHide">\n                            <div id="divOverlayPromptPos"><div id="iconPromptPos" aria-hidden="true"></div><p class="txtLarge" id="txtAttCouponPromptPos"></p></div>\n                            <p class="txtLarge" id="txtAttCouponTitlePos" role="heading" aria-level="2" style="font-size: 20px;"></p>\n                            <div id="btnColorfulPos"><button class="txtMedium" id="btnContinueShoppingPos"></button></div>\n                        </div>\n                        <div id="divOverlayResultExpressCheckoutPositive" class="divOverlayHide" style="margin-top:17px;">\n                            <div id="divOverlayResultCheckoutTitle">\n                                <p class="txtSmall txtOverlayResultPositive" id="txtECPositiveHeader" style="line-height:24px;color:rgba(0, 0, 0, 0.83);" role="heading" aria-level="1"></p>\n                            </div>\n                            <div id="divOverlayResultCheckoutDetails">\n                                <svg style="margin:auto; margin-top:10px; margin-bottom:5px" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n                                <rect x="1" y="8" width="30" height="16" rx="1" fill="#1F65F1"/>\n                                <rect x="1" y="10" width="30" height="3" fill="#1243A6"/>\n                                <rect x="2" y="14" width="14" height="4" rx="1" fill="#F5F5F5"/>\n                                <circle cx="24" cy="20" r="7.5" fill="white" stroke="#FFAC01"/>\n                                <path d="M21.5947 20.2495L20.3906 20.4561L21.2344 21.4624L20.6104 21.8931L19.96 20.7505L19.3096 21.8931L18.6812 21.4624L19.5293 20.4561L18.3208 20.2495L18.5713 19.5464L19.7007 19.999L19.5601 18.6982H20.3599L20.2192 19.999L21.3486 19.5464L21.5947 20.2495ZM25.5059 20.2495L24.3018 20.4561L25.1455 21.4624L24.5215 21.8931L23.8711 20.7505L23.2207 21.8931L22.5923 21.4624L23.4404 20.4561L22.2319 20.2495L22.4824 19.5464L23.6118 19.999L23.4712 18.6982H24.271L24.1304 19.999L25.2598 19.5464L25.5059 20.2495ZM29.417 20.2495L28.2129 20.4561L29.0566 21.4624L28.4326 21.8931L27.7822 20.7505L27.1318 21.8931L26.5034 21.4624L27.3516 20.4561L26.1431 20.2495L26.3936 19.5464L27.5229 19.999L27.3823 18.6982H28.1821L28.0415 19.999L29.1709 19.5464L29.417 20.2495Z" fill="#1F65F1"/>\n                                <path d="M3 20H7" stroke="#F5F5F5" stroke-linecap="round"/>\n                                <path d="M3 22H6" stroke="#F5F5F5" stroke-linecap="round"/>\n                                </svg>\n                                <p class="txtSmall"\n                                    id="txtResultPositiveCheckoutCvv" style="margin-left:3px;color: rgba(0, 0, 0, 0.55);"></p>\n                            </div>\n                        </div>\n                        <div id="divOverlayShare" class="divOverlayHide" role="group" aria-labelledby="txtOverlayShare">\n                        <p id="txtOverlayShare" class="divOverlayInlineShow"></p>\n                        <button id="btnOverlayShareFB" class="btnSocialSharing divOverlayHide"></button>\n                        <button id="btnOverlayShareTwitter" class="btnSocialSharing divOverlayHide"></button>\n                        <button id="btnOverlayShareWhatsapp" class="btnSocialSharing divOverlayHide"></button>\n                        <button id="btnOverlayShareClipboard" class="btnSocialSharing divOverlayHide">\n                            <div id="txtCopyToClipboard" class="showMessage copyInfoTxtMargin">\n                                <p class="copyInfoTxtMargin">Copied link to clipboard</p>\n                            </div>\n                        </button>\n                        </div>\n                        <div id="divJoinRebates" class="divOverlayHide">\n                        <hr class="hrDivider"></hr>\n                        </div>\n                        <div id="divImportBrowser" class="divOverlayHide">\n                        <hr class="hrDivider"></hr>\n                        </div>\n                        ${this.GetReceiptScannerBanner()}\n                    </div>\n                    <video aria-hidden="true" name="media" class="vdoAutoApply"><source id="vdoResultPositive" type="video/mp4"></video>\n                    <img aria-hidden="true" id="imgAutoApply" style="display: none;" />\n                </div>\n            </div>\n            ${this.GetResultNegativeContainer()}\n            ${this.GetNegativeCashbackUpsellContainer()}\n            <div class="resultWrapper">\n                <div class="overlayContent" id="divOverlayResultError">\n                    <p class="txtLarge" id="txtResultErrorTitle" role="heading" aria-level="1"></p>\n                    <p class="txtMedium" id="txtResultErrorDetails" style="margin-top: 15px; width: calc(100% - 100px); font-size: 16px; line-height: 24px; text-align: center; color: rgba(121, 121, 121, 0.55);"></p>\n                </div>\n            </div>\n            ${this.GetShortcircuitResultContainer()}\n            ${this.GetResultNegativeUpsellRewardsContainer()}\n            ${this.GetBNPLTotalAmountContainer()}\n        </div>\n        ${this.GetOverlayFooter()}\n        ${this.GetBNPLTotalAmountFooter()}\n    </div></div>`}}(uo.GetPlatformInstance())),(0,a.Z)(uo,"applicatorStateService",new class{constructor(e){(0,a.Z)(this,"platformSpecific",void 0),(0,a.Z)(this,"CouponApplicatorUIStateKey","CouponApplicatorUIState"),(0,a.Z)(this,"couponApplicatorState",void 0),this.platformSpecific=e,this.couponApplicatorState=null}LoadCouponApplicatorState(){return new Promise(((e,t)=>{this.couponApplicatorState?e(this.couponApplicatorState):(this.SaveCouponApplicatorState(null),e(null))}))}SaveCouponApplicatorState(e){this.couponApplicatorState=e;let i="";e&&(i=e.ToString());const o=[i];t.a.postMessageToHost(u.SetAutoApplyState,o)}async GetUIState(e){return new Promise(((t,i)=>{this.platformSpecific.ReadFromStorage(this.CouponApplicatorUIStateKey,(i=>{if(i&&i[this.CouponApplicatorUIStateKey]){let o=Pt.CreateFromObject(i[this.CouponApplicatorUIStateKey]);if(!o||o.Hostname!==e){o=Pt.CreateNew(e);const t={[this.CouponApplicatorUIStateKey]:o};this.platformSpecific.WriteToStorage(t)}t(o)}else{const i=Pt.CreateNew(e),o={[this.CouponApplicatorUIStateKey]:i};this.platformSpecific.WriteToStorage(o),t(i)}}))}))}async SaveUIState(e){const t={[this.CouponApplicatorUIStateKey]:e};this.platformSpecific.WriteToStorage(t)}}(uo.GetPlatformInstance())),(0,a.Z)(uo,"logService",new class extends ei{constructor(e,t){super(e),(0,a.Z)(this,"applicatorService",void 0),(0,a.Z)(this,"buildVersion",void 0),this.applicatorService=t,this.buildVersion=_e.Z.GetBuildVersion()}async LogClientEventV2(e,i,o,a,r){let n="";if(r)n=r;else{const e=await this.applicatorService.LoadCouponApplicatorState();e?.ImpressionId&&(n=e.ImpressionId)}const s=new Jt.Z(this.platformSpecific.GetAppInfoClientName(),this.platformSpecific.GetVersion(),this.buildVersion,_e.Z.enabledServiceFlights),c=[new Xt(e,i,a.ToString(),o,n,s).ToString()];t.a.postMessageToHost(u.LogScriptTelemetry,c)}async Flush(){}}(uo.GetPlatformInstance(),uo.GetApplicatorStateService())),(0,a.Z)(uo,"overlayService",new class extends bt{constructor(e,t,i,o){super(e),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"uxDataService",void 0),(0,a.Z)(this,"entryPointService",void 0),this.logService=t,this.uxDataService=i,this.entryPointService=o}async OpenExpressCheckoutOverlay(t,i,o){if(this.EntryPointIsWallet())return this.WalletDrawerCreateOverlay(t);const a=await this.GetUXData(e.k2.ECOverlay);if(a){const r=this.uxDataService.GetUXStyles(e.k2.ECOverlay);await this.CloseOverlay(t),await this.SendDomMessage(t,new Gi(t,r||"",a,i,o),"ECCreateOverlay",!0)}}async OpenExpressCheckoutUpdatePaymentOverlay(t){if(this.EntryPointIsWallet())return this.WalletDrawerCreateOverlay(t);const i=await this.GetUXData(e.k2.ECOverlay);if(i){const o=this.uxDataService.GetUXStyles(e.k2.ECOverlay);await this.CloseOverlay(t),await this.SendDomMessage(t,new Vi(t,o||"",i),"ECCreateUpdatePaymentOverlay",!0)}}async OpenPrintableGroceryCouponsOverlay(e,t){await this.SendDomMessage(e,new $i(e,t),"Printable Grocery Coupons",!0)}async OpenInstantAddToCartOverlay(e,t){await this.SendDomMessage(e,new Xi(e,t),"InstantAddToCart",!0)}async OpenSuccessInstantAddToCartOverlay(e,t){await this.SendDomMessage(e,new to(e,t),"InstantAddToCart",!0)}async ShowExpressCheckoutResult(e,t,i,o,a,r,n){await this.SendDomMessage(e,new Ki(t,i,o,a,r,n),"ECShowResults",!0)}async OpenOverlay(t,i,o,a,r,n,s){if(this.EntryPointIsWallet())return this.WalletDrawerCreateOverlay(t);const c=await this.GetUXData(e.k2.Overlay);c&&(await this.CloseOverlay(t),await this.CreateOverlay(t,i,o,c,a,r,n,s))}async MoveProgressBar(e,t,i){if(i>0){const o=this.GetPositions(t,i);await this.SendDomMessage(e,new Ct(o[0],o[1]),"Progress Bar Update",!0)}}async ShowResult(t,i,o,a,r,n,s,c,l,u,d,h,p,g){const C=this.platformSpecific.GetAppInfoClientName(),S=r.BestCoupon?.couponCode,m=r.BestCoupon?.isStackable??!1,A=r.InitialPrice,f=r.MaxDiscount,v=r?.Metadata;let E=[];r.CouponResults&&(E=r.CouponResults),dt.IS.includes(C)||C===e.BN.Sapphire?await this.SendDomMessage(t,new Yi(i,f,A,S,n,m,c,u,g),"Show Result Page",!0):await this.SendDomMessage(t,new ji(i,f,A,S,m),"Show Result Page",!0);const P=r.StartTime?Date.now()-r.StartTime:-1,I=new pt.Z(o,this.entryPointService.GetEntryPoint());let T=i,O=f??0;if(i===e.ps.Error&&u){const t=c[0];(t?.discountValue||A&&t?.discountPercent)&&(T=e.ps.Positive,O=t?.discountValue??t?.discountPercent*A/100??0)}let y=a;d&&(y+=di.AutoTriggered),I.SetResultData(T,P,S,E,O,A??0,m,s,l,h,p,v),I.SetCurrencyInfo(r.Currency,r.PageCurrency);const D=e.R.AutoApply,b=e.in.Information;this.logService.LogClientEventV2(b,D,y,I)}async UpdateCurrentCoupon(e,t,i,o,a,r){await this.SendDomMessage(e,new mt(t,i,o,a,r),"Update Current Coupon",!0)}async UpdateCurrency(e,t){await this.SendDomMessage(e,new oo(t),"Update Currency",!0)}async OverlayVisible(e){return await this.IsFieldVisible(e,"#divOverlayWrapper","Check overlay visible")}async UpdateCheckoutProgress(e,t){await this.SendDomMessage(e,new Ui(t),"AutoapplyDone",!1)}async CloseOverlay(e){await this.SendDomMessage(e,new Li,"Close Coupons Overlay",!1)}GetPositions(e,t){const i=100/t;return[i*e,i*(e+1)]}async CloseWalletDrawer(e,t){await this.SendDomMessage(e,new ro(t),"Stop Wallet Drawer Auto Apply and Autofill",!1)}async SkipCouponAutoApply(e){await this.SendDomMessage(e,new lo,"Stop Wallet Drawer Auto Apply and Autofill",!1)}async WalletDrawerCreateOverlay(e){return this.SendDomMessage(e,new so(e),"Wallet Drawer Create Overlay",!0)}async SendDomMessage(t,i,o,a){const r=[e.Vm.WalletDrawerCreateOverlayMessage,e.Vm.CloseOverlayMessage,e.Vm.WalletDrawerCloseMessage,e.Vm.WalletDrawerSkipCouponMessage,e.Vm.AutoApplyCancelledMessage,e.Vm.MoveProgressBarMessage];return this.EntryPointIsWallet()&&!r.includes(i.Type)?new ie:super.SendDomMessage(t,i,o,a)}EntryPointIsWallet(){return this.entryPointService.GetEntryPoint()===e.N9.Wallet}async CreateOverlay(t,i,o,a,r,n,s,c){const l=this.GetPositions(s,o),u=this.platformSpecific.GetAppInfoClientName();if(dt.IS.includes(u)||u===e.BN.Sapphire){const u=this.uxDataService.GetUXStyles(e.k2.Overlay);await this.SendDomMessage(t,new zi(t,i,s+1,o,l[0],l[0],a,r,u||"",n,c),"Edge Create Overlay",!0)}else await this.SendDomMessage(t,new Fi(t,i,s+1,o,l[0],l[0],r,a),"Create Overlay",!0)}async GetUXData(e,t){return this.uxDataService.GetUX(e,t)}}(uo.GetPlatformInstance(),uo.GetLogService(),uo.GetUXDataService(),uo.GetEntryPointService())),(0,a.Z)(uo,"backgroundMessagingService",new class extends _i{constructor(e,t){super(e),(0,a.Z)(this,"entryPointService",void 0),this.entryPointService=t}async HandleMessage(t){const i=t,o=i.Type,a=new ie;if(o===e.Vm.EdgeApplyCouponsMessage){const t=i,o=t.checkoutPageData,a=await Ri.GetInstance().GetUIState(t.ContextID,t.Hostname,t.checkoutPageData);let r=!1;if(a&&a.HasState(vt.AutoApplyCancelled)&&(r=!0),t.startNew){const i=new pt.Z(t.checkoutPageData.retailerData.domainName,this.entryPointService.GetEntryPoint());i.AutoApplyScenario=ho.GetBackgroundAutoApplyService().GetAutoApplyScenario(),this.logService.LogClientEventV2(e.in.Information,e.R.AutoApply,"Auto Apply Initiated",i,o.impressionId)}Ri.GetInstance().ApplyCoupons(t.ContextID,o,t.startNew,r)}else if(o===e.Vm.UpdateRewardsData){const e=i,t=e.rewardsData;Ri.GetInstance().UpdateRewardsData(e.ContextID,t)}else{if(o!==e.Vm.BackgroundAutoApplyCancelledMessage)return super.HandleMessage(i);{const e=ho.GetBackgroundAutoApplyService();ho.GetBroadcastChannelService().setOnMessageEventHandler((t=>{e.BackgroundAutoApplyCancelHandler(t)})),e.SendCancelMesssageToBgAutoApply();const t=i;super.HandleMessage(new tt(t.ContextID,t.Hostname,t.Pathname))}}return a}}(uo.GetLogService(),uo.GetEntryPointService())),(0,a.Z)(uo,"walletDrawerService",new class extends bt{constructor(t,i,o){super(t),(0,a.Z)(this,"contextID",void 0),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"localDataService",void 0),this.contextID=e.og.FromBackground,this.overlayService=i,this.localDataService=o}async HandleMessageFromHost(e,t){if(e===g.CloseWalletCheckoutPane&&this.StopWalletDrawer(),e===g.SkipCouponAutoApply&&this.SkipCouponAutoApply(),e===g.RemoveAppliedCoupon){const e=this.localDataService.GetLocalData(Ne.Q.ApiResponse),t=L.Create(e);t?.retailerData?.UpdateCurrentCheckoutPage(location.pathname);const i=t?.retailerData?.GetCurrentCheckoutPage();let o=i?.removeCouponButtonSelector;if(o){let e="";const t=o.split(";");2===t.length&&(e=t[0],o=t[1]),await this.IsFieldVisible(this.contextID,e,"Click before remove visible")&&(await this.IsFieldVisible(this.contextID,o,"Remove coupon")||await this.SendDomMessage(this.contextID,new lt(Ce.Click,e,""),"click before remove",!1)),await this.IsFieldVisible(this.contextID,o,"Remove coupon")&&await this.SendDomMessage(this.contextID,new lt(Ce.Click,o,""),"remove coupon",!1)}}if(e===g.PassDynamicSelectors){const e=t&&JSON.parse(t);this.localDataService.SaveLocalData(Ne.Q.DynamicSelectors,e)}}async ShowWalletOverlay(){this.overlayService.WalletDrawerCreateOverlay(this.contextID)}async StopWalletDrawer(){return this.overlayService.CloseWalletDrawer(this.contextID,!0)}async SkipCouponAutoApply(){return this.overlayService.SkipCouponAutoApply(this.contextID)}}(uo.GetPlatformInstance(),uo.GetOverlayService(),uo.GetLocalDataService())),(0,a.Z)(uo,"checkoutService",new class extends bt{constructor(t,i,o,r,n,s){super(t),(0,a.Z)(this,"localDataService",void 0),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"entryPointService",void 0),(0,a.Z)(this,"contextId",void 0),(0,a.Z)(this,"expressCheckoutState",void 0),(0,a.Z)(this,"startTime",void 0),(0,a.Z)(this,"domainName",void 0),(0,a.Z)(this,"ccResponseMap",void 0),(0,a.Z)(this,"ccwaitingguids",void 0),(0,a.Z)(this,"allowedIfameOrigins",void 0),(0,a.Z)(this,"iframeEventHandler",void 0),(0,a.Z)(this,"selectorsNotFound",void 0),this.localDataService=i,this.overlayService=o,this.edgeMessageService=r,this.logService=n,this.entryPointService=s,this.contextId=e.og.FromBackground,this.expressCheckoutState=new Gt,this.ccResponseMap=new Map,this.ccwaitingguids=new Set,this.allowedIfameOrigins=new Set,this.iframeEventHandler=this.IframeEventHandler.bind(this),this.selectorsNotFound=[]}async StartExpressCheckout(){await this.StartExpressCheckoutAsync().catch((async e=>{e&&e.ErrorName===Me.ECCancelled?(this.LogECEvent(Ut.Cancelled),this.edgeMessageService.SendExpressCheckoutClosedMessage()):e&&(e.ErrorName===Me.Refresh&&await m.ZP.WaitForCondition((async()=>"true"===(0,Ft.Mw)(`${Ne._.StopRefreshTimeout}_${e.ErrorPageType}`)),8e3,1e3)?(0,Ft.TJ)(`${Ne._.StopRefreshTimeout}_${e.ErrorPageType}`):await this.HandleError(e))}))}async HandleError(t){if(this.expressCheckoutState.CheckoutProgress=V.FieldError,this.LogECEvent(Ut.Error,JSON.stringify(t)),this.edgeMessageService.SendExpressCheckoutErrorMessage(),this.EntryPointIsWallet()){const i=JSON.stringify({ErrorMsg:t.ErrorMsg,ErrorName:t.ErrorName,ErrorPageType:t.ErrorPageType,ErrorSource:e.N9.Wallet,SelectorsNotFound:this.selectorsNotFound});this.edgeMessageService.SendEdgeDriverStateChangeMessage(Me.AutofillFail,JSON.stringify({reason:i})),await this.overlayService.CloseWalletDrawer(this.contextId)}await this.overlayService.ShowExpressCheckoutResult(this.contextId,!0,this.expressCheckoutState.IsAutoApplyIncluded,this.expressCheckoutState.CouponApplicatorState?.BestCoupon,this.expressCheckoutState.CouponApplicatorState?.InitialPrice,this.expressCheckoutState.CouponApplicatorState?.MaxDiscount,this.expressCheckoutState.CheckoutProgress)}async StartExpressCheckoutAsync(){this.startTime=Date.now();const t=this.localDataService.GetLocalData(Ne.Q.CheckoutElementsData);this.domainName=t.DomainName;const i=this.localDataService.GetLocalData(Ne.Q.ExpressCheckoutState);i?this.expressCheckoutState=i:(this.LogECEvent(Ut.Start),this.expressCheckoutState.IsAutoApplyIncluded=!1,this.expressCheckoutState.CouponApplicatorState=null,this.expressCheckoutState.CheckoutProgress=void 0),await this.overlayService.OpenExpressCheckoutOverlay(this.contextId,this.expressCheckoutState.IsAutoApplyIncluded,this.expressCheckoutState.CheckoutProgress),this.edgeMessageService.SendExpressCheckoutStartMessage(),await this.ApplyCheckoutUserData(e.og.FromBackground,t),this.edgeMessageService.SendExpressCheckoutCompletedMessage(),this.LogECEvent(Ut.Success),this.overlayService.ShowExpressCheckoutResult(this.contextId,!0,this.expressCheckoutState.IsAutoApplyIncluded,this.expressCheckoutState.CouponApplicatorState?.BestCoupon,this.expressCheckoutState.CouponApplicatorState?.InitialPrice,this.expressCheckoutState.CouponApplicatorState?.MaxDiscount,this.expressCheckoutState.CheckoutProgress)}async ApplyCheckoutUserData(t,i){const o=this.localDataService.GetLocalData(Ne.Q.CheckoutUserData),{IsSkipPayment:a,IsSkipProfile:r}=o,n=i?.AllPageTypeArr,s=this.getPagesObj(t,i,o),c=n?.map((e=>s[e]?.Category));let l=0;if(this.expressCheckoutState.CheckoutProgress){const t=n.find((e=>s[e]?.checkoutProgress===this.expressCheckoutState.CheckoutProgress));t&&((0,Ft.Xo)(`${Ne._.StopRefreshTimeout}_${t}`,"true"),l=n.indexOf(t),l===c.lastIndexOf("Shipping")&&a&&(await this.overlayService.UpdateCheckoutProgress(e.og.FromBackground,V.AddressDone),this.EntryPointIsWallet()&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AddressDone)),l++)}for(;l<n.length;l++){const i=n[l];if(!s[i])continue;const{Category:o,UpdatePage:u}=s[i];"Shipping"===o&&r||"Payment"===o&&a||(l===c.lastIndexOf("Shipping")?await u((async t=>{t&&"true"===t.Value?.toString()&&a||(await this.overlayService.UpdateCheckoutProgress(e.og.FromBackground,V.AddressDone),this.EntryPointIsWallet()&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.AddressDone))})):l===c.lastIndexOf("Payment")?await u((async()=>{await this.overlayService.UpdateCheckoutProgress(t,V.PaymentDone),this.EntryPointIsWallet()&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.PaymentDone)})):await u())}this.EntryPointIsWallet()&&await this.overlayService.CloseWalletDrawer(t)}async UpdatePaymentDetails(e,t,i){const o=t.AllcheckoutCompletionPages.get(Vt.PaymentIframe);t.AllcheckoutCompletionPages.get(Vt.Payment)&&await this.UpdatePaymentCardDetails(e,t,i),o&&await this.UpdatePaymentIframeDetails(e,t,i)}async UpdatePaymentCardDetails(e,t,i,o){const a=t.AllcheckoutCompletionPages.get(Vt.Payment),r=i.Profile,n=r?.Email??"";if(a?.CheckoutElements&&i.Payment){const t=i.Payment,r=a.CheckoutElements.get("WaitBeforePayment");r&&await m.ZP.Sleep(Number(r.Value));const s=a.CheckoutElements.get("clickBefore");s&&await this.ClickButtonWithWaiting(e,s,"Payment",void 0,void 0,void 0,2e3);const c=a.CheckoutElements.get("fillClickBefore");c&&await this.ClickButtonWithWaiting(e,c,"Payment");const l=a.CheckoutElements.get("fillClickBefore2");l&&await this.ClickButtonWithWaiting(e,l,"Payment");const u=a.CheckoutElements.get("visible");u&&await this.SendCheckoutDomMessage(e,new lt(Ce.Display,u.Value,""),"Visible",!1);const d=a.CheckoutElements.get("cardNumber");if(d){if(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,d.Value,"cardNumber FieldVisible")),d.WaitForVisible||8e3),!await this.IsFieldVisible(e,d.Value,"cardNumber FieldVisible"))throw this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(d,"Payment")),new Mt.Z("cardNumber field is not visible",Me.ExecutionError,Vt.Payment);await this.SendCheckoutDomMessage(e,new lt(Ce.SetBoxValue,d.Value,t.CardNumber),"cardNumber",!1)}const h=a.CheckoutElements.get(Ht.CardType);h&&(await this.GetElementAndSetValue(a,Ht.CardType,t.CardType,"CardType","Payment"),await this.GetFieldValue(h?.Value)!==t.CardType&&await this.AgainFillSpecifiedFields(h,t.CardType)),await this.GetElementAndSetValue(a,Ht.Name,t.FullName,"Card Name","Payment"),await this.GetElementAndSetValue(a,Ht.FirstName,t.FirstName,"Card First Name","Payment"),await this.GetElementAndSetValue(a,Ht.MiddleName,t.MiddleName,"Card Middle Name","Payment"),await this.GetElementAndSetValue(a,Ht.LastName,t.LastName,"Card Last Name","Payment");const p=a.CheckoutElements.get(Ht.ExpiryMonth);if(p){const e=p.Format||"MM",i=this.GetFormattedExpiryDate(t,Wt.Month,e),o=a.CheckoutElements.get("expiryMonthConfirm");o?await this.OtherTagNameExpiryField(p?.Value,i,o?.Value):(await this.SetValue(p,i,"expiryMonth","Payment"),await this.GetFieldValue(p?.Value)!==i&&await this.AgainFillSpecifiedFields(p,i))}const g=a.CheckoutElements.get(Ht.ExpiryYear);if(g){const e=g.Format||"YYYY",i=this.GetFormattedExpiryDate(t,Wt.Year,e),o=a.CheckoutElements.get("expiryYearConfirm");o?await this.OtherTagNameExpiryField(g?.Value,i,o?.Value):(await this.SetValue(g,i,"expiryYear","Payment"),await this.GetFieldValue(g?.Value)!==i&&await this.AgainFillSpecifiedFields(g,i))}const C=a.CheckoutElements.get(Ht.ExpiryDate);if(C){let e="MM/YYYY";C.Format&&(e="1"===C.Format?"MM/YY":C.Format);const i=this.GetFormattedExpiryDate(t,Wt.MonthYear,e);await this.SetValue(C,i,"expiryDate","Payment")}await this.GetElementAndSetValue(a,Ht.Email,n,"Email update","Payment"),await this.GetElementAndSetValue(a,Ht.ConfirmEmail,n,"Confirm Email","Payment");const S=a.CheckoutElements.get("securityCode"),A=t.CardCVC;S&&A&&await this.SetValue(S,A,"securityCode","Payment");const f=a?.CheckoutElements.get(Ht.Continue);f&&await this.ClickButtonWithWaiting(e,f,"Payment",1e3,1e3);const v=a.CheckoutElements.get(Ht.FieldError);v&&v.Value&&await this.IsFieldVisible(e,v.Value,"Update payment details")&&await this.CheckAndThrowError(v,"updating payment",J.FieldError,Me.ECFieldError,Vt.ContactInfo),o&&o()}}async UpdateBillingAddressDetails(e,t,i,o){const a=i?.Profile;this.EntryPointIsWallet()&&a&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.BillingAddressStart);try{const i=t.AllcheckoutCompletionPages.get(Vt.BillingAddress);if(i?.CheckoutElements){const t=i?.CheckoutElements.get("WaitBeforeBillingAddress");t&&await m.ZP.Sleep(Number(t.Value));const r=i.CheckoutElements.get(Ht.RefreshAfterContinue);r&&"true"===r.Value?.toString()&&(0,Ft.Xo)(`${Ne._.StopRefreshTimeout}_${Vt.BillingAddress}`,"false");const n=i?.CheckoutElements.get("clickBefore");n&&await this.ClickButtonWithWaiting(e,n,"BillingAddress");const s=i?.CheckoutElements.get("useDifferentAddress"),c=i?.CheckoutElements.get("useShippingAddress"),l=i?.CheckoutElements.get("useDifferentAddressLabel"),u=i?.CheckoutElements.get("useShippingAddressLabel");"inputRadio"===s?.Type&&"inputRadio"===c?.Type&&l&&u?await this.ChangeUseDifferentAddrUseShippingAddr(s,l,c,u,a):(s&&await this.ChangeUseDifferentAddressCheckedStatus(s,l,a,e),c&&await this.ChangeUseShippingAddressCheckedStatus(c,u,a,e));const d=i?.CheckoutElements.get("fillClickBefore");d&&await this.ClickButtonWithWaiting(e,d,"BillingAddress");const h=i?.CheckoutElements.get("fillClickBefore2");if(h&&await this.ClickButtonWithWaiting(e,h,"BillingAddress"),a){const t=i.CheckoutElements.get(Ht.Address1);if(t){const o=t.WaitBefore;if(o&&await m.ZP.Sleep(o),await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,t.Value,"IsAddress FieldVisible")),t.WaitForVisible||8e3),!await this.IsFieldVisible(e,t.Value,"IsAddress FieldVisible")&&(this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(t,"BillingAddress")),!t.NotAlwaysShown))throw new Mt.Z("Address1 field is not visible",Me.ExecutionError,Vt.BillingAddress);const r=this.GetProfileData(a,Ht.Address1);r&&await this.TypeCheckoutFieldData(t.Value,r);const n=i.CheckoutElements.get("address1Confirm");n&&await this.ClickButtonWithWaiting(e,n,"BillingAddress",2e3,2e3,void 0,2e3)}await this.FillCheckoutElements(e,i,a,Kt.First,Vt.BillingAddress),await this.FillCheckoutElements(e,i,a,Kt.Second,Vt.BillingAddress);const o=i?.CheckoutElements.get("sameShippingAddress"),r=i?.CheckoutElements.get("sameShippingAddressLabel");if(o&&"checkBox"===o.Type&&r){const e=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,o.Value,"",J.CheckedValue),"get sameShippingAddress checked value",!1);e?.CheckedValue&&await this.Click(r.Value,J.Continue)}const n=i?.CheckoutElements.get("differentShippingAddress"),s=i?.CheckoutElements.get("differentShippingAddressLabel");if(n)if("checkBox"===n.Type&&s){const e=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,n.Value,"",J.CheckedValue),"get differentShippingAddress checked value",!1);e?.CheckedValue||await this.Click(s.Value,J.Continue)}else await this.Click(n.Value,J.Continue)}this.expressCheckoutState.CheckoutProgress=V.BillingAddressDone,this.edgeMessageService.SaveExpressCheckoutStatus(this.expressCheckoutState);const p=i?.CheckoutElements.get("continue");p&&await this.ClickButtonWithWaiting(e,p,"BillingAddress",3e3,3e3);const g=i.CheckoutElements.get("confirm");g&&g.Value&&await this.ClickButtonWithWaiting(e,g,"BillingAddress",2e3,2e3,void 0,2e3);const C=i?.CheckoutElements.get(Ht.Continue2);C&&await this.ClickButtonWithWaiting(e,C,"ShippingAddress",8e3,3e3,void 0,1e3);const S=i?.CheckoutElements.get(Ht.FieldError);if(S&&S.Value&&await this.IsFieldVisible(e,S.Value,"Update Billing Address")&&await this.CheckAndThrowError(S,"updating billing address",J.FieldError,Me.ECFieldError,Vt.ContactInfo),this.EntryPointIsWallet()&&a&&this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.BillingAddressSuccess),o&&o(),r&&"true"===r.Value?.toString())throw new Mt.Z("error at updating billing adrress",Me.Refresh,Vt.BillingAddress)}}catch(e){if(!this.EntryPointIsWallet()||!a||e.ErrorName===Me.Refresh)throw e;this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.BillingAddressFail),o&&o()}}getPagesObj(e,t,i){return{[Vt.ContactInfo]:{Category:"Shipping",UpdatePage:async o=>{await this.UpdateContactDetails(e,t,i,o)},checkoutProgress:V.ContactInfoDone},[Vt.ShippingAddress]:{Category:"Shipping",UpdatePage:async o=>{await this.UpdateShippingAddressDetails(e,t,i,o)},checkoutProgress:V.ShippingAddressDone},[Vt.ShippingOptions]:{Category:"Shipping",UpdatePage:async i=>{await this.UpdateShippingOptions(e,t,i)},checkoutProgress:V.ShippingOptionsDone},[Vt.Payment]:{Category:"Payment",UpdatePage:async o=>{await this.UpdatePaymentCardDetails(e,t,i,o)}},[Vt.PaymentIframe]:{Category:"Payment",UpdatePage:async o=>{await this.UpdatePaymentIframeDetails(e,t,i,o)}},[Vt.BillingAddress]:{Category:"Payment",UpdatePage:async o=>{if(this.EntryPointIsWallet()){const a=i?.Payment?.Address;let r;a&&(r=new W,r.Profile=a),await this.UpdateBillingAddressDetails(e,t,r,o)}},checkoutProgress:V.BillingAddressDone}}}async ChangeUseDifferentAddrUseShippingAddr(e,t,i,o,a){if(a){const i=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,e.Value,"",J.CheckedValue),"get useDifferentAddress checked value",!1);i?.CheckedValue||await this.Click(t.Value,J.Continue)}else{const e=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,i.Value,"",J.CheckedValue),"get useShippingAddress checked value",!1);e?.CheckedValue||await this.Click(o.Value,J.Continue)}}async ChangeUseDifferentAddressCheckedStatus(e,t,i,o){if("checkBox"===e.Type&&t){const a=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,e.Value,"",J.CheckedValue),"get useDifferentAddress checked value",!1),r=a?.CheckedValue??"";(r&&!i||!r&&i)&&await this.IsFieldVisible(o,t.Value,`is ${t.Name} visible`)&&await this.Click(t.Value,J.Continue)}else i&&await this.IsFieldVisible(o,e.Value,`is ${e.Name} visible`)&&await this.Click(e.Value,J.Continue)}async ChangeUseShippingAddressCheckedStatus(e,t,i,o){if("checkBox"!==e.Type&&"input"!==e.Type||!t)i||await this.IsFieldVisible(o,e.Value,`is ${e.Name} visible`)&&await this.Click(e.Value,J.Continue);else{let a;if("checkBox"===e.Type){const t=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,e.Value,"",J.CheckedValue),"get useShippingAddress checked value",!1);a=t?.CheckedValue??""}else a="true"===await this.GetFieldValue(e.Value);(a&&i||!a&&!i)&&await this.IsFieldVisible(o,t.Value,`is ${t.Name} visible`)&&await this.Click(t.Value,J.Continue)}}async ChangeUseDifferFromBillingAddrUseBillingAddr(e,t){const i=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,e.Value,"",J.CheckedValue),"get useDifferentFromBillingAddress checked value",!1);i?.CheckedValue||await this.Click(t.Value,J.Continue)}async ChangeUseDifferentFromBillingAddressCheckedStatus(e,t,i){if("checkBox"===e.Type&&t){const o=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,e.Value,"",J.CheckedValue),"get useDifferentFromBillingAddress checked value",!1);o?.CheckedValue||await this.IsFieldVisible(i,t.Value,`is ${t.Name} visible`)&&await this.Click(t.Value,J.Continue)}else await this.IsFieldVisible(i,e.Value,`is ${e.Name} visible`)&&await this.Click(e.Value,J.Continue)}async ChangeUseBillingAddressCheckedStatus(e,t,i){if("checkBox"===e.Type&&t){const o=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,e.Value,"",J.CheckedValue),"get useBillingAddress checked value",!1);o?.CheckedValue&&await this.IsFieldVisible(i,t.Value,`is ${t.Name} visible`)&&await this.Click(t.Value,J.Continue)}}EntryPointIsWallet(){return this.entryPointService.GetEntryPoint()===e.N9.Wallet}async GetElementAndSetValue(e,t,i,o,a){const r=e.CheckoutElements.get(t);r&&this.SetValue(r,i,o,a)}async SetValue(e,t,i,o){e.WaitForVisible&&await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(this.contextId,e.Value,`is ${e.Name} visible`)),e.WaitForVisible),await this.IsFieldVisible(this.contextId,e.Value,`is ${e.Name} visible`)?await this.SendCheckoutDomMessage(this.contextId,new lt(Ce.SetBoxValue,e.Value,t),i,!1):this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(e,o))}getECTypeMetrics(){const{BNPLProvider:t,IsSkipPayment:i}=this.localDataService.GetLocalData(Ne.Q.CheckoutUserData),o=i&&!t;return t?e.qR.ECWithBNPL:o?e.qR.ECWithoutPayment:e.qR.ExpressCheckout}LogECEvent(t,i){const o=new xt(t,this.entryPointService.GetEntryPoint()),a=void 0!==this.startTime?Date.now()-this.startTime:0;o.ECProcessTime=a,o.Domain=this.domainName,o.ECType=this.getECTypeMetrics(),this.logService.LogClientEventV2(e.in.Information,e.R.ExpressCheckout,i??"",o)}async UpdateContactDetails(e,t,i,o){const a=t.AllcheckoutCompletionPages.get(Vt.ContactInfo),r=a?.CheckoutElements.get("WaitBeforeContactInfo");r&&await m.ZP.Sleep(Number(r.Value));const n=a?.CheckoutElements.get(Ht.ClickBefore);n&&await this.ClickButtonWithWaiting(e,n,"ContactInfo");const s=a?.CheckoutElements.get(Ht.Email);if(s&&s.Value&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,s.Value,`is ${s.Name} visible`)),s.WaitForVisible||8e3),await this.IsFieldVisible(e,s.Value,"is Shipping Visible"))){const t=a?.CheckoutElements.get(Ht.RefreshAfterContinue);if(t&&"true"===t.Value?.toString()&&(0,Ft.Xo)(`${Ne._.StopRefreshTimeout}_${Vt.ContactInfo}`,"false"),a?.CheckoutElements&&i.Profile){const r=i.Profile;for(const t of a.CheckoutElements.keys()){const i=a.CheckoutElements.get(t);if(i){const t=this.GetProfileData(r,i.Name,i.Format);"input"!==i.Type&&"dropdown"!==i.Type||!t||(i.WaitForVisible&&await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,i.Value,`is ${i.Name} Visible`)),i.WaitForVisible),await this.IsFieldVisible(e,i.Value,`is ${i.Name} Visible`)?await this.TypeCheckoutFieldData(i.Value,t):this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(i,"ContactInfo")))}}const n=a.CheckoutElements.get(Ht.Signup);n&&n.Value&&"disableCheckBox"===n.Type&&await this.SendDomMessage(e,new lt(Ce.SetCheckBox,n.Value,"false"),"disable signup",!1),this.expressCheckoutState.CheckoutProgress=V.ContactInfoDone,this.edgeMessageService.SaveExpressCheckoutStatus(this.expressCheckoutState);const s=a?.CheckoutElements.get(Ht.Continue);s&&await this.ClickButtonWithWaiting(e,s,"ContactInfo",8e3,3e3,void 0,2e3);const c=a.CheckoutElements.get(Ht.FieldError);c&&c.Value&&await this.IsFieldVisible(e,c.Value,"Update Contact Details")&&await this.CheckAndThrowError(c,"updating contact details",J.FieldError,Me.ECFieldError,Vt.ContactInfo);const l=a.CheckoutElements.get(Ht.FormError);if(l&&await this.IsFieldVisible(e,l.Value,"Update Contact Details")&&await this.CheckAndThrowError(l,"updating contact details",J.FormError,Me.ECFormError,Vt.ContactInfo),o&&await o(t),t&&"true"===t.Value?.toString())throw new Mt.Z("error at updating contact info",Me.Refresh,Vt.ContactInfo)}}}async GetFieldValue(e){const t=await this.SendDomMessage(this.contextId,new lt(Ce.GetFieldValue,e,"",J.FieldValue),"",!1);return t?.FieldValue??void 0}async AgainFillSpecifiedFields(e,t){const i=Pe.Z.GetFirstVisibleElement(e.Value);if("SELECT"===i?.tagName){const o=i.children,a=new Map;for(const e of o){const t=e?.innerHTML?.toUpperCase()?.trim(),i=e?.attributes?.getNamedItem("value");a.set(t,i?.value)}if([Ht.ExpiryMonth,Ht.ExpiryYear,Ht.CardType].includes(e.Name)){const i=a.get(t.toUpperCase());i&&await this.SetValue(e,i,e.Name,"Payment")}if(e.Name===Ht.State){const i=Bt();let o="";for(const e of i.keys())i.get(e)===t&&(o=a.get(e)||a.get(t));o&&await this.TypeCheckoutFieldData(e.Value,o)}if("country"===e.Name){const i=this.GetCountriesMap();let o="";const r=new Map;r.set("UNITED STATES","UNITED STATES OF AMERICA");for(const e of i.keys())if(e===t){const n=i.get(e);if(n){const e=n.get("1");e&&(o=a.get(e?.toUpperCase()?.trim())||a.get(t)||a.get(r.get(e?.toUpperCase()?.trim())))}}o&&await this.TypeCheckoutFieldData(e.Value,o)}}}async FillPhoneMultiInputs(e,t){const i=t.Value?.split(";"),o=new Map;let a=0;if(3!==i?.length)return!1;{const t=e.slice(0,3),a=e.slice(3,6),r=e.slice(6);o.set(i[0],t),o.set(i[1],a),o.set(i[2],r)}for(const e of o.keys()){await this.TypeCheckoutFieldData(e,o.get(e));const t=await this.SendDomMessage(this.contextId,new lt(Ce.GetFieldValue,e,"",J.FieldValue),"",!1),i=t?.FieldValue;i&&(a+=1)}return a===i?.length}async FillDateOfBirthField(e,t){const i=t?.Value?.split(";"),o=e.split("-");for(let e=0;e<i.length;e++)if(o[e])if(0===e)await this.TypeCheckoutFieldData(i[e],o[e]);else if(await this.TypeCheckoutFieldData(i[e],o[e]),!await this.GetFieldValue(i[e])){let t=o[e];Number(t)<10&&(t=o[e].slice(1)),await this.TypeCheckoutFieldData(i[e],t)}}async OtherTagNameExpiryField(e,t,i){await this.Click(e,J.FieldValue);const o=Pe.Z.RunQuerySelectorAll(i);for(const e of o)e?.innerText?.includes(t)&&e.click()}async OtherTagNameCountryOrStateField(e,t,i){await this.Click(e?.Value,J.FieldValue);const o=Pe.Z.RunQuerySelectorAll(i);if("country"===e?.Name){const e=this.GetCountriesMap(),i=[t],a=new Map;a.set("UNITED STATES","UNITED STATES OF AMERICA");for(const o of e.keys())t===o&&i.push(e.get(o)?.get("1")?.toUpperCase()),e.get(o)?.get("1")===t&&i.push(o);for(const e of i)a.get(e)&&i.push(a.get(e));for(const e of o)i?.includes(e?.innerText?.toUpperCase()?.trim())&&e.click()}if("state"===e?.Name){const e=Bt(),i=[t];for(const o of e.keys())e.get(o)===t&&i.push(o);for(const e of o)i?.includes(e?.innerText?.toUpperCase()?.trim())&&e.click()}}async FillCheckoutElements(e,t,i,o,a){const r=this.GetCountriesMap();for(const n of t.CheckoutElements.keys()){const s=["state","country"],c=t.CheckoutElements.get(n);if(c){const l=await this.GetFieldValue(c?.Value),u=this.GetProfileData(i,c.Name,c.Format);if("phone"===c?.Name&&c?.Value?.includes?.(";")&&u&&await this.FillPhoneMultiInputs(u,c))continue;if("dateOfBirth"===c?.Name&&u){await this.FillDateOfBirthField(u,c);continue}const d=s.includes(c.Name);if(o===Kt.First&&n===Ht.Address1||o===Kt.Second&&((d||"address1"===c.Name)&&l||!d&&"address1"!==c.Name&&l===u))continue;if(("input"===c.Type||"dropdown"===c.Type)&&u)if(c.WaitForVisible&&await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,c.Value,`is ${c.Name} Visible`)),c.WaitForVisible),await this.IsFieldVisible(e,c.Value,`is ${c.Name} Visible`)){if(await this.TypeCheckoutFieldData(c.Value,u),d){const e=await this.GetFieldValue(c?.Value),i=t.CheckoutElements.get(`${c?.Name}Confirm`);if(i){await this.OtherTagNameCountryOrStateField(c,u,i?.Value);continue}e&&r.get(e)||await this.AgainFillSpecifiedFields(c,u)}}else this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(c,a))}}}async UpdateShippingAddressDetails(e,t,i,o){const a=t.AllcheckoutCompletionPages.get(Vt.ShippingAddress);if(a?.CheckoutElements&&i.Profile){const t=i.Profile,r=a?.CheckoutElements.get("WaitBeforeShippingAddress");r&&await m.ZP.Sleep(Number(r.Value));const n=a.CheckoutElements.get(Ht.RefreshAfterContinue);n&&"true"===n.Value?.toString()&&(0,Ft.Xo)(`${Ne._.StopRefreshTimeout}_${Vt.ShippingAddress}`,"false");const s=a?.CheckoutElements.get("clickBefore");s&&await this.ClickButtonWithWaiting(e,s,"ShippingAddress",void 0,void 0,void 0,2e3);const c=a?.CheckoutElements.get("useDifferentFromBillingAddress"),l=a?.CheckoutElements.get("useBillingAddress"),u=a?.CheckoutElements.get("useDifferentFromBillingAddressLabel"),d=a?.CheckoutElements.get("useBillingAddressLabel");"inputRadio"===c?.Type&&"inputRadio"===l?.Type&&u&&d?await this.ChangeUseDifferFromBillingAddrUseBillingAddr(c,u):(c&&await this.ChangeUseDifferentFromBillingAddressCheckedStatus(c,u,e),l&&await this.ChangeUseBillingAddressCheckedStatus(l,d,e));const h=a?.CheckoutElements.get("fillClickBefore");h&&await this.ClickButtonWithWaiting(e,h,"ShippingAddress");const p=a?.CheckoutElements.get("fillClickBefore2");p&&await this.ClickButtonWithWaiting(e,p,"ShippingAddress");const g=a.CheckoutElements.get(Ht.Address1);if(g){if(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,g.Value,"IsAddress FieldVisible")),g.WaitForVisible||8e3),!await this.IsFieldVisible(e,g.Value,"IsAddress FieldVisible"))throw this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(g,"ShippingAddress")),new Mt.Z("Address1 field is not visible",Me.ExecutionError,Vt.ShippingAddress);const i=this.GetProfileData(t,Ht.Address1);i&&await this.TypeCheckoutFieldData(g.Value,i);const o=a.CheckoutElements.get("address1Confirm");o&&await this.ClickButtonWithWaiting(e,o,"ShippingAddress",2e3,2e3,void 0,2e3)}await this.FillCheckoutElements(e,a,t,Kt.First,Vt.ShippingAddress),await this.FillCheckoutElements(e,a,t,Kt.Second,Vt.ShippingAddress);const C=a.CheckoutElements.get(Ht.Signup);C&&C.Value&&"disableCheckBox"===C.Type&&await this.SendDomMessage(e,new lt(Ce.SetCheckBox,C.Value,"false"),"disable signup",!1);const S=a?.CheckoutElements.get("sameBillingAddress"),A=a?.CheckoutElements.get("sameBillingAddressLabel");if(S&&"checkBox"===S.Type&&A){const e=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,S.Value,"",J.CheckedValue),"get sameBillingAddress checked value",!1),t=e?.CheckedValue??"";void 0!==S.ShouldValue?t!==S.ShouldValue&&await this.Click(A.Value,J.Continue):t||await this.Click(A.Value,J.Continue)}const f=a?.CheckoutElements.get("differentBillingAddress"),v=a?.CheckoutElements.get("differentBillingAddressLabel");if(f)if("checkBox"===f.Type&&v){const e=await this.SendDomMessage(this.contextId,new lt(Ce.GetCheckedValue,f.Value,"",J.CheckedValue),"get differentBillingAddress checked value",!1);e?.CheckedValue||await this.Click(v.Value,J.Continue)}else await this.Click(f.Value,J.Continue);this.EntryPointIsWallet()||await m.ZP.Sleep(1e3),this.expressCheckoutState.CheckoutProgress=V.ShippingAddressDone,this.edgeMessageService.SaveExpressCheckoutStatus(this.expressCheckoutState);const E=a?.CheckoutElements.get("continue");E&&await this.ClickButtonWithWaiting(e,E,"ShippingAddress",8e3,3e3,void 0,1e3);const P=a.CheckoutElements.get(Ht.FieldError);P&&P.Value&&await this.CheckAndThrowError(P,"Updating Shipping Address",J.FieldError,Me.ECFieldError,Vt.ShippingAddress);const I=a.CheckoutElements.get(Ht.FormError);I&&I.Value&&await this.CheckAndThrowError(I,"Udpating Shipping Address",J.FormError,Me.ECFormError,Vt.ShippingAddress);const T=a.CheckoutElements.get("confirm");T&&(T.DynamicFetch&&(E&&await m.ZP.WaitForCondition((async()=>await this.IsFieldNotDisabled(e,E.Value,`is ${E.Name} not disabled`)),1e4,1e3),this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.DynamicSelectorFetch,JSON.stringify({PageType:"ShippingAddress",ElementName:"confirm"})),await m.ZP.WaitForCondition((async()=>{const e=this.localDataService.GetLocalData(Ne.Q.DynamicSelectors),t=e?.find((e=>"ShippingAddress"===e.PageType&&"confirm"===e.ElementName));return T.Value=t?.ElementValue,Boolean(t)}),1e4,1e3)),T.Value&&await this.ClickButtonWithWaiting(e,T,"ShippingAddress",2e3,2e3,void 0,2e3,T.DynamicFetch?8e3:void 0));const O=a?.CheckoutElements.get(Ht.Continue2);if(O&&await this.ClickButtonWithWaiting(e,O,"ShippingAddress",8e3,3e3,void 0,1e3),o&&await o(n),n&&"true"===n.Value?.toString())throw new Mt.Z("error at updating shipping adrress",Me.Refresh,Vt.ShippingAddress)}}async CheckAndThrowError(e,t,i,o,a){if(e&&e.Value&&await this.IsFieldVisible(this.contextId,e.Value,t)){const r=await this.SendDomMessage(this.contextId,new lt(Ce.GetInnerText,e.Value,"",i),i+" error",!1),n=r?.TextValue??"";throw new Mt.Z("Error in "+t+":"+n,o,a)}}async UpdateShippingOptions(e,t,i){const o=t.AllcheckoutCompletionPages.get(Vt.ShippingOptions),a=o?.CheckoutElements;if(a){const t=a.get("WaitBeforeShippingOptions");t&&await m.ZP.Sleep(Number(t.Value));const o=a.get(Ht.Check);if(o&&o.Value){await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,o.Value,`is ${o.Name} visible`)),o.WaitForVisible||8e3);const t=await this.IsFieldVisible(e,o.Value,"is Shipping Visible"),r=a.get(Ht.RefreshAfterContinue);if(t){r&&"true"===r.Value?.toString()&&(0,Ft.Xo)(`${Ne._.StopRefreshTimeout}_${Vt.ShippingOptions}`,"false"),this.expressCheckoutState.CheckoutProgress=V.ShippingOptionsDone,this.edgeMessageService.SaveExpressCheckoutStatus(this.expressCheckoutState);const t=a.get(Ht.Continue);t&&await this.ClickButtonWithWaiting(e,t,"ShippingOptions",8e3,5e3,void 0,void 0);const o=a.get(Ht.Continue2);if(o&&await this.ClickButtonWithWaiting(e,o,"ShippingOptions",8e3,5e3,void 0,void 0),i&&await i(r),r&&"true"===r.Value?.toString())throw new Mt.Z("error at updating Shipping Options",Me.Refresh,Vt.ShippingOptions)}else i&&await i(r),this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(o,"ShippingOptions"))}}}IframeEventHandler(e){if(this.allowedIfameOrigins.add(location.origin),e.data){const t=e.data,i=t.guid;if(i&&this.ccwaitingguids.has(i)){const e=t.status;this.ccResponseMap.set(i,e),this.ccwaitingguids.delete(i)}}}async UpdatePaymentIframeDetails(e,t,i,o){const a=i.Payment,r=t.AllcheckoutCompletionPages.get(Vt.PaymentIframe);if(r&&a){const n=r?.CheckoutElements.get("WaitBeforePaymentIframe");n&&await m.ZP.Sleep(Number(n.Value));const s=r.CheckoutElements.get("WaitForIframeResponse")?.Value,c=r?.CheckoutElements.get("clickBefore");c&&await this.ClickButtonWithWaiting(e,c,"PaymentIframe",void 0,void 0,void 0,2e3);const l=r.CheckoutElements.get("fillClickBefore");l&&await this.ClickButtonWithWaiting(e,l,"Payment");const u=r.CheckoutElements.get("fillClickBefore2");u&&await this.ClickButtonWithWaiting(e,u,"Payment"),window.addEventListener("message",this.iframeEventHandler);const d=t.AllCheckoutCompletionPagesStr,h=r.CheckoutElements.get("cardNumberIframe");if(!h)throw new Mt.Z("card number iframe undefined.",Me.IframeSelectorNotFound,Vt.PaymentIframe);if(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,h.Value,"Iframe FieldVisible")),h.WaitForVisible||1e4),!await this.IsFieldVisible(e,h.Value,"card number Iframe FieldVisible"))throw this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(h,"PaymentIframe")),new Mt.Z("card number iframe undefined.",Me.IframeSelectorNotFound,Vt.PaymentIframe);const p=r.CheckoutElements.get("cardNumberIframeOrigin"),g=r.CheckoutElements.get("cardNumber");h&&g&&(await m.ZP.Sleep(h.WaitBefore||1e3),await this.UpdateIframePaymentField(e,Lt.CCNUpdate,d,h,p?.Value||"",i.Payment.CardNumber,s,g));const C=r.CheckoutElements.get("nameOnCardIframe"),S=r.CheckoutElements.get("nameOnCardIframeOrigin"),A=r.CheckoutElements.get("nameOnCard"),f=i.Payment.FullName??i.Profile.FullName;C&&A&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,C.Value,"card name FieldVisible")),C.WaitForVisible||1e4),await this.IsFieldVisible(e,C.Value,"card name FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(C,"PaymentIframe")),C.WaitBefore&&await m.ZP.Sleep(C.WaitBefore),await this.UpdateIframePaymentField(e,Lt.CCName,d,C,S?.Value||"",f,s,A));const v=r.CheckoutElements.get("firstNameIframe"),E=r.CheckoutElements.get("firstNameIframeOrigin"),P=r.CheckoutElements.get("firstName"),I=i.Payment.FirstName??i.Profile.FirstName;v&&E&&P&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,v.Value,"card firstName FieldVisible")),v.WaitForVisible||1e4),await this.IsFieldVisible(e,v.Value,"card firstName FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(v,"PaymentIframe")),v.WaitBefore&&await m.ZP.Sleep(v.WaitBefore),await this.UpdateIframePaymentField(e,Lt.CCFirstName,d,v,E.Value,I,s,P));const T=r.CheckoutElements.get("middleNameIframe"),O=r.CheckoutElements.get("middleNameIframeOrigin"),y=r.CheckoutElements.get("middleName"),D=i.Payment.MiddleName??i.Profile.MiddleName;T&&O&&y&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,T.Value,"card middleName FieldVisible")),T.WaitForVisible||1e4),await this.IsFieldVisible(e,T.Value,"card middleName FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(T,"PaymentIframe")),T.WaitBefore&&await m.ZP.Sleep(T.WaitBefore),await this.UpdateIframePaymentField(e,Lt.CCMiddleName,d,T,O.Value,D,s,y));const b=r.CheckoutElements.get("lastNameIframe"),N=r.CheckoutElements.get("lastNameIframeOrigin"),R=r.CheckoutElements.get("lastName"),_=i.Payment.LastName??i.Profile.LastName;b&&N&&R&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,b.Value,"card lastName FieldVisible")),b.WaitForVisible||1e4),await this.IsFieldVisible(e,b.Value,"card lastName FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(b,"PaymentIframe")),b.WaitBefore&&await m.ZP.Sleep(b.WaitBefore),await this.UpdateIframePaymentField(e,Lt.CCLastName,d,b,N.Value,_,s,R));const k=r.CheckoutElements.get("expiryIframe"),w=r.CheckoutElements.get("expiryIframeOrigin"),x=r.CheckoutElements.get("expiry");k&&w&&x&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,k.Value,"expiry FieldVisible")),k.WaitForVisible||1e4),await this.IsFieldVisible(e,k.Value,"expiry FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(k,"PaymentIframe")),k.WaitBefore&&await m.ZP.Sleep(k.WaitBefore),await this.UpdateIframePaymentField(e,Lt.CCExpiry,d,k,w.Value,this.GetFormattedExpiryDate(a,Wt.MonthYear,x?.Format||"MM/YY"),s,x));const U=r.CheckoutElements.get("expiryMonthIframe"),M=r.CheckoutElements.get("expiryMonthIframeOrigin"),L=r.CheckoutElements.get("expiryMonth");U&&L&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,U.Value,"expiry month FieldVisible")),U.WaitForVisible||1e4),await this.IsFieldVisible(e,U.Value,"expiry month FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(U,"PaymentIframe")),U.WaitBefore&&await m.ZP.Sleep(U.WaitBefore),await this.UpdateIframePaymentField(e,Lt.CCExpiryMonth,d,U,M?.Value||"",this.GetFormattedExpiryDate(a,Wt.Month,L?.Format||"MM"),s,L));const B=r.CheckoutElements.get("expiryYearIframe"),F=r.CheckoutElements.get("expiryYearIframeOrigin"),Z=r.CheckoutElements.get("expiryYear");B&&Z&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,B.Value,"expiry year FieldVisible")),B.WaitForVisible||1e4),await this.IsFieldVisible(e,B.Value,"expiry year FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(B,"PaymentIframe")),B.WaitBefore&&await m.ZP.Sleep(B.WaitBefore),await this.UpdateIframePaymentField(e,Lt.CCExpiryYear,d,B,F?.Value||"",this.GetFormattedExpiryDate(a,Wt.Year,Z?.Format||"YYYY"),s,Z));const G=r.CheckoutElements.get("securityCodeIframe"),H=r.CheckoutElements.get("securityCodeIframeOrigin"),V=r.CheckoutElements.get("securityCode"),W=a.CardCVC;G&&W&&V&&(await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,G.Value,"securityCode FieldVisible")),G.WaitForVisible||1e4),await this.IsFieldVisible(e,G.Value,"securityCode FieldVisible")||this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(G,"PaymentIframe")),await m.ZP.Sleep(G.WaitBefore||1e3),await this.UpdateIframePaymentField(e,Lt.CCSecurityCode,d,G,H?.Value||"",W,s,V)),window.removeEventListener("message",this.iframeEventHandler),o&&o()}}async UpdateIframePaymentField(e,t,i,o,a,r,n,s){const c=this.localDataService.GetLocalData(Ne.Q.ExpressCheckoutState);if(this.EntryPointIsWallet()&&c===V.CancelEC)throw new Mt.Z("ExpressCheckout cancelled",Me.ECCancelled,Vt.PaymentIframe);const l=await this.SendDomMessage(e,new lt(Ce.IframeOrigin,o.Value,"",J.IframeOrigin),"Calling iframe origin",!1);if(a&&l.TextValue!==a){const e=new me.Z(this.domainName,pe.x.ECFrameOriginMisMatch,{EntryPoint:this.entryPointService.GetEntryPoint(),frameOrigin:l.TextValue},void 0);throw this.logService.LogClientErrorV2("wrong iframe origin",e),new Mt.Z("wrong iframe origin",Me.IframeOriginInvalid,Vt.PaymentIframe)}this.allowedIfameOrigins.add(a);const u=(await this.SendDomMessage(e,new lt(Ce.SelectorName,o.Value,"",J.IframeName),"Calling iframe name",!1)).TextValue;u||new me.Z(this.domainName,pe.x.ECFrameNameUndefined,{EntryPoint:this.entryPointService.GetEntryPoint(),frameOrigin:l.TextValue},void 0);const d=z.Z.uuidv4(),h={AllCheckoutCompletionPagesStr:i,CommandName:t,Guid:d,ParentOrigin:location.origin,Value:r},p=[d,u,JSON.stringify(h)];this.ccwaitingguids.add(d),this.edgeMessageService.SendIframeMessage(p),await m.ZP.WaitForCondition((async()=>this.ccResponseMap.has(d)),Number(n)||8e3);const g=this.ccResponseMap.get(d);if(!g){const e={EntryPoint:this.entryPointService.GetEntryPoint(),command:t,iframeName:u},i=new me.Z(this.domainName,pe.x.ECIframeResponseNotReceived,e,void 0);throw this.logService.LogClientErrorV2("iframe response not received.",i),this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(s,"PaymentIframe")),new Mt.Z("iframe response not received",Me.IframePaymentFail,Vt.PaymentIframe)}if("SUCCESS"!==g)throw this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(s,"PaymentIframe")),new Mt.Z("iframe response is ERROR",Me.IframePaymentFail,Vt.PaymentIframe)}GetFormattedExpiryDate(e,t,i){let o="";return t===Wt.MonthYear?o="MM/YY"===i?e.ExpMonth+"/"+e.ExpYear?.substr(e.ExpYear.length-2):e.ExpMonth+"/"+e.ExpYear:t===Wt.Month?o="M"===i?parseInt(e.ExpMonth,10)?.toString():e.ExpMonth:t===Wt.Year&&(o="YY"===i?e.ExpYear?.slice(-2):e.ExpYear),o}async SendCheckoutDomMessage(e,t,i,o){if(this.localDataService.GetLocalData(Ne.Q.ExpressCheckoutState)===V.CancelEC)throw new Mt.Z("ExpressCheckout cancelled",Me.ECCancelled);await this.SendDomMessage(e,t,i,o)}GetFormattedPhoneNumber(e,t){let i=e.replace(/\D/g,"");if(i&&i.length>=10&&(i=i.substr(i.length-10)),t&&"1"===t){const e=i.match(/^(\d{3})(\d{3})(\d{4})$/);if(e)return"("+e[1]+") "+e[2]+"-"+e[3]}return i}GetProfileData(e,t,i){if(e)switch(t){case"email":case"confirmEmail":return e.Email;case"name":return e.FullName;case"firstName":return e.FirstName;case"middleName":return e.MiddleName;case"lastName":return e.LastName;case"company":return e.Company;case"address1":return this.GetAddressLine1(e.AddressLines);case"address2":return this.GetAddressLine2(e.AddressLines);case"city":return e.City;case"state":return(e=>{const t=Bt(),i=new Set(t.values()),o=e.toUpperCase();if(i.has(o))return[o,!0];const a=t.get(o);return void 0!==a?[a,!0]:[o,!1]})(e.State)[0];case"country":return this.GetCountry(e.Country,i);case"zipCode":return this.GetZip(e.Zip,i);case"phone":return this.GetFormattedPhoneNumber(e.PhoneNumber,i);case"dateOfBirth":return e.DateOfBirth}}GetZip(e,t){return t&&"1"===t?e.substr(0,5):e}GetCountry(e,t){if(!t)return e;const i=this.GetCountriesMap().get(e);if(void 0!==i){const e=i.get(t);if(void 0!==e)return e}return e}GetAddressLine1(e){if(e){const t=e.split("\n");if(t.length>=1){const e=t[0];return e.endsWith(",")?e.substring(0,e.length-1):e}}return""}GetAddressLine2(e){if(e){const t=e.split("\n");if(t.length>=2)return t[1]??""}return""}async Click(t,i){await this.SendCheckoutDomMessage(e.og.FromBackground,new lt(Ce.Click,t,"",i),i,!0)}async TypeCheckoutFieldData(t,i){await this.SendCheckoutDomMessage(e.og.FromBackground,new lt(Ce.SetBoxValue,t,i),"Checkout field input box",!0)}GetCountriesMap(){const e=new Map,t=new Map,i=new Map,o=new Map,a=new Map,r=new Map,n=new Map,s=new Map,c=new Map,l=new Map;return t.set("1","United States"),i.set("1","Canada"),o.set("1","Australia"),a.set("1","France"),r.set("1","Japan"),n.set("1","Mexico"),s.set("1","Brazil"),c.set("1","United Kingdom"),l.set("1","India"),e.set("US",t),e.set("CA",i),e.set("AU",o),e.set("FR",a),e.set("JP",r),e.set("MX",n),e.set("BR",s),e.set("GB",c),e.set("IN",l),e}async ClickButtonWithWaiting(e,t,i,o,a,r,n,s){const c=t.WaitForVisible||o,l=t.WaitForNotDisabled||a,u=t.WaitBefore||r,d=t.WaitAfter||n,h=t.WaitForNotVisible||s;c&&await m.ZP.WaitForCondition((async()=>await this.IsFieldVisible(e,t.Value,`is ${t.Name} visible`)),c),await this.IsFieldVisible(e,t.Value,`is ${t.Name} visible`)?(l&&await m.ZP.WaitForCondition((async()=>await this.IsFieldNotDisabled(e,t.Value,`is ${t.Name} not disabled`)),l),u&&await m.ZP.Sleep(u),await this.Click(t.Value,J.Continue),d&&await m.ZP.Sleep(d),h&&await m.ZP.WaitForCondition((async()=>!await this.IsFieldVisible(e,t.Value,`is ${t.Name} visible`)),h,1e3)):this.selectorsNotFound.push(this.GetSelectorsNotFoundItem(t,i))}GetSelectorsNotFoundItem(e,t){return{Element:e,PageType:t}}}(uo.GetPlatformInstance(),uo.GetLocalDataService(),uo.GetOverlayService(),uo.GetEdgeMessageService(),uo.GetLogService(),uo.GetEntryPointService())),(0,a.Z)(uo,"otherSellersService",new class extends bt{constructor(t,i,o,r){super(t),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"checkoutPageData",void 0),(0,a.Z)(this,"checkoutPageUrlData",void 0),(0,a.Z)(this,"otherSellerData",void 0),(0,a.Z)(this,"iframeID","OtherSellersIframe"),(0,a.Z)(this,"contextId",void 0),this.logService=i,this.overlayService=o,this.edgeMessageService=r,this.contextId=e.og.FromBackground}async AddToCart(t,i){if(this.edgeMessageService.SendOtherSellersStartMessage(),this.checkoutPageData=t,this.otherSellerData=i,!this.InitializeCheckoutPageUrlData(t))return;let o="";if(!i)return o="Called OtherSellerService with empty storage data",void this.FinalizeOtherSellersScenario(e.Kg.Error,0,0,"",o);this.AddOtherItemToCart().catch((t=>{o="Unknown OtherSellersService error: "+t,this.FinalizeOtherSellersScenario(e.Kg.Error,0,0,"",o)}))}GetOtherSellerDiscount(){const e=this.otherSellerData?.OtherSeller?.OriginalItemPrice,t=this.otherSellerData?.OtherSeller?.ItemPrice;if(e&&t){const i=e-t;return Math.round(100*i)/100}return-1}async AddOtherItemToCart(){const t=this.GetOtherSellerDiscount();let i="$";(0,ki.TF)(this.otherSellerData?.OtherSeller?.Currency)||(i=this.otherSellerData.OtherSeller.Currency),await this.overlayService.UpdateCurrency(e.og.FromBackground,i),await this.overlayService.OpenOverlay(this.contextId,"OtherSeller",1,t,this.checkoutPageUrlData,0);const o=this.otherSellerData?.OtherSeller?.ItemIndex,a=this.otherSellerData?.OtherSeller?.OriginalItemPrice??-1;return await this.AddItemToCart(o,t,a,i)}async AddItemToCart(t,i,o,a){let r="";if(void 0===t)return await this.overlayService.MoveProgressBar(this.contextId,1,1),r="Unable to get item: ItemIndex was null",this.FinalizeOtherSellersScenario(e.Kg.Error,i,o,a,r),!1;const n=document.querySelectorAll("#"+this.iframeID)[0],s=n?.contentDocument?.body,c=s?.querySelectorAll(this.checkoutPageUrlData.otherSellerSelectors.otherSellerOfferElementSelector);if(!c||c.length<=t)return await this.overlayService.MoveProgressBar(this.contextId,1,1),r="Unable to find list of sellers element",this.FinalizeOtherSellersScenario(e.Kg.Error,i,o,a,r),!1;const l=c[t];return this.checkoutPageData.retailerData.domainName.includes("amazon")?this.AddItemToAmazonCart(n,l,i,o,a):"walmart.com"===this.checkoutPageData.retailerData.domainName?this.AddItemToWalmartCart(n,l,i,o,a):void 0}async AddItemToAmazonCart(t,i,o,a,r){const n=this.checkoutPageUrlData.otherSellerSelectors.otherSellerAddButtonSelector,s=this.checkoutPageUrlData.otherSellerSelectors.otherSellerAddedConfirmationSelector,c=i.querySelector(n),l=i.querySelector(s);let u;if(l&&(u=l.children),c&&u){c.click();let t=-1;await m.ZP.WaitForCondition((async()=>{if(u){for(let e=0;e<u.length;e++)u[e].className.includes("hidden")||(t=e);return-1!==t}return!1}),7e3);let i=!1;-1!==t&&(i=u[t].className.includes("success")),await this.overlayService.MoveProgressBar(this.contextId,1,1),i?this.FinalizeOtherSellersScenario(e.Kg.Positive,o,a,r):this.FinalizeOtherSellersScenario(e.Kg.Negative,o,a,r)}else if(c){const i="gp/huc";if(c.click(),await m.ZP.WaitForCondition((async()=>!0===t?.contentDocument?.location?.href?.includes(i)),5e3),await this.overlayService.MoveProgressBar(this.contextId,1,1),t?.contentDocument?.location?.href?.includes(i)){t=document.querySelectorAll("#"+this.iframeID)[0];const i=t?.contentDocument?.body,n=i?.querySelector("[id*='order-row-confirm-text']");n&&n.className?.includes("success")?this.FinalizeOtherSellersScenario(e.Kg.Positive,o,a,r):this.FinalizeOtherSellersScenario(e.Kg.Negative,o,a,r)}else this.FinalizeOtherSellersScenario(e.Kg.Negative,o,a,r)}else{await this.overlayService.MoveProgressBar(this.contextId,1,1);const t="Unable to find add button";this.FinalizeOtherSellersScenario(e.Kg.Negative,o,a,r,t)}return!0}async AddItemToWalmartCart(t,i,o,a,r){const n=this.checkoutPageUrlData.otherSellerSelectors.otherSellerAddButtonSelector,s=this.checkoutPageUrlData.otherSellerSelectors.otherSellerAddedConfirmationSelector,c=i.querySelector(n);let l=0,u=0,d=!1;if(c){if(c.getAttribute("aria-label")?.includes("in cart")){c.click(),l=this.GetItemQuantity(i,s);const e=i.querySelector(n);e&&e?.click(),u=this.GetItemQuantity(i,s),u===l+1&&(d=!0)}else c.getAttribute("aria-label")?.includes("Add to cart")&&(c.click(),u=this.GetItemQuantity(i,s),u===l+1&&(d=!0));let h;await m.ZP.WaitForCondition((async()=>(h=t?.contentDocument?.body.querySelector(this.checkoutPageUrlData.errorMessageSelector),null!=h)),3e3),h=t?.contentDocument?.body.querySelector(this.checkoutPageUrlData.errorMessageSelector),h&&(d=!1),await this.overlayService.MoveProgressBar(this.contextId,1,1),d?this.FinalizeOtherSellersScenario(e.Kg.Positive,o,a,r):this.FinalizeOtherSellersScenario(e.Kg.Negative,o,a,r)}else{await this.overlayService.MoveProgressBar(this.contextId,1,1);const t="Unable to find add button";this.FinalizeOtherSellersScenario(e.Kg.Negative,o,a,r,t)}return!0}GetItemQuantity(e,t){const i=e.querySelector(t),o=i?.innerText.match(/[0-9]+/);return o&&o.length>0?parseFloat(o[0]):0}FinalizeOtherSellersScenario(t,i,o,a,r){let n="";if(t===e.Kg.Positive){const e=(0,be.Vv)(a)??"USD";this.edgeMessageService.SendOtherSellersCompleteMessage(o,i,e),n="Finished Adding item to cart"}else this.edgeMessageService.SendOtherSellersErrorMessage(),n="Unable to add item to cart";const s=new wi.Z;s.SetResultData(this.checkoutPageData.retailerData.domainName,i,o,a,a,t),this.logService.LogClientEventV2(e.in.Information,e.R.OtherSellers,r??n,s,this.checkoutPageData?.impressionId);const c={ProductAddedNotification:!0,Url:location.pathname};this.edgeMessageService.SetStorageValue("OtherSellersNotificationData_"+location.pathname,JSON.stringify({value:JSON.stringify(c)})),location.reload()}InitializeCheckoutPageUrlData(t){const i=t.retailerData.GetCurrentCheckoutPage();if(i)return this.checkoutPageUrlData=i,!0;{const t="Called OtherSellerService when not on a checkout page";return this.FinalizeOtherSellersScenario(e.Kg.Error,0,0,"",t),!1}}}(uo.GetPlatformInstance(),uo.GetLogService(),uo.GetOverlayService(),uo.GetEdgeMessageService())),(0,a.Z)(uo,"broadcastChannelService",kt.GetInstance()),(0,a.Z)(uo,"backgroundAutoApplyService",new Rt(uo.GetPlatformInstance(),uo.GetLogService(),uo.GetOverlayService(),uo.GetEdgeMessageService(),uo.GetApplicatorStateService(),uo.GetBroadcastChannelService(),uo.GetEntryPointService())),(0,a.Z)(uo,"checkoutPaymentUpdateService",new class{constructor(t,i,o,r,n,s){(0,a.Z)(this,"checkoutService",void 0),(0,a.Z)(this,"contextId",void 0),(0,a.Z)(this,"localDataService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"entryPointService",void 0),this.checkoutService=t,this.contextId=e.og.FromBackground,this.localDataService=i,this.edgeMessageService=o,this.overlayService=r,this.logService=n,this.entryPointService=s}async UpdatePaymentDetails(e,t){this.localDataService.SaveLocalData(Ne.Q.ExpressCheckoutState,V.AddressDone);const i=new f.Z(e),o=this.GetUserData(t),a=Date.now();try{await this.overlayService.OpenExpressCheckoutUpdatePaymentOverlay(this.contextId),await this.checkoutService.UpdatePaymentDetails(this.contextId,i,o),await this.checkoutService.UpdateBillingAddressDetails(this.contextId,i,o),this.edgeMessageService.SendUpdatePaymentDetailsResultMessage(!0),this.LogUpdatePaymentDetailsStatus(!0,a,i.DomainName),this.EntryPointIsWallet()&&(this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.BNPLPaymentSuccess),await this.overlayService.CloseWalletDrawer(this.contextId))}catch(e){this.edgeMessageService.SendUpdatePaymentDetailsResultMessage(!1),this.LogUpdatePaymentDetailsStatus(!1,a,i.DomainName,e),this.EntryPointIsWallet()&&(this.edgeMessageService.SendEdgeDriverStateChangeMessage(V.BNPLPaymentFail),await this.overlayService.CloseWalletDrawer(this.contextId))}await this.overlayService.CloseOverlay(this.contextId)}EntryPointIsWallet(){return this.entryPointService.GetEntryPoint()===e.N9.Wallet}GetUserData(e){const t=new W;return t.Payment=H.CreateFromCheckoutData(e),t.Profile=F.CreateFromCheckoutData(e),t}LogUpdatePaymentDetailsStatus(t,i,o,a){const r=new xt(t?Ut.BNPLSuccess:Ut.BNPLFailed,this.entryPointService.GetEntryPoint());if(r.ECProcessTime=Date.now()-i,r.ECType=e.qR.ECWithBNPL,this.logService.LogClientEventV2(e.in.Information,e.R.ExpressCheckout,"UpdatePaymentDetails",r),!t&&a){const e=new me.Z(o,pe.x.ExpressCheckoutBNPLFailed,{EntryPoint:this.entryPointService.GetEntryPoint()},a.stack);this.logService.LogClientErrorV2("UpdatePaymentDetails failed",e)}}}(uo.GetCheckoutService(),uo.GetLocalDataService(),uo.GetEdgeMessageService(),uo.GetOverlayService(),uo.GetLogService(),uo.GetEntryPointService())),(0,a.Z)(uo,"instantAddToCartService",new class extends bt{constructor(t,i,o,r){super(t),(0,a.Z)(this,"overlayService",void 0),(0,a.Z)(this,"contextId",void 0),(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"localDataService",void 0),this.overlayService=i,this.contextId=e.og.FromBackground,this.logService=o,this.localDataService=r}async LaunchInstantATCOverlay(e,t){Tt.Z.CreateNew(this.contextId,e.impressionId);const i=e.retailerData.GetCurrentCheckoutPage();if(!i)return this.LogOverlayTelemetry(t,!1,!0),!1;if(!await ho.GetICDriverService().IsAddToCartEnabled(i,t))return this.LogOverlayTelemetry(t,!1,!0),!1;try{this.LogOverlayTelemetry(t,!1),await this.overlayService.OpenInstantAddToCartOverlay(this.contextId,t),setTimeout((async()=>{await this.overlayService.MoveProgressBar(this.contextId,1,1)}),2e3),setTimeout((async()=>{await this.overlayService.OpenSuccessInstantAddToCartOverlay(this.contextId,t)}),4e3),setTimeout((async()=>{await ho.GetICDriverService().HandleAddToCart(i,t)}),6e3),setTimeout((async()=>{await this.overlayService.CloseOverlay(this.contextId)}),7e3)}catch(e){this.LogOverlayTelemetry(t,!0)}}LogOverlayTelemetry(t,i,o){const r=o?e.xu.InstantATCOverlayNotShown:t.isSpbOverlay?e.xu.SpbInstantATCOverlayShown:e.xu.QuotientInstantATCOverlayShown,n=new ht.Z(r),s=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(i),!0).forEach((function(t){(0,a.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Yt(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t);n.Metadata=JSON.stringify(s);let c=e.in.Information;const l=o?"Instant ATC Overlay Not Shown":t.isSpbOverlay?"Spb Overlay Shown":"Quotient Overlay Shown";i&&(c=e.in.Error),this.logService.LogClientEventV2(c,e.R.EdgeFlyoutStatus,l,n,this.localDataService.GetLocalData(Ne.Q.ImpressionId))}}(uo.GetPlatformInstance(),uo.GetOverlayService(),uo.GetLogService(),uo.GetLocalDataService())),(0,a.Z)(uo,"clippingServiceLogger",new class{constructor(e,t){(0,a.Z)(this,"logService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),this.logService=e,this.edgeMessageService=t}SendLogMessage(e,t,i,o,a){this.logService.LogClientEventV2(e,t,i,o,a)}SaveSavingsTransactionToEdge(t){this.edgeMessageService.SaveTransactionToEdgeLocalStore(e.Sl.CouponClippingTransactionsKey,JSON.stringify(t))}SendEdgeAANegativeResult(){this.edgeMessageService.SendAutoApplyNegativeMessage()}SendEdgeAAPositiveResult(e,t,i){this.edgeMessageService.SendAutoApplyPositiveMessage(e,t,i)}SendEdgeAAErrorMessage(e){this.edgeMessageService.SendAutoApplyErrorMessage(e)}}(uo.GetLogService(),uo.GetEdgeMessageService())),(0,a.Z)(uo,"clippingService",new zt.Z(uo.GetClippingServiceLogger(),e.KE.CouponClipping)),(0,a.Z)(uo,"icDriverService",new class{constructor(e,t){(0,a.Z)(this,"localDataService",void 0),(0,a.Z)(this,"logService",void 0),this.localDataService=e,this.logService=t}async HandleAddToCart(e,t){try{let i=!1;const o=e?.productAddToCartSelector.split(";");o.forEach((async e=>{let o=document.querySelector(e);if("bestbuy.com"===t.domain&&(o.scrollIntoView(),await m.ZP.WaitForCondition((async()=>void 0!==Pe.Z.GetFirstVisibleElement("[class='item c-carousel-item '] [class='priceView-hero-price priceView-customer-price']")),3e3,100)),o=document.querySelector(e),o)return o.click(),i=!0,void this.LogAddToCartTelemetry(!0,t,!1)})),i||this.LogAddToCartTelemetry(!1,t,!1)}catch(e){return void this.LogAddToCartTelemetry(!1,t,!0)}}async IsAddToCartEnabled(e,t){try{let t=!1;const i=e?.productAddToCartSelector.split(";");return i.forEach((async e=>{const i=document.querySelector(e),o=window.getComputedStyle(i);!i||i.disabled||"not-allowed"===o.cursor||(t=!0)})),t}catch(e){return void this.LogAddToCartTelemetry(!1,t,!0)}}LogAddToCartTelemetry(t,i,o){const r=t?e.xu.ICAddToCartProductAdded:e.xu.ICAddToCartProductNotAdded,n=new ht.Z(r),s=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(i),!0).forEach((function(t){(0,a.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):jt(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},i);n.Metadata=JSON.stringify(s);let c=e.in.Information;o&&(c=e.in.Error),this.logService.LogClientEventV2(c,e.R.EdgeFlyoutStatus,t?"ICAddToCart Product Can be Added to Cart":"ICAddToCart Product Not Added to Cart",n,this.localDataService.GetLocalData(Ne.Q.ImpressionId))}}(uo.GetLocalDataService(),uo.GetLogService()));var ho=uo,po=i(87605),go=i(2388),Co=i(84901),So=i(77776),mo=i(55590);function Ao(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function fo(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ao(Object(i),!0).forEach((function(t){(0,a.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ao(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}class vo{constructor(e,t,i,o){(0,a.Z)(this,"platformInstance",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"flyoutCommonImgPathUrl",void 0),(0,a.Z)(this,"isDarkTheme",void 0),this.platformInstance=e,this.edgeMessageService=t,this.flyoutCommonImgPathUrl=i,this.isDarkTheme=o}shouldUpsellInAAFailure(t,i,o,a,r,n){const s=this.shouldUpsellInAA(t,i,pi.H.inboxCouponsAAFailureUpsell,n),c=!o&&!a&&!r;return s&&!c&&this.logInformation(e.xu.InboxCouponsAAUpsellSuppressed,t,fo(fo({},n),{},{isCashbackScenario:o,isValidCashBack:a,isCashBackActive:r})),s&&c}shouldUpsellInAASuccess(t,i,o,a,r,n){const s=this.shouldUpsellInAA(t,i,pi.H.inboxCouponsAASuccessUpsell,n),c=!o&&!a&&!r;return s&&!c&&this.logInformation(e.xu.InboxCouponsAAUpsellSuppressed,t,fo(fo({},n),{},{hasEstimatedCashbackDiscount:o,scenarioHasCashBack:a,isCashBackActive:r})),s&&c}createAAFailureIBCConnectUpsellWrapper(t,i){const o=this.uuidv4();return i=fo(fo({},i),{},{ibcUpsellSessionId:o}),this.createIBCConnectUpsellWrapper((o=>this.logInformation(e.xu.InboxCouponsAAFailureUpsellClicked,t,i,o)),mo.Q.InboxCouponsAAFailureUpsellTriggeredV2,e.xu.InboxCouponsAAFailureUpsellViewed,t,i,this.getAAFailureUpsellText())}createAASuccessIBCConnectUpsellWrapper(t,i){const o=this.uuidv4();return i=fo(fo({},i),{},{ibcUpsellSessionId:o}),this.createIBCConnectUpsellWrapper((o=>this.logInformation(e.xu.InboxCouponsAASuccessUpsellClicked,t,i,o)),mo.Q.InboxCouponsAASuccessUpsellTriggeredV2,e.xu.InboxCouponsAASuccessUpsellViewed,t,i)}shouldUpsellInAA(t,i,o,a){const r=Pi.R.isExperimentActive(pi.H.shorelineinboxcoupons),n=!!Pi.R.getServiceExperimentValue(o),s=_e.Z.IsBuildVersionSupported(vo.minimumSupportedEdgeVersion),c=Ii.Q.InboxCouponsUserConsent===dt.oL,l=t&&t.userInfo&&t.userInfo.isMSASignedIn&&!t.userInfo.isAADSignedIn,u="true"===Ii.Q.InboxCouponsPaneOpen,d=r&&n&&s&&!c&&l&&!u&&!i;return r&&n&&!d&&this.logInformation(e.xu.InboxCouponsAAUpsellSuppressed,t,fo(fo({},a),{},{isBuildVersionSupported:s,isInboxCouponsSignedIn:c,isPersonalEdgeProfile:l,isPaneOpen:u,isAttainableCoupon:i})),d}createIBCConnectUpsellWrapper(e,t,i,o,a,r){const n=document.createElement("div");n.style.display="flex",n.style.flexDirection="column",n.style.marginTop="25px";const s=this.createIBCConnectUpsellTitle(r);s.style.marginBottom="15px",n.appendChild(s);const c=this.createIBCConnectInboxButton(e,t);return n.appendChild(c),this.logInformation(i,o,a),n}createIBCConnectUpsellTitle(e){const t=document.createElement("h2");return t.innerText=this.platformInstance.GetResourceString(Be.InboxCouponsConnectYourInboxUpsellFindMoreSavingsTitle),e&&(t.innerText=e),t.classList.add("txtMedium"),t.style.fontWeight="600",t.style.fontSize="16px",t}createIBCConnectInboxButton(e,t){const i=document.createElement("button"),o=document.createElement("div");return o.style.display="flex",o.style.justifyContent="center",this.addUpsellButtonContents(o),i.style.height="40px",i.style.width="fit-content",i.style.padding="0 15px",i.style.backgroundColor=this.isDarkTheme?"transparent":"rgba(251,251,251,1)",i.style.borderWidth="1px",i.style.borderStyle="solid",i.style.borderColor=this.isDarkTheme?"rgba(113,113,113,1)":"rgba(214,214,214,1)",i.style.borderRadius="8px",i.style.cursor="pointer",i.appendChild(o),i.addEventListener("click",(async()=>{this.addLoadingStateToButton(i);const o=this.uuidv4();this.openShoppingPane(t,o),await e(o)})),i}openShoppingPane(e,t){this.edgeMessageService.SendOpenPaneMessage(),vi.Z.SendStorageMessage(e,JSON.stringify({value:t}))}async logInformation(t,i,o,a){const n=fo(fo({},this.getMetadata(i,o)),{},{platformInstanceVersion:this.platformInstance.GetVersion(),traceId:a});await this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,`${t} has been logged`,new ht.Z(t,void 0,void 0,(0,r.S8)(),JSON.stringify(n))))}getMetadata(e,t){let i={};try{i=JSON.parse(Ii.Q.InboxCouponsLogsMetadata??"{}")}catch{i={}}return fo(fo({userIdentifier:Ii.Q.InboxCouponsHashedUserId,ibcUserConsent:Ii.Q.InboxCouponsUserConsent,ibcPaneOpen:Ii.Q.InboxCouponsPaneOpen,isMSASignedIn:e&&e.userInfo?e.userInfo.isMSASignedIn:"N/A",isAADSignedIn:e&&e.userInfo?e.userInfo.isAADSignedIn:"N/A"},t),i)}getAAFailureUpsellText(){let e;switch(Pi.R.getServiceExperimentValue(pi.H.inboxCouponsAAFailureUpsell)){case oi.fG.FindMoreSavingsText:e=this.platformInstance.GetResourceString(Be.InboxCouponsConnectYourInboxUpsellFindMoreSavingsTitle);break;case oi.fG.FindPersonalizedCouponsText:e=this.platformInstance.GetResourceString(Be.InboxCouponsConnectYourInboxUpsellFindPersonalizedCouponsTitle)}return e}uuidv4(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}addLoadingStateToButton(e){e.disabled=!0,e.style.cursor="not-allowed";const t=getComputedStyle(e).width,i=this.getButtonContentsWrapper(e);this.clearButtonContentsWrapper(i),this.addUpsellButtonLoadingContents(i),e.style.minWidth=t,setTimeout((()=>{e.disabled=!1,e.style.cursor="pointer",this.clearButtonContentsWrapper(i),this.addUpsellButtonContents(i)}),3e3)}getButtonContentsWrapper(e){return e.getElementsByTagName("div")[0]}clearButtonContentsWrapper(e){for(;e.lastElementChild;)e.removeChild(e.lastElementChild)}addUpsellButtonContents(e){this.createIBCConnectButtonContents().forEach(((t,i)=>{i>0&&(t.style.marginLeft="10px"),e.appendChild(t)}))}createIBCConnectButtonContents(){return[...this.createIBCConnectButtonLogos(),this.createIBCConnectButtonText(Be.InboxCouponsConnectYourInboxButtonTitle)]}addUpsellButtonLoadingContents(e){this.createIBCConnectButtonLoadingContents().forEach(((t,i)=>{i>0&&(t.style.marginLeft="10px"),e.appendChild(t)}))}createIBCConnectButtonLoadingContents(){return[this.createIBCConnectInboxSpinner(),this.createIBCConnectButtonText(Be.InboxCouponsOpeningSidebarLoading,!0)]}createIBCConnectButtonText(e,t=!1){const i=document.createElement("span");return i.innerText=this.platformInstance.GetResourceString(e),i.classList.add("txtMedium"),i.style.marginLeft="10px",i.style.fontWeight="600",i.style.fontSize="14px",i.style.lineHeight="20px",t&&(i.style.color=this.isDarkTheme?"rgb(121, 119, 117)":"rgb(50, 49, 48)",i.style.borderColor=this.isDarkTheme?"rgb(121, 119, 117)":"rgb(50, 49, 48)"),i}createIBCConnectButtonLogos(){return[this.createIBCConnectInboxLogoImg(`${this.flyoutCommonImgPathUrl}/inboxCoupons/common/Gmail_Logo_30X30_3X.png`),this.createIBCConnectInboxLogoImg(`${this.flyoutCommonImgPathUrl}/inboxCoupons/common/Outlook_Logo_30X30_3X.png`)]}createIBCConnectInboxLogoImg(e){const t=document.createElement("img");return t.src=e,t.ariaHidden="true",t.style.width="20px",t.style.height="20px",t}createIBCConnectInboxSpinner(){const e=document.createElement("div");return e.style.boxSizing="border-box",e.style.borderRadius="50%",e.style.borderWidth="1.5px",e.style.borderStyle="solid",e.style.borderColor=this.isDarkTheme?"rgb(40, 153, 245) rgb(0, 76, 135) rgb(0, 76, 135)":"rgb(0, 120, 212) rgb(199, 224, 244) rgb(199, 224, 244)",e.style.borderImage="initial",e.style.width="20px",e.style.height="20px",e.animate({transform:"rotate(360deg)"},{duration:1300,iterations:1/0}),e}}(0,a.Z)(vo,"minimumSupportedEdgeVersion","118.0.2088.46");var Eo,Po,Io,To=vo,Oo=i(79710),yo=class{constructor(e,t,i,o){(0,a.Z)(this,"divIDOverlay",void 0),(0,a.Z)(this,"divIDContextID",void 0),(0,a.Z)(this,"platformInstance",void 0),(0,a.Z)(this,"utilities",void 0),this.utilities=e,this.divIDOverlay=t,this.divIDContextID=i,this.platformInstance=o}async CreateInstantAddToCartOverlay(t,i,o){const a=document.getElementById(this.divIDOverlay);a&&a.remove();const n=this.utilities.CreateOverlayBackground();n.id=this.divIDOverlay;const s=Ze.Z.getTrustedHTML`
        :root {
            --fill: #FFFFFF;
            --text-normal: #1A1A1A;
            --text-grey: #616161;
        }
        p, div, a, button, label {
            font-family: 'Segoe UI', sans-serif;
            font-size: 16px;
            font-weight: 400;
            line-height: 20px;
            color: var(--text-normal);
            margin: 0px;
        }
        #divOverlayWrapper {
            width: 350px;
            height: 227px;
            background: var(--fill);
            font-family: 'Segoe UI', sans-serif;
            border-radius: 4px;
            position: relative;
        }
        #OverlayProgressCheckout {
            width: 200px;
            align-self: center;
            margin-top: 12px;
            margin-bottom: 12px;
            background-color: rgba(0, 0, 0, 0.07);
            border-radius: 8px;
        }
        #divOverlayBar {
            width: 1%;
            height: 8px;
            background: linear-gradient(90deg, #CB5CFF 0%, #35CFFF 50%, #64E816 100%);
            border-radius: 8px;
        }
        .divCommissionValue {
            display: inline-block;
            margin: 0px;
            vertical-align: text-bottom;
        }
        .spanCommissionValue {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 28px;
            line-height: 22px;
            font-size: 20px;
            background: #3267FA;
            border-radius: 6px 0px 0px 6px;
            color: #fff;
            font-weight: 500;
            float: left;
            padding: 0px 1px 0px 6px;
            margin-right: -1px;
        }
        .spanCommissionValueSmall {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 20px;
            line-height: 16px;
            font-size: 12px;
            background: #3267FA;
            border-radius: 4px 0px 0px 4px;
            color: #fff;
            font-weight: 400;
            float: left;
            padding: 0px 2px 0px 4px;
            margin-right: -1px;
        }
        #countdown-wrapper
        {
            width: 30px;
            height: 30px;
            top: 6px;
            right: 6px;
            position: absolute;
        }
        #countdown-container {
            fill: rgb(255, 255, 255);
            left: 50%;
            display: inline;
            top: 50%;
            background: transparent;
            border: unset;
            cursor: pointer;
            transform: translate(-50%, -50%);
            padding:0;
            position: absolute;
        }
        #countdown-svg {
            width: 30px;
            height: 30px;
            display:block;
            margin:auto;
            transform: rotateY(-180deg) rotateZ(-90deg) scale(1,-1);
        }
        #countdown-circle {
            stroke-dasharray: 81.6px;
            stroke-dashoffset: 0px;
            stroke-linecap: round;
            stroke-width: 1.3px;
            stroke: #4F94D3;
            fill: none;
            animation: countdown 10s linear 1 forwards;
        }
        #back-countdown-circle {
            stroke-dasharray: 81.6px;
            stroke-dashoffset: 0px;
            stroke-linecap: round;
            stroke-width: 1px;
            stroke: #afacac;
            fill: none;
        }
        @keyframes countdown {
            from {
                stroke-dashoffset: 81.6px;
            }
            to {
                stroke-dashoffset: 0px;
            }
        }
        @media (-ms-high-contrast: active) {
            #flyoutClose {
                fill: ButtonText;
            }
            #shopping-tag-icon path {
                d: path("M12 5C12.5523 5 13 4.55228 13 4C13 3.44772 12.5523 3 12 3C11.4477 3 11 3.44772 11 4C11 4.55228 11.4477 5 12 5ZM9.12922 \
                4.30281e-05C8.59514 -0.00345791 8.08184 0.206807 7.7037 0.583987L1.02216 7.24852C0.239412 8.02928 0.238604 9.297 1.02036 \
                10.0788L5.96875 15.0271C6.7498 15.8082 8.01613 15.8082 8.79718 15.0271L15.428 8.39633C15.8038 8.02054 16.0146 7.51063 16.0138 \
                6.97917L16.0065 2.02911C16.0049 0.930807 15.1179 0.0393006 14.0196 0.032101L9.12922 4.30281e-05ZM8.4099 1.29199C8.59897 1.1034\
                8.85562 0.998271 9.12266 1.00002L14.013 1.03208C14.5622 1.03568 15.0057 1.48143 15.0065 2.03058L15.0138 6.98065C15.0142 7.24637\
                14.9088 7.50133 14.7209 7.68923L8.09007 14.32C7.69955 14.7106 7.06638 14.7106 6.67586 14.32L1.72746 9.37164C1.33659 8.98077 1.33699 \
                8.34691 1.72836 7.95653L8.4099 1.29199Z");
                fill: ButtonText;
                transform: scale(0.85);
            }
            #countdown-circle{
                stroke: Text;
            }
            #back-countdown-circle {
                display: none;
            }
        }
        #instantATCContent {
            display: flex;
            flex-direction: column;
            row-gap: 10px;
            padding-top: 10px;
            border-radius: 4px;
        }
        #close {
            margin-right: 0px;
            margin-left: auto;
            margin-bottom: -10px;
            background: var(--fill);
            border: none;
            width: fit-content;
            cursor: pointer;
        }
        #instantATCTitle {
            font-weight: 600;
            font-size: 20px;
            line-height: 27px;
        }
        #couponWrapper {
            border: 1px solid #EBEBEB;
            border-radius: 8px;
            background: #FFFFFF;
        }
    `,c=(0,Oo.Ux)("style",{type:"text/css",rel:"stylesheet"},s);n.append(c);const l=document.createElement("div");l.id=this.divIDContextID,l.hidden=!0,l.innerText=t.toString(),n.appendChild(l);const u=(0,Oo.Ux)("div",{id:"divOverlayWrapper"}),d=(0,Oo.Ux)("div",{id:"divOverlayBar"}),h=(0,Oo.Ux)("div",{id:"OverlayProgressCheckout"});h.appendChild(d),o&&(u.style.backgroundColor="rgba(80,80,80,0.8)"),this.SetInitialProgressBar(1,"divOverlayBar");const p=this.CreateCashbackRewardTitle(i,Be.instantAddToCartDialogueTitle);p.id="instantATCProgressTitle",o&&(p.style.color="#FFFFFF");const g=(0,Oo.Ux)("IMG");g.id="cartIcon",g.src="https://www.bing.com/api/shopping/v1/ux/images/instantATC/inprogress_Cart.svg",g.style.marginLeft="auto",g.style.marginRight="auto",g.style.marginTop="20px";const C=(0,Oo.Ux)("div",{id:"instantATCContent"});C.append(g,h,p),u.append(this.timerCloseButton(),C),n.append(u);const S=document.getElementsByTagName("html")[0];S&&S.appendChild(n),document.body&&document.body.setAttribute("aria-hidden","true"),this.utilities.SendViewedTelemetry(go.r.INSTANT_ADD_TO_CART_OVERLAY),await this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,"Instant ATC Creation Overlay Shown",new ht.Z(e.xu.InstantATCCreationOverlay,void 0,void 0,(0,r.S8)())))}CreateSuccessInstantATCOverlay(t,i){const o=document.querySelector("#divOverlayWrapper");if(o){const a=o.querySelector("#successTitle"),n=o.querySelector("#cancelButton");if(a)return;const s=o.querySelector("#cartIcon"),c=o.querySelector("#instantATCContent");o.querySelector("#instantATCProgressTitle").style.display="none",s.src="https://www.bing.com/api/shopping/v1/ux/images/instantATC/success_Cart.svg",o.querySelector("#OverlayProgressCheckout").style.display="none";const l=this.CreateCashbackRewardTitle(t,Be.instantAddToCartSuccessTitle);l.id="successTitle",l.style.width="292px",l.style.height="53px",i&&(l.style.color="#FFFFFF"),a||c.appendChild(l);const u=document.createElement("button");u.id="cancelButton",u.style.borderRadius="4px",u.style.height="32px",u.style.width="155px",u.style.marginLeft="auto",u.style.marginRight="auto",u.textContent="OK",u.style.backgroundColor="rgba(33, 105, 235, 1)",u.style.color="white",u.style.fontFamily="Segoe UI",u.style.fontWeight="600",u.style.fontSize="14px",u.style.lineHeight="20px",u.style.borderColor="transparent",u.style.padding="5px 12px 5px 12px",u.addEventListener("click",(()=>{this.CloseOverlay()})),n||c.appendChild(u),this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,"Instant ATC Success Overlay Shown",new ht.Z(e.xu.InstantATCSuccessOverlay,void 0,void 0,(0,r.S8)())))}}timerCloseButton(e=6){const t=(0,Oo.Ux)("button");t.id="countdown-container",t.innerHTML=Ze.Z.getTrustedHTML`
        <svg id="countdown-svg" aria-hidden="true">
            <circle r="13" cx="15" cy="15" id="back-countdown-circle"></circle>
            <circle r="13" cx="15" cy="15" id="countdown-circle"></circle>
        </svg>
    `,t.title="Close",t.setAttribute("aria-label","Close"),t.addEventListener("click",(()=>{this.CloseOverlay()}));const i=(0,Oo.Ux)("div");i.id="countdown-wrapper",i.appendChild(t),i.setAttribute("aria-labelledby","countdown-container");const o=i.querySelector("#countdown-circle");o.style.animationDuration=`${e}s`,o.setAttribute("aria-hidden","true");const a=(0,Oo.Ux)("span");a.innerHTML=Ze.Z.getTrustedHTML`<svg id="flyoutClose" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
    <path d="M0.0885911 0.215694L0.146447 0.146447C0.320013 -0.0271197 0.589437 -0.046405 0.784306 0.0885911L0.853553 0.146447L6 5.293L11.1464 0.146447C11.32 -0.0271197 11.5894 -0.046405 11.7843 0.0885911L11.8536 0.146447C12.0271 0.320013 12.0464 0.589437 11.9114 0.784306L11.8536 0.853553L6.707 6L11.8536 11.1464C12.0271 11.32 12.0464 11.5894 11.9114 11.7843L11.8536 11.8536C11.68 12.0271 11.4106 12.0464 11.2157 11.9114L11.1464 11.8536L6 6.707L0.853553 11.8536C0.679987 12.0271 0.410563 12.0464 0.215694 11.9114L0.146447 11.8536C-0.0271197 11.68 -0.046405 11.4106 0.0885911 11.2157L0.146447 11.1464L5.293 6L0.146447 0.853553C-0.0271197 0.679987 -0.046405 0.410563 0.0885911 0.215694L0.146447 0.146447L0.0885911 0.215694Z"/>
    </svg>`,a.style.fill="#808080",a.setAttribute("aria-hidden","true");const r=a.querySelector("#flyoutClose");r.style.position="absolute",r.style.top="50%",r.style.left="50%",r.style.transform="translate(-50%,-50%)",t.appendChild(a);const n=document.querySelector("html");return n&&(n.style.overflow="hidden"),i}CloseOverlay(){const e=document.querySelector("#"+this.divIDOverlay);e&&e.remove()}CreateCashbackRewardTitle(e,t){const i={commissionType:"$",commissionValue:`${e}`,category:void 0,isRebatesSupportedDomain:null,isRebatesUser:!0,merchantName:void 0,highestCashbackCategory:void 0},o=document.createElement("DIV"),a=this.platformInstance.GetResourceString(t),n=this.createCommissionArrow(i,!0);return n.style.verticalAlign="middle",(0,r.B7)(o,a,n),o.style.fontSize="18px",o.style.fontWeight="600",o.style.lineHeight="26px",o.style.alignContent="center",o.style.width="224px",o.style.fontFamily="Segoe UI",o.style.marginLeft="auto",o.style.marginRight="auto",o.style.textAlign="center",o}SetInitialProgressBar(e,t){const i=document.querySelector(t);i&&(i.style.width=e+"%")}createCommissionArrow(e,t,i){const o=(0,Oo.Ux)("div",{className:"imgCBTag"});o.innerHTML=i?ze():Qe(),o.setAttribute("aria-hidden","true"),o.style.float="left",o.style.display="block";const a=(0,Oo.Ux)("span",{role:"group"});a.className=i?"spanCommissionValueSmall":"spanCommissionValue";const r=(0,Oo.Ux)("div",{className:"divCommissionValue"});if(r.append(a,o),e.commissionValue&&e.commissionType)if(t){const t=(0,Oo.Ux)("span");t.textContent=(0,be.Jl)("$"),t.style.fontSize=i?"8px":"10px",t.style.position="relative",t.style.bottom="0.3ex";const o=`${e.commissionValue}`.split(".");1===o.length&&o.push("00");const r=(0,Oo.Ux)("span");r.style.fontSize=i?"12px":"16px",r.textContent=o[0];const n=(0,Oo.Ux)("span");n.textContent=o[1],n.style.fontSize=i?"8px":"10px",n.style.position="relative",n.style.bottom="0.3ex",a.append(t,r,n),a.setAttribute("aria-label",`${t.textContent}${o[0]}.${o[1]}`)}else{const t="%";e.commissionType===t?a.textContent=e.commissionValue+t:a.textContent=e.commissionType+e.commissionValue}return r}},Do=i(93209),bo=i(21908),No=Object.prototype,Ro=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||No)},_o=(Eo=Object.keys,Po=Object,function(e){return Eo(Po(e))}),ko=Object.prototype.hasOwnProperty,wo="object"==typeof global&&global&&global.Object===Object&&global,xo="object"==typeof self&&self&&self.Object===Object&&self,Uo=wo||xo||Function("return this")(),Mo=Uo.Symbol,Lo=Object.prototype,Bo=Lo.hasOwnProperty,Fo=Lo.toString,Zo=Mo?Mo.toStringTag:void 0,Go=Object.prototype.toString,Ho=Mo?Mo.toStringTag:void 0,Vo=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ho&&Ho in Object(e)?function(e){var t=Bo.call(e,Zo),i=e[Zo];try{e[Zo]=void 0;var o=!0}catch(e){}var a=Fo.call(e);return o&&(t?e[Zo]=i:delete e[Zo]),a}(e):function(e){return Go.call(e)}(e)},Wo=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ko=function(e){if(!Wo(e))return!1;var t=Vo(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},zo=Uo["__core-js_shared__"],Qo=(Io=/[^.]+$/.exec(zo&&zo.keys&&zo.keys.IE_PROTO||""))?"Symbol(src)_1."+Io:"",jo=Function.prototype.toString,Yo=function(e){if(null!=e){try{return jo.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Jo=/^\[object .+?Constructor\]$/,Xo=Function.prototype,qo=Object.prototype,$o=Xo.toString,ea=qo.hasOwnProperty,ta=RegExp("^"+$o.call(ea).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ia=function(e){return!(!Wo(e)||function(e){return!!Qo&&Qo in e}(e))&&(Ko(e)?ta:Jo).test(Yo(e))},oa=function(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return ia(i)?i:void 0},aa=oa(Uo,"DataView"),ra=oa(Uo,"Map"),na=oa(Uo,"Promise"),sa=oa(Uo,"Set"),ca=oa(Uo,"WeakMap"),la="[object Map]",ua="[object Promise]",da="[object Set]",ha="[object WeakMap]",pa="[object DataView]",ga=Yo(aa),Ca=Yo(ra),Sa=Yo(na),ma=Yo(sa),Aa=Yo(ca),fa=Vo;(aa&&fa(new aa(new ArrayBuffer(1)))!=pa||ra&&fa(new ra)!=la||na&&fa(na.resolve())!=ua||sa&&fa(new sa)!=da||ca&&fa(new ca)!=ha)&&(fa=function(e){var t=Vo(e),i="[object Object]"==t?e.constructor:void 0,o=i?Yo(i):"";if(o)switch(o){case ga:return pa;case Ca:return la;case Sa:return ua;case ma:return da;case Aa:return ha}return t});var va=fa,Ea=function(e){return null!=e&&"object"==typeof e},Pa=function(e){return Ea(e)&&"[object Arguments]"==Vo(e)},Ia=Object.prototype,Ta=Ia.hasOwnProperty,Oa=Ia.propertyIsEnumerable,ya=Pa(function(){return arguments}())?Pa:function(e){return Ea(e)&&Ta.call(e,"callee")&&!Oa.call(e,"callee")},Da=ya,ba=Array.isArray,Na=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ra="object"==typeof exports&&exports&&!exports.nodeType&&exports,_a=Ra&&"object"==typeof module&&module&&!module.nodeType&&module,ka=_a&&_a.exports===Ra?Uo.Buffer:void 0,wa=(ka?ka.isBuffer:void 0)||function(){return!1},xa={};xa["[object Float32Array]"]=xa["[object Float64Array]"]=xa["[object Int8Array]"]=xa["[object Int16Array]"]=xa["[object Int32Array]"]=xa["[object Uint8Array]"]=xa["[object Uint8ClampedArray]"]=xa["[object Uint16Array]"]=xa["[object Uint32Array]"]=!0,xa["[object Arguments]"]=xa["[object Array]"]=xa["[object ArrayBuffer]"]=xa["[object Boolean]"]=xa["[object DataView]"]=xa["[object Date]"]=xa["[object Error]"]=xa["[object Function]"]=xa["[object Map]"]=xa["[object Number]"]=xa["[object Object]"]=xa["[object RegExp]"]=xa["[object Set]"]=xa["[object String]"]=xa["[object WeakMap]"]=!1;var Ua="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ma=Ua&&"object"==typeof module&&module&&!module.nodeType&&module,La=Ma&&Ma.exports===Ua&&wo.process,Ba=function(){try{return Ma&&Ma.require&&Ma.require("util").types||La&&La.binding&&La.binding("util")}catch(e){}}(),Fa=Ba&&Ba.isTypedArray,Za=Fa?function(e){return function(t){return e(t)}}(Fa):function(e){return Ea(e)&&Na(e.length)&&!!xa[Vo(e)]},Ga=Object.prototype.hasOwnProperty,Ha=function(e){if(null==e)return!0;if(function(e){return null!=e&&Na(e.length)&&!Ko(e)}(e)&&(ba(e)||"string"==typeof e||"function"==typeof e.splice||wa(e)||Za(e)||Da(e)))return!e.length;var t=va(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Ro(e))return!function(e){if(!Ro(e))return _o(e);var t=[];for(var i in Object(e))ko.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e).length;for(var i in e)if(Ga.call(e,i))return!1;return!0};class Va{constructor(){(0,a.Z)(this,"progress",void 0),(0,a.Z)(this,"max",void 0),(0,a.Z)(this,"activityrewards",void 0)}static Create(e){const t=new Va;return t.progress=e?.progress,t.max=e?.max,t.activityrewards=e?.activity_rewards,t}}var Wa=Va;class Ka{constructor(){(0,a.Z)(this,"name",void 0),(0,a.Z)(this,"attributes",void 0)}static Create(e){const t=new Ka;return t.name=e?.name,t.attributes=Wa.Create(e?.attributes),t}}var za=Ka;class Qa{constructor(){(0,a.Z)(this,"isRewardsUser",void 0),(0,a.Z)(this,"isAutoEnrolled",void 0),(0,a.Z)(this,"usedPoints",void 0),(0,a.Z)(this,"maxPoints",void 0),(0,a.Z)(this,"rewardPoints",void 0),(0,a.Z)(this,"promotions",[])}static Create(e){const t=new Qa;if(!e)return t;if(t.isRewardsUser=e.isRewardsUser,t.isAutoEnrolled=e.isAutoEnrolled,!e.promotions)return t;t.promotions=[];for(const i of e.promotions)t.promotions.push(za.Create(i));for(const e of t.promotions)if(e.name===Qa.MsRewards){if(!(e.attributes?.progress&&e.attributes?.max&&e.attributes?.activityrewards))break;t.usedPoints=e.attributes.progress,t.maxPoints=e.attributes.max,t.rewardPoints=e.attributes.activityrewards}return t}isValidRewardsData(){return!!(this.usedPoints&&this.maxPoints&&this.rewardPoints&&this.isRewardsUser)}}(0,a.Z)(Qa,"MsRewards","coupons_50points_202403"),(0,a.Z)(Qa,"StorageKeyPrefix","IS_ELIGIBLE_FOR_REWARDS_");var ja=Qa,Ya=i(73765);class Ja{static ProcessMessage(e){const t=e,i=Ja.GetResponse(t,Ja.GetInterface(t));return i.ID=t.ID,i}static GetInterface(t){return Ja.overlayMessages.has(t.Type)?Ja.eoi:t.Type===e.Vm.SelectorExtractionMessage?Ja.sei:Ja.cpi}static GetResponse(e,t){try{return t.HandleMessage(e)}catch(e){return(0,r.Md)(e.message)}}}(0,a.Z)(Ja,"overlayMessages",new Set([e.Vm.CloseOverlayMessage,e.Vm.UpdateCurrentCouponMessage,e.Vm.MoveProgressBarMessage,e.Vm.EdgeCreateOverlayMessage,e.Vm.EdgeShowResultMessage,e.Vm.UpdateCurrencyMessage,e.Vm.CheckoutProgressMessage,e.Vm.ECCreateOverlayMessage,e.Vm.ECShowResultMessage,e.Vm.ECCreateUpdatePaymentOverlayMessage,e.Vm.PrintableGroceryCouponsMessage,e.Vm.WalletDrawerCreateOverlayMessage,e.Vm.WalletDrawerCloseMessage,e.Vm.WalletDrawerSkipCouponMessage,e.Vm.InstantAddToCartMessage,e.Vm.SuccessInstantAddToCartMessage])),(0,a.Z)(Ja,"cpi",new Ie(Ue.GetPlatformInstance())),(0,a.Z)(Ja,"eoi",new class extends rt{constructor(i,o,n){super(i),(0,a.Z)(this,"negativeTitlePath","#txtResultNegativeTitle"),(0,a.Z)(this,"negativeCashbackUpsellTitlePath","#txtResultNegativeCashbackUpsellTitle"),(0,a.Z)(this,"negativeDetailsPath","#txtResultNegativeDetails"),(0,a.Z)(this,"negativeCashbackHeader","#txtResultNegativeCashbackHeader"),(0,a.Z)(this,"negativeCashbackHeaderText","#txtResultNegativeCashbackHeaderText"),(0,a.Z)(this,"negativeCashbackOfferDetails","#txtResultNegativeCashbackOfferDetails"),(0,a.Z)(this,"negativeCashbackUpsellDetails","#txtResultNegativeCashbackUpsellDetails"),(0,a.Z)(this,"negativeCashbackUpsellPrivacyPath","#txtCashbackUpsellPrivacyTerms"),(0,a.Z)(this,"errorTitlePath","#txtResultErrorTitle"),(0,a.Z)(this,"errorDetailsPath","#txtResultErrorDetails"),(0,a.Z)(this,"resultCouponDetailsPath","#txtResultPositiveCouponDetails"),(0,a.Z)(this,"resultCashBackDetailsPath","#txtResultPositiveCashBackDetails"),(0,a.Z)(this,"shortcircuitTitlePath","#txtResultShortcircuitTitle"),(0,a.Z)(this,"shortcircuitDetailsPath","#txtResultShortcircuitDetails"),(0,a.Z)(this,"shortcircuitCouponCodePath","#txtResultShortcircuitCouponCode"),(0,a.Z)(this,"shortcircuitCouponDescPath","#txtResultShortcircuitCouponDesc"),(0,a.Z)(this,"shortcircuitCalltoActionPath","#txtResultShortcircuitCalltoAction"),(0,a.Z)(this,"shortcircuitCouponBtnPath","#btnResultShortcircuitCoupon"),(0,a.Z)(this,"iconImgPath",".imgOverlayExtensionIcon"),(0,a.Z)(this,"divImportCheckBox","divImportCheckbox"),(0,a.Z)(this,"divJoinRebates","#divJoinRebates"),(0,a.Z)(this,"useBingRebatesPath","#btnOverlayRebates"),(0,a.Z)(this,"cashbackUpsellJoinNowPath","#btnJoinAndActivate"),(0,a.Z)(this,"sharePath","#divOverlayShare"),(0,a.Z)(this,"shareFBPath","#btnOverlayShareFB"),(0,a.Z)(this,"shareTwitterPath","#btnOverlayShareTwitter"),(0,a.Z)(this,"storeNamePath","#txtStore"),(0,a.Z)(this,"divOverlayHide","divOverlayHide"),(0,a.Z)(this,"divOverlayInlineShow","divOverlayInlineShow"),(0,a.Z)(this,"divOverlayGridShow","divOverlayGridShow"),(0,a.Z)(this,"divOverlayFooterPath",".divOverlayFooter"),(0,a.Z)(this,"divOverlayResultCheckoutDetailsPath","#divOverlayResultCheckoutDetails"),(0,a.Z)(this,"divOverlayResultNegativePath","#divOverlayResultNegative"),(0,a.Z)(this,"divOverlayResultCheckoutTitle","#divOverlayResultCheckoutTitle"),(0,a.Z)(this,"bnplTotalAmountContainerPath","#bnplTotalAmountContainer"),(0,a.Z)(this,"bnplErrorTextPath","#bnplErrorText"),(0,a.Z)(this,"bnplLogo",".bnplLogo"),(0,a.Z)(this,"bnplLogoSvg",".bnplLogo svg"),(0,a.Z)(this,"bnplTitlePath",".bnplTitle"),(0,a.Z)(this,"bnplSubTitlePath",".bnplSubTitle"),(0,a.Z)(this,"bnplFeeDescriptionPath",".bnplFeeDescription"),(0,a.Z)(this,"bnplShoppingCartValuePath",".bnplShoppingCartValue"),(0,a.Z)(this,"bnplCartValueInputPath",".bnplCartValueInput"),(0,a.Z)(this,"bnplErrorMsgContainerPath",".bnplErrorMsgContainer"),(0,a.Z)(this,"bnplAmountReminderPath",".bnplAmountReminder"),(0,a.Z)(this,"bnplMsDescription",".bnplMsDescription"),(0,a.Z)(this,"bnplLicenseTextPath",".bnplLicenseText"),(0,a.Z)(this,"bnplContinueButtonPath","#bnplContinueButton"),(0,a.Z)(this,"bnplTotalAmountFooterPath",".bnplTotalAmountFooter"),(0,a.Z)(this,"bnplTopBannerSection",".bnpl-top-banner-section"),(0,a.Z)(this,"bnplTopBannerContent","#bnpl-top-banner-content"),(0,a.Z)(this,"attIconPromptPos","#iconPromptPos"),(0,a.Z)(this,"attIconPromptNeg","#iconPromptNeg"),(0,a.Z)(this,"infoIconPath","#infoIcon"),(0,a.Z)(this,"flyoutCommonImgPathUrl","https://www.bing.com/api/shopping/v1/ux/images"),(0,a.Z)(this,"animationQuery",window&&window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null),(0,a.Z)(this,"overlay",void 0),(0,a.Z)(this,"focusTestingTrap",void 0),(0,a.Z)(this,"focusResultTrap",void 0),(0,a.Z)(this,"finalAmountWithAA",void 0),(0,a.Z)(this,"cashbackUpsellBlockedDomains",e.ZT),(0,a.Z)(this,"localDataService",void 0),(0,a.Z)(this,"edgeMessageService",void 0),(0,a.Z)(this,"utilities",void 0),(0,a.Z)(this,"inboxCouponsInjectedUtils",void 0),(0,a.Z)(this,"checkoutPageUrlData",void 0),(0,a.Z)(this,"cancelListenerCallback",void 0),this.localDataService=o,this.edgeMessageService=n,this.utilities=new class{constructor(e){(0,a.Z)(this,"divIDOverlay","divOverlayWrapper"),(0,a.Z)(this,"divIDContextID","contextID"),(0,a.Z)(this,"platformInstance",void 0),(0,a.Z)(this,"darkThemeQuery",window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null),this.platformInstance=e}IsDarkTheme(){return this.darkThemeQuery?.matches??!1}OnDarkThemeChange(e){this.darkThemeQuery?.addEventListener?.("change",(t=>{e(t.matches)}))}async SendClickTelemetry(i,o,a,n,s){const c=new fe(e.R.ButtonClick,s?e.in.Error:e.in.Information,i,new Do.Z(o,go.r.EDGE_OVERLAY,(0,r.S8)()));await this.platformInstance.SendMessage(c),a&&t.a.postMessageToHost("recordAsUserAction",[a]),n&&t.a.postMessageToHost("recordAsUserEngagement",[n])}async SendViewedTelemetry(t){const i=(0,r.S8)();await this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,t,new ht.Z(e.xu.ModuleViewed,void 0,void 0,i)))}TrapFocus(e,t=document){const i=[...t.querySelectorAll("\n        a, button, input, select, textarea, svg, area, details, summary,\n        iframe, object, embed,\n        [tabindex], [contenteditable]\n        ")].filter((t=>!e.contains(t)&&"-1"!==t.getAttribute("tabindex")&&t.offsetHeight>0));return i.forEach((e=>e.setAttribute("tabindex","-1"))),bo.Z.getInstance().initialize(e,!0),{release(){i.forEach((e=>e.removeAttribute("tabindex"))),bo.Z.getInstance().removeListeners()}}}AddFavIconSrc(e,t,i){const o=this.GetFavIconSrc(i);e.style.maxWidth="16px",e.slot="icon",e.setAttribute("aria-hidden","true"),e.addEventListener("error",(()=>{e.remove()})),o&&(e.src=o)}GetFavIconSrc(t,i=16){return t?(t=(t=t.replace("http://","")).replace("https://",""),this.platformInstance.GetAppInfoClientName()===e.BN.Edge?`https://edge.microsoft.com/favicon/v1/?client=chrome_desktop&nfrp=2&check_seen=true&size=${i}&fallback_opts=TYPE,SIZE,URL&url=http://${t}&origin=shoppingv2`:dt.jb.includes(this.platformInstance.GetAppInfoClientName())?`https://${t}/favicon.ico`:`edge://favicon2/?size=16&scale_factor=1x&page_url=http://${t}&allow_google_server_fallback=1`):""}GetLocalizedText(e){return this.platformInstance.GetResourceString(e)}UpdateLocalizedText(e,t,i){const o=this.platformInstance.GetResourceString(i)||i,a=e.querySelector(t);a&&(a.innerText=o)}UpdateText(e,t,i){const o=e.querySelector(t);o&&(o.innerText=i)}CreateOverlayBackground(){return(0,Oo.Ux)("div",{id:"divOverlayBackground",title:"Edge Shopping",style:"\n                width: 100%;\n                height: 100%;\n                top: 0;\n                left: 0;\n                right: 0;\n                bottom: 0;\n                position: fixed;\n                display: flex;\n                justify-content: center;\n                align-items: center;\n                background-color: rgba(80,80,80,0.8);\n                z-index: 3000000000;\n            "})}CreateOverlayDiv(e){const t=document.getElementById(this.divIDOverlay);if(t){if(e){const i=t.shadowRoot,o=i?.getElementById(e);if(o)return}t.remove()}const i=document.createElement("div");return i.id=this.divIDOverlay,i}CreateOverlayID(e){return(0,Oo.Ux)("div",{id:this.divIDContextID,hidden:!0,innerText:e.toString()})}OverlayPostProcessing(e){const t=document.getElementsByTagName("html")[0];t&&t.appendChild(e),document.body&&document.body.setAttribute("aria-hidden","true")}}(i),this.inboxCouponsInjectedUtils=new To(this.platformInstance,this.edgeMessageService,this.flyoutCommonImgPathUrl,this.utilities.IsDarkTheme())}HandleMessage(t){try{const i=t.Type;if(i!==e.Vm.EdgeCreateOverlayMessage&&i!==e.Vm.WalletDrawerCreateOverlayMessage&&i!==e.Vm.CloseOverlayMessage&&i!==e.Vm.WalletDrawerCloseMessage){if(rt.isAutoApplyCancelled)return new Mt.Z("Auto Apply cancelled",Me.AutoApplyCancelled);if(rt.isAutoApplySkipped)return new Mt.Z("Auto Apply skipped",Me.AutoApplySkipped);if(rt.isAutoApplyPaused&&i!==e.Vm.EdgeShowResultMessage)return new Mt.Z("Auto Apply paused",Me.AutoApplyPaused)}if(i===e.Vm.EdgeCreateOverlayMessage){rt.isAutoApplyCancelled=!1,rt.isAutoApplyCompleted=!1,rt.isAutoApplyPaused=!1,rt.isAutoApplySkipped=!1;const e=t;this.checkoutPageUrlData=e.retailerData,this.CreateOverlay(e.InnerHTML,e.CurrentCoupon,e.CurrentCouponIndex,e.TotalCoupons,e.ProgBarStart,e.ProgBarEnd,e.ContextID,e.CurrentBestDiscount,e.inlineCSS,e.bgAAScenario)}else if(i===e.Vm.EdgeShowResultMessage){rt.isAutoApplyCompleted=!0;const e=t;this.ShowResult(e.Result,e.Discount,e.OriginalPrice,e.BestCoupon,e.cashBackInfo,e.IsStackable,e.coupons,e.isShortcircuit,e.rewardsData)}else if(i===e.Vm.UpdateCurrentCouponMessage){const e=t;this.UpdateCurrentCoupon(e.CurrentCoupon,e.CurrentCouponIndex,e.TotalCoupons,e.CurrentBestDiscount,e.IsSuggestedCoupon)}else if(i===e.Vm.CheckoutProgressMessage){const e=t;this.HandleCheckoutProgress(e)}else if(t.Type===e.Vm.ECCreateOverlayMessage){const e=t;this.ECCreateOverlay(e.ContextID,e.InlineHtml,e.InlineCSS,e.IsAutoApplyIncluded,e.checkoutProgress)}else if(t.Type===e.Vm.ECShowResultMessage){const e=t;this.ECShowResult(e.BestCoupon,e.InitialPrice,e.MaxDiscount,e.IsAutoApplyIncluded,e.CheckoutProgress)}else if(t.Type===e.Vm.ECCreateUpdatePaymentOverlayMessage){const e=t;this.ECCreateUpdatePaymentOverlay(e.ContextID,e.InlineHtml,e.InlineCSS)}else if(t.Type===e.Vm.PrintableGroceryCouponsMessage){const e=t;new class{constructor(e,t){(0,a.Z)(this,"focusTrap",void 0),(0,a.Z)(this,"utilities",void 0),(0,a.Z)(this,"edgeMessageService",void 0),this.utilities=e,this.edgeMessageService=t}CreatePrintableGroceryCouponsOverlay(e,t){const i=this.utilities.CreateOverlayDiv(),o=this.utilities.CreateOverlayBackground();if(!i)return;const a=i.attachShadow({mode:"open",delegatesFocus:!0}),r=document.createElement("div");r.setAttribute("style","width: 85%;\n            height: 65%;\n            max-width: 1000px;\n            max-height: 800px;\n            margin: auto;\n            ");const n=document.createElement("button");n.id="groceryCloseButton",n.textContent="X",n.setAttribute("aria-label","close"),n.setAttribute("style","content: 'x';\n            color: #fff;\n            cursor: pointer;\n            font-weight: 300;\n            font-size: 24px;\n            float: right;\n            font-family: Arial, sans-serif;\n        "),r.appendChild(n);const s=document.createElement("iframe");s.setAttribute("style","width: 100%;\n            height: 100%;\n            color: #fff;\n            background: #fff;\n            max-width: 1000px;\n            max-height: 800px;\n            margin: auto;\n            "),s.src=t,s.className="printDialogWrapper",r.appendChild(s),a.appendChild(r);const c=this.utilities.CreateOverlayID(e);i.appendChild(c),i.appendChild(o);const l=document.getElementsByTagName("html")[0];l&&l.appendChild(i),i.focus(),n.addEventListener("click",(e=>{i.remove(),this.focusTrap&&this.focusTrap.release()})),this.focusTrap=this.utilities.TrapFocus(r),document.body&&document.body.setAttribute("aria-hidden","true"),window.addEventListener("message",(e=>{if("https://www.coupons.com"===e.origin)switch(JSON.parse(e.data).action){case"securePrintCoupons":case"printCoupons":i.remove(),this.edgeMessageService.SendPrintCouponsCompleteMessage()}})),document.addEventListener("click",(e=>{e?.target&&e?.target===i&&(i.remove(),this.focusTrap&&this.focusTrap.release())})),window.addEventListener("keydown",(e=>{"Escape"===e.key&&e?.target&&e?.target===i&&(i.remove(),this.focusTrap&&this.focusTrap.release())}))}}(this.utilities,this.edgeMessageService).CreatePrintableGroceryCouponsOverlay(e.ContextID,e.IFrameSrc)}else if(t.Type===e.Vm.WalletDrawerCreateOverlayMessage){rt.isAutoApplyCancelled=!1;const e=t;this.WalletDrawerCreateOverlay(e.ContextID)}else if(t.Type===e.Vm.WalletDrawerCloseMessage){const e=t;this.CloseWalletDrawer(e.IsStopProgress)}else if(t.Type===e.Vm.WalletDrawerSkipCouponMessage)this.WalletDrawerSkipCoupon();else if(t.Type===e.Vm.InstantAddToCartMessage){const e=t,i=e.GroceryAddToCartData,o=this.utilities.IsDarkTheme();new yo(this.utilities,this.divIDOverlay,this.divIDContextID,this.platformInstance).CreateInstantAddToCartOverlay(e.ContextID,+i?.value,o)}else{if(t.Type!==e.Vm.SuccessInstantAddToCartMessage)return super.HandleMessage(t);{const e=t.GroceryAddToCartData,i=this.utilities.IsDarkTheme();new yo(this.utilities,this.divIDOverlay,this.divIDContextID,this.platformInstance).CreateSuccessInstantATCOverlay(+e?.value,i)}}}catch(e){return(0,r.Md)(e.message)}return new ie}addListenerCancelOverlay(e,t,i){e&&(this.cancelListenerCallback=async()=>{document.body&&(document.body.setAttribute("aria-hidden","false"),this.focusTestingTrap&&this.focusTestingTrap.release());const e=this.GetShadowOverlay();t&&e&&(this.localDataService.IsFeatureEnabled(It.expressCheckout)&&this.localDataService.SaveLocalData(Ne.Q.ExpressCheckoutState,V.CancelEC),rt.isAutoApplyCompleted||rt.isAutoApplyCancelled?this.sendCompletionMessages(e):(rt.isAutoApplyCancelled=!0,i?await this.platformInstance.SendMessage(new ot(this.getContextID(this.divIDContextID),location.hostname,location.pathname)):await this.platformInstance.SendMessage(new tt(this.getContextID(this.divIDContextID),location.hostname,location.pathname))),this.setCouponTextToCancelling(e))},e.forEach((e=>{e.addEventListener("click",this.cancelListenerCallback)})))}addListenerCloseOverlay(e,t,i,o,a){i||(i=this.checkoutPageUrlData),t&&t.addEventListener("click",(a=>this.handleCloseOverlay(e,t,i,o)),!1),a&&window.addEventListener("click",(e=>{const t=this.GetShadowOverlay();if(t){const o=this.selectElement(t,this.resultPath),a=e.composedPath();a&&a.indexOf(o)<0&&this.handleCloseOverlay(this.overlay,void 0,i,void 0,!0)}}))}async handleCloseOverlay(i,o,a,r,n){if(document.body&&(document.body.setAttribute("aria-hidden","false"),this.focusResultTrap&&this.focusResultTrap.release(),this.focusTestingTrap&&this.focusTestingTrap.release()),i){const i=this.GetShadowOverlay();if(i){let s=n?e.$S.OutsideAAOverlayClick:e.$S.Unknown;if(o?.id===this.divIDCloseOverlay.replace("#","")){const o=this.selectElement(i,this.useBingRebatesPath),n=this.selectElement(i,"#"+this.divImportCheckBox);if(s=e.$S.ProceedToCheckout,r){const i=r.querySelector('input[name="savingsType"]:checked'),o=i?.value;"cashback"===o?(this.UseRebatesClickHandler(a),s=e.$S.UseRebates):(t.a.postMessageToHost(u.AutoApplyOptionsStatus,[d.UseCoupon]),s=e.$S.UseCoupon)}else n?n.checked?(t.a.postMessageToHost(u.ImportWhileCheckout,[]),s=e.$S.ProceedToCheckoutWithImport):s=e.$S.ProceedToCheckoutWithOutImport:o&&"none"!==o.style.display&&(t.a.postMessageToHost(u.AutoApplyOptionsStatus,[d.UseCoupon]),s=e.$S.UseCoupon)}else o?.id===this.useBingRebatesPath.replace("#","")&&(this.UseRebatesClickHandler(a),s=e.$S.UseRebates);await this.utilities.SendClickTelemetry("",s)}}await this.platformInstance.SendMessage(new it(this.getContextID(this.divIDContextID),location.hostname,location.pathname)),i.remove();const s=this.localDataService.GetLocalData(Ne.Q.ApiResponse);if(So.Z.IsECPage(s)){const e={auto_apply_status:!0,express_checkout_status:!0,is_auto_apply_completed:!0};this.edgeMessageService.SendOpenFlyoutMessage(JSON.stringify(e)),this.edgeMessageService.SetStorageValue("ECInvalidDismiss",JSON.stringify({value:"true"}))}if(a){const e=document.querySelector(a.applyButtonSelector);if(e)e.focus();else{const e=document.querySelector(a.removeCouponButtonSelector);if(e)e.focus();else{const e=document.querySelector(a.inputBoxSelector);if(e)e.focus();else{const e=document.querySelector(a.orderTotalDataElementSelector);e&&e.focus()}}}}}async UseRebatesClickHandler(e){if(!e)return;let i=e.removeCouponButtonSelector;if(i){let e="";const t=i.split(";");2===t.length&&(e=t[0],i=t[1]);const o=new Ie(ho.GetPlatformInstance());o&&(await this.isFieldVisible(o,e)&&(await this.isFieldVisible(o,i)||o.HandleMessage(new lt(Ce.Click,e,""))),await this.isFieldVisible(o,i)&&o.HandleMessage(new lt(Ce.Click,i,"")))}t.a.postMessageToHost(u.AutoApplyOptionsStatus,[d.UseRebates])}handleCashbackUpsellTelemetry(t){const i=this.localDataService.GetLocalData(Ne.Q.ApiResponse),o=i?.highestCashBackCategory??"",a=i?.affiliateNetwork??"";if(t){const i=new st(o,t?.commissionType??"",t?.commissionValue??"",(0,r.S8)(),a,e.E_.Bing,t.isRebatesUser,t.isRebatesSupportedDomain?.toString()??"",!1,t.merchantName??"","overlay",!1,e.GV.CheckoutPage);this.platformInstance.SendMessage(new fe(e.R.CashbackInfo,e.in.Information,"CashbackUpsell Overlay Shown",i))}}handleTotalAmountDialogLoading(e){const t=this.GetShadowOverlay();this.selectElement(t,this.bnplCartValueInputPath).disabled=e,this.selectElement(t,this.bnplContinueButtonPath).disabled=e}addListenerECCancelOverlay(e,t){e&&e.forEach((e=>{e.addEventListener("click",(async()=>{document.body&&(document.body.setAttribute("aria-hidden","false"),this.focusTestingTrap&&this.focusTestingTrap.release());const e=this.GetShadowOverlay();t&&e&&(this.localDataService.IsFeatureEnabled(It.expressCheckout)&&this.localDataService.SaveLocalData(Ne.Q.ExpressCheckoutState,V.CancelEC),t.remove())}))}))}addListenerPauseOverlay(t,i){t&&t.addEventListener("click",(async()=>{document.body&&(document.body.setAttribute("aria-hidden","false"),this.focusTestingTrap&&this.focusTestingTrap.release());const t=this.GetShadowOverlay();i&&t&&(rt.isAutoApplyCompleted||rt.isAutoApplyPaused?this.sendCompletionMessages(t):(rt.isAutoApplyPaused=!0,this.utilities.SendClickTelemetry("User clicked auto apply pause button",e.$S.AutoApplyPause)),this.setCouponTextToPausing(t))}))}addListenerShare(t,i){t&&t.addEventListener("click",(async()=>{let o;o="https://www.bing.com/edgesavings/share/scard";let a,r=this.platformInstance.GetResourceString(Be.CouponShareSavingsMessage);if(i>5){r=this.platformInstance.GetResourceString(Be.CouponShareSavingsMessageWithPrice);const e=(0,be.Jl)(this.currency);r=r.replace("$1",this.formatPrice(e,i))}if(t.id===this.shareTwitterPath.replace("#",""))a=e.$S.ShareTwitter,window.open("https://twitter.com/share?url="+o+"&text="+r,"twitterwindow","height=450, width=550, top=100, left=100, toolbar=0, location=0, menubar=0, directories=0, scrollbars=0");else{if(t.id!==this.shareFBPath.replace("#",""))return;a=e.$S.ShareFB,window.open("https://www.facebook.com/sharer/sharer.php?u="+o+"&quote="+r,"pop","width=450, height=550, scrollbars=no")}await this.utilities.SendClickTelemetry("User clicked share button",a)}))}addListenerECCloseOverlay(t,i){t&&t.addEventListener("click",(async()=>{if(document.body&&(document.body.setAttribute("aria-hidden","false"),this.focusResultTrap&&this.focusResultTrap.release(),this.focusTestingTrap&&this.focusTestingTrap.release()),i&&this.GetShadowOverlay()){let i=e.$S.Unknown;t.id===this.divIDCloseOverlay.replace("#","")&&(i=e.$S.ProceedToCheckout),await this.utilities.SendClickTelemetry("",i)}this.localDataService.SaveLocalData(Ne.Q.ExpressCheckoutState,V.CancelEC),i.remove()}),!1)}addListenerActivateCashback(i,o){i&&i.addEventListener("click",(async()=>{if(document.body&&(document.body.setAttribute("aria-hidden","false"),this.focusResultTrap&&this.focusResultTrap.release(),this.focusTestingTrap&&this.focusTestingTrap.release()),o){const o=this.GetShadowOverlay();if(o){let a=e.$S.Unknown;if(i.id===this.cashbackUpsellJoinNowPath.replace("#","")){a=e.$S.cashbackUpsellJoinNowPath;const i=this.selectElement(o,this.cashbackUpsellJoinNowPath);i&&"none"!==i.style.display&&t.a.postMessageToHost(u.ActivateCashback,[]),await this.utilities.SendClickTelemetry("",a,po.bS.ACTIVATE_CASHBACK),t.a.postMessageToHost("recordAsUserAction",[po.bS.ACTIVATE_CASHBACK_NEW])}}const a=this.selectElement(document,"#"+this.divIDOverlay);a&&a.remove()}}))}handleBNPLResult(t){const i=this.selectElement(document,"#"+this.divIDOverlay);this.handleTotalAmountDialogLoading(!1),"true"===t?(document.body&&(document.body.setAttribute("aria-hidden","false"),this.focusResultTrap&&this.focusResultTrap.release(),this.focusTestingTrap&&this.focusTestingTrap.release()),this.localDataService.SaveLocalData(Ne.Q.ExpressCheckoutState,V.CancelEC),i.remove()):this.showTotalAmountDialogErrorMsg(e.aK.SERVER_ERROR)}showTotalAmountDialogErrorMsg(t,i,o){const a=this.GetShadowOverlay(),r=this.selectElement(a,this.bnplErrorMsgContainerPath);let n="";switch(t){case e.aK.VALIDATION_ERROR:const t=[this.getBNPLProviderData()?.name,`$${i}`,`$${o}`,`$${i}`,`$${o}`];n=this.platformInstance.GetResourceString(Be.EcWalletExtraDialogValidationError).replace(/\$[1-9]/g,(e=>t[e[1]-1]));break;case e.aK.SERVER_ERROR:n=this.replaceStrWithBNPLProvider(Be.EcWalletExtraDialogConnectIssue)}const s=this.selectElement(r,this.bnplErrorTextPath);this.utilities.UpdateLocalizedText(r,this.bnplErrorTextPath,n),n?(this.ShowDiv(r),s.setAttribute("role","alert")):(this.HideDiv(r),s.removeAttribute("role"))}async isFieldVisible(e,t){if(m.ZP.IsValidDataField(t)){const i=await e.HandleMessage(new lt(Ce.CountMatchingElements,t,""));return!!i&&i.NumElements>0}return!1}GetShadowOverlay(){const e=this.selectElement(document,"#"+this.divIDOverlay);return e?.shadowRoot}AddShareHtml(e){const t=this.selectElement(e,"#txtOverlayShare");t&&(t.innerText=this.platformInstance.GetResourceString(Be.CouponShareSavingsRefresh));const i=this.selectElement(e,this.shareFBPath);if(i){i.innerHTML=Ze.Z.getTrustedHTML`<svg aria-hidden="true" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
    <mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="25" height="25">
    <rect x="0.5" y="0.503906" width="24" height="24" fill="#C4C4C4"/>
    </mask>
    <g mask="url(#mask0)">
    <circle cx="12.5" cy="12.5039" r="12" fill="url(#paint0_linear)"/>
    <path d="M13.9562 20.4124V13.2965H16.4328L16.8035 10.5233H13.9562V8.75273C13.9562 7.94984 14.1874 7.40263 15.3813 7.40263L16.9039 7.40195V4.92166C16.6404 4.88798 15.7367 4.8125 14.6852 4.8125C12.4899 4.8125 10.9869 6.10482 10.9869 8.47822V10.5234H8.50391V13.2966H10.9868V20.4125L13.9562 20.4124Z" fill="white"/>
    </g>
    <defs>
    <linearGradient id="paint0_linear" x1="5.75" y1="2.00391" x2="19.25" y2="24.5039" gradientUnits="userSpaceOnUse">
    <stop stop-color="#17A6FB"/>
    <stop offset="1" stop-color="#0369E9"/>
    </linearGradient>
    </defs>
    </svg>`;const e=this.platformInstance.GetResourceString(Be.FacebookShare);i.setAttribute("aria-label",e),i.classList.remove(this.divOverlayHide),i.classList.add(this.divOverlayInlineShow)}const o=this.selectElement(e,this.shareTwitterPath);if(o){o.innerHTML=Ze.Z.getTrustedHTML`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 400 400" style="enable-background:new 0 0 400 400;" xml:space="preserve">
    <style type="text/css">
        .st0{fill:#1B9DF0;}
        .st1{fill:#FFFFFF;}
    </style>
    <g id="Dark_Blue">
        <circle class="st0" cx="200" cy="200" r="200"/>
    </g>
    <g id="Logo__x2014__FIXED">
        <path class="st1" d="M163.4,305.5c88.7,0,137.2-73.5,137.2-137.2c0-2.1,0-4.2-0.1-6.2c9.4-6.8,17.6-15.3,24.1-25   c-8.6,3.8-17.9,6.4-27.7,7.6c10-6,17.6-15.4,21.2-26.7c-9.3,5.5-19.6,9.5-30.6,11.7c-8.8-9.4-21.3-15.2-35.2-15.2   c-26.6,0-48.2,21.6-48.2,48.2c0,3.8,0.4,7.5,1.3,11c-40.1-2-75.6-21.2-99.4-50.4c-4.1,7.1-6.5,15.4-6.5,24.2   c0,16.7,8.5,31.5,21.5,40.1c-7.9-0.2-15.3-2.4-21.8-6c0,0.2,0,0.4,0,0.6c0,23.4,16.6,42.8,38.7,47.3c-4,1.1-8.3,1.7-12.7,1.7   c-3.1,0-6.1-0.3-9.1-0.9c6.1,19.2,23.9,33.1,45,33.5c-16.5,12.9-37.3,20.6-59.9,20.6c-3.9,0-7.7-0.2-11.5-0.7   C110.8,297.5,136.2,305.5,163.4,305.5"/>
    </g>
    </svg>`;const e=this.platformInstance.GetResourceString(Be.TwitterShare);o.setAttribute("aria-label",e),o.classList.remove(this.divOverlayHide),o.classList.add(this.divOverlayInlineShow)}const a=this.selectElement(e,this.sharePath);a&&(a.classList.remove(this.divOverlayHide),a.classList.add(this.divOverlayGridShow))}AddImportFromBrowserHtml(e){const t=this.localDataService.GetLocalData(Ne.Q.ImportOptions);if(t&&t.shouldTriggerImportFeatures&&this.edgeMessageService.SendTriggerImportFeature(),t&&t.shouldTriggerImportFeatures&&t.shouldShowImportCheckBox&&t.primaryBrowserName){const i=this.selectElement(e,"#divImportBrowser");if(i){let o=this.platformInstance.GetResourceString(t.importCheckBoxText??Be.ContinuousImportCheckBoxText);o||(o=this.platformInstance.GetResourceString(Be.importFromPrimaryBrowser)),o=o.replace(/\$\d/,t.primaryBrowserName);const a=document.createElement("DIV");a.id="divImportBrowserWrapper";const r=document.createElement("input");r.type="checkbox",r.checked=!0,r.id=this.divImportCheckBox,r.style.transform="scale(1.4, 1.4)",r.checked?this.utilities.UpdateLocalizedText(e,this.divIDCloseOverlay,Be.successImportExitButton):this.utilities.UpdateLocalizedText(e,this.divIDCloseOverlay,Be.successExitButton),r.addEventListener("change",(()=>{r.checked?this.utilities.UpdateLocalizedText(e,this.divIDCloseOverlay,Be.successImportExitButton):this.utilities.UpdateLocalizedText(e,this.divIDCloseOverlay,Be.successExitButton)}));const n=document.createElement("label"),s=this.platformInstance.GetResourceString(t.privacyLabeltext??Be.PrivacyStatement),c=document.createElement("A");c.target="_blank",c.style.color="#0078D7",c.style.display="inline-block",c.style.marginLeft="3px",c.href="https://privacy.microsoft.com/en-us/privacystatement",c.textContent=s,n.textContent=o,n.appendChild(c),n.className="txtMedium",n.style.textAlign="start";const l=e.querySelectorAll(".hrDivider");if(l){const e=this.utilities.IsDarkTheme();l.forEach((t=>{e?(n.style.color="#B9B9B9",t&&(t.style.color="#5F5F5F")):(n.style.color="rgba(0, 0, 0, 0.55)",t&&(t.style.color="#E8E8E8"))}))}n.style.marginLeft="10px",a.appendChild(r),a.appendChild(n),i.appendChild(a),i.classList.remove("divOverlayHide"),i.classList.add("divOverlayShow"),this.edgeMessageService.SendImportCheckboxShownMessage()}}}async HandleCheckoutProgress(e){if(this.localDataService.IsFeatureEnabled(It.expressCheckout)){const t=this.GetShadowOverlay();if(this.HideDiv(this.selectElement(t,"#divOverlayProgress")),this.HideDiv(this.selectElement(t,this.titleProgressBar)),this.HideDiv(this.selectElement(t,this.txtCurrentCoupon)),t){const i=this.selectElement(t,"#txtBarCheckoutTitle");let o=this.platformInstance.GetResourceString(Be.ECProgressAddress);if(e.Status===V.AutoApplyDone){o=this.platformInstance.GetResourceString(Be.ECProgressAddress),window.trustedTypes&&(i.innerHTML=window.trustedTypes.emptyHTML);const e=document.createElement("SPAN");e.className="ecspan",e.textContent=`${this.platformInstance.GetResourceString(Be.ECApplyCoupons)} > ${this.platformInstance.GetResourceString(Be.ECAddress)}`;const t=document.createTextNode(`${this.getPaymentProcessStr()}`);e.appendChild(t),i.appendChild(e)}else if(e.Status===V.AddressDone){if(o=this.BNPLProvider()?"":this.platformInstance.GetResourceString(Be.ECProgressPayment),i){const e=i.innerText;window.trustedTypes&&(i.innerHTML=window.trustedTypes.emptyHTML);const t=document.createElement("SPAN");if(t.className="ecspan",this.BNPLProvider()){t.textContent=e.replace(this.BNPLProcessStr(),""),i.appendChild(t);const o=document.createTextNode(this.BNPLProcessStr());i.appendChild(o)}else t.textContent=e,i.appendChild(t)}}else e.Status===V.PaymentDone&&(o=this.platformInstance.GetResourceString(Be.ECProgressPayment));e.Status===V.AddressDone&&await this.MoveProgressBar(50,100,this.divIDProgressBar);const a=this.selectElement(t,"#txtECCurrentProgressTitle");a&&(a.textContent=o),this.ShowDiv(this.selectElement(t,"#txtECCurrentProgressTitle"))}}}GetProgressTitle(e){return e?`${this.platformInstance.GetResourceString(Be.ECApplyCoupons)} >\n             ${this.platformInstance.GetResourceString(Be.ECAddress)} ${this.getPaymentProcessStr()}`:this.isAutofillPaymentToggleOff()?"":`${this.platformInstance.GetResourceString(Be.ECAddress)} ${this.getPaymentProcessStr()}`}async ShowECOnlyCheckoutProgress(e,t){const i=this.GetShadowOverlay();if(i){let o;if(this.HideDiv(this.selectElement(i,"#divOverlayProgress")),this.isAutofillPaymentToggleOff())o="";else{o=document.createElement("span");const e=document.createElement("span");e.className="ecspan",e.append(this.platformInstance.GetResourceString(Be.ECAddress));const t=document.createElement("span");t.className="ecspangrey",t.append(this.getPaymentProcessStr()),o.append(e),o.append(t)}e&&(o=this.GetProgressTitle(e));const a=this.selectElement(i,"#txtBarCheckoutTitle");a&&(this.ShowDiv(a),a.append(o));let r=this.platformInstance.GetResourceString(Be.ECProgressAddress);if(t===V.AutoApplyDone){if(e){const e=this.platformInstance.GetResourceString(Be.ECApplyCoupons)+" > "+this.platformInstance.GetResourceString(Be.ECAddress),t=document.createElement("SPAN");t.className="ecspan",t.textContent=e;const i=document.createTextNode(this.getPaymentProcessStr());t.appendChild(i),window.trustedTypes&&(a.innerHTML=window.trustedTypes.emptyHTML),a.appendChild(t)}r=this.platformInstance.GetResourceString(Be.ECProgressAddress)}else if(t===V.AddressDone){if(r=this.BNPLProvider()?"":this.platformInstance.GetResourceString(Be.ECProgressPayment),e){window.trustedTypes&&(a.innerHTML=window.trustedTypes.emptyHTML);const t=document.createElement("SPAN");t.className="ecspan",t.textContent=this.GetProgressTitle(e),a.appendChild(t)}}else t===V.PaymentDone&&(r=this.platformInstance.GetResourceString(Be.ECProgressPayment));t===V.AddressDone&&await this.MoveProgressBar(50,100,this.divIDProgressBar);const n=this.selectElement(i,"#txtECCurrentProgressTitle");n&&(this.ShowDiv(n),n.textContent=r)}}ShowCheckoutProgress(){const e=this.GetShadowOverlay();if(e){const t=this.selectElement(e,"#txtBarCheckoutTitle");if(t){const e=document.createElement("span");e.className="ecspan",e.textContent=this.platformInstance.GetResourceString(Be.ECApplyCoupons);const i=document.createTextNode(`> ${this.platformInstance.GetResourceString(Be.ECAddress)} ${this.getPaymentProcessStr()}`);t.appendChild(e),t.appendChild(i),this.ShowDiv(t)}}}HideDiv(e){e&&e.classList.add(this.divOverlayHide)}ShowDiv(e){e&&e.classList.remove(this.divOverlayHide)}isAutofillPaymentToggleOff(){const{BNPLProvider:e,IsSkipPayment:t}=this.localDataService.GetLocalData(Ne.Q.CheckoutUserData);return t&&!e}BNPLProvider(){return this.localDataService.GetLocalData(Ne.Q.CheckoutUserData)?.BNPLProvider}getTotalAmountDialogData(){return this.localDataService.GetLocalData(Ne.Q.CheckoutUserData)?.TotalAmountDialogData}getBNPLProviderData(){return new class{constructor(e,t){(0,a.Z)(this,"name",void 0),(0,a.Z)(this,"getLogoFunc",void 0),(0,a.Z)(this,"continueToMessage",void 0);const i=Ve[t];this.name=e.GetResourceString(i),this.getLogoFunc=We[t],this.continueToMessage=Ke[t]}getData(){return{continueToMessage:this.continueToMessage,getLogoFunc:this.getLogoFunc,name:this.name}}}(this.platformInstance,this.BNPLProvider()).getData()}replaceStrWithBNPLProvider(e){return this.platformInstance.GetResourceString(e).replace("$1",this.getBNPLProviderData()?.name)}BNPLProcessStr(){return this.replaceStrWithBNPLProvider(Be.CheckoutWithNewPaymentOption)}getPaymentProcessStr(){return this.isAutofillPaymentToggleOff()?"":`> ${this.BNPLProvider()?this.BNPLProcessStr():this.platformInstance.GetResourceString(Be.ECPayment)}`}UpdateCurrentCoupon(e,t,i,o,a){const r=this.GetShadowOverlay();if(r){const n=this.selectElement(r,this.titleProgressBar);if(n){const e=this.platformInstance.GetResourceString(Be.inProgressLoaderTextTop);e&&(n.textContent=e.replace("$1",t.toString()).replace("$2",i.toString()))}const s=this.selectElement(r,"#spanTestingCoupons"),c=a?this.platformInstance.GetResourceString(Be.SuggestedCouponsText):e,l=this.changeCouponText(r,c);if("OtherSeller"===e&&(l.textContent=this.platformInstance.GetResourceString(Be.OS_InProgressLoaderTextBottom)),s&&s.innerText&&l&&l.innerText&&n&&n.innerText&&(s.innerText=l.textContent+" "+n.textContent),o>=.01){const e=this.selectElement(r,this.divIDTestingCoupon);if(e){let t=this.platformInstance.GetResourceString(Be.currentBestDiscount);this.checkoutPageUrlData?.supportedNoOrderTotal&&(t=this.platformInstance.GetResourceString(Be.currentBestDiscountNOT)),"you saved $1 so far"===t&&(t="You have saved $1 so far!");const i=(0,be.Jl)(this.currency),a=this.selectElement(e,"#txtProgressTitle");a&&(a.classList.add("txtOverlayResultPositive"),a.textContent=t.replace("$1",this.formatPrice(i,o)));const n=this.selectElement(r,this.shareFBPath);this.addListenerShare(n,o);const s=this.selectElement(r,this.shareTwitterPath);this.addListenerShare(s,o);const c=r.querySelector("#btnOverlayCancel");c&&(c.removeEventListener("click",this.cancelListenerCallback),c.textContent=this.platformInstance.GetResourceString(Be.PauseButtonPauseAndApply),this.addListenerPauseOverlay(c,this.overlay))}}}}showResultMainDiv(e,t){e.setAttribute("aria-hidden","true");const i=e.querySelector("#txtBarTitle");i&&i.setAttribute("aria-hidden","true"),e.classList.remove("divOverlayShow"),e.classList.add("divOverlayHide"),this.focusTestingTrap&&this.focusTestingTrap.release(),this.UpdateIconImage(t),t.setAttribute("aria-hidden","false"),t.classList.remove("divOverlayHide"),t.classList.add("divOverlayShow"),t.classList.add("divOverlayContentWrapper"),t.focus()}UpdateIconImage(t){const i=t.querySelector(this.iconImgPath);if(i)if(this.platformInstance.GetAppInfoClientName()===e.BN.Sapphire)i.src=this.localDataService.GetLocalData(Ne.Q.Icon),i.style.height="24px",i.style.width="auto";else if(dt.IS.includes(this.platformInstance.GetAppInfoClientName())){i.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSJub25lIj4KICAgICAgICA8cGF0aCBkPSJNMTguMDUwNyAxNC44ODU1QzE3Ljc4NzggMTUuMDIzMyAxNy41MTMyIDE1LjE0NjUgMTcuMjI3OCAxNS4yNTM3QzE2LjM2OTkgMTUuNTc2IDE1LjQyMjQgMTUuNzU4NyAxNC40MjMgMTUuNzU4N0MxMC43MjYxIDE1Ljc1ODcgNy41MDU1OSAxMy4yMTU2IDcuNTA1NTkgOS45NTIyMUM3LjUwNTU5IDkuMDM0NjIgOC4wMzY1MSA4LjIzOTIyIDguNzg4ODYgNy44MjAzMUM1LjQ0NTQzIDcuOTYwNDcgNC41ODU5NCAxMS40NDUzIDQuNTg1OTQgMTMuNDg2OEM0LjU4NTk0IDE5LjI1ODEgOS45MDU0MyAxOS44NDM5IDExLjA1MTcgMTkuODQzOUMxMS42Njk0IDE5Ljg0MzkgMTIuNjAxNyAxOS42NjM5IDEzLjE2MzQgMTkuNDg3OEMxMy4xOTc3IDE5LjQ3NjMgMTMuMjMxOCAxOS40NjQ5IDEzLjI2NTggMTkuNDUzMUMxNS40MzQ1IDE4LjcwNTIgMTcuMjY0OSAxNy4yMzM4IDE4LjQ2ODIgMTUuMzI2NUMxOC42NDA3IDE1LjA1MyAxOC4zMzcyIDE0LjczNTIgMTguMDUwNyAxNC44ODU1WiIgZmlsbD0idXJsKCNwYWludDBfbGluZWFyKSIvPgogICAgICAgIDxwYXRoIG9wYWNpdHk9IjAuMzUiIGQ9Ik0xOC4wNTA3IDE0Ljg4NTVDMTcuNzg3OCAxNS4wMjMzIDE3LjUxMzIgMTUuMTQ2NSAxNy4yMjc4IDE1LjI1MzdDMTYuMzY5OSAxNS41NzYgMTUuNDIyNCAxNS43NTg3IDE0LjQyMyAxNS43NTg3QzEwLjcyNjEgMTUuNzU4NyA3LjUwNTU5IDEzLjIxNTYgNy41MDU1OSA5Ljk1MjIxQzcuNTA1NTkgOS4wMzQ2MiA4LjAzNjUxIDguMjM5MjIgOC43ODg4NiA3LjgyMDMxQzUuNDQ1NDMgNy45NjA0NyA0LjU4NTk0IDExLjQ0NTMgNC41ODU5NCAxMy40ODY4QzQuNTg1OTQgMTkuMjU4MSA5LjkwNTQzIDE5Ljg0MzkgMTEuMDUxNyAxOS44NDM5QzExLjY2OTQgMTkuODQzOSAxMi42MDE3IDE5LjY2MzkgMTMuMTYzNCAxOS40ODc4QzEzLjE5NzcgMTkuNDc2MyAxMy4yMzE4IDE5LjQ2NDkgMTMuMjY1OCAxOS40NTMxQzE1LjQzNDUgMTguNzA1MiAxNy4yNjQ5IDE3LjIzMzggMTguNDY4MiAxNS4zMjY1QzE4LjY0MDcgMTUuMDUzIDE4LjMzNzIgMTQuNzM1MiAxOC4wNTA3IDE0Ljg4NTVaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWwpIi8+CiAgICAgICAgPHBhdGggZD0iTTguMjU4NzQgMTguODYwNUM3LjU2Mzg4IDE4LjQyOTggNi45NjA2NiAxNy44NjE4IDYuNDgyNTQgMTcuMTkwNUM1Ljc0MjY5IDE2LjE1MTggNS4zMDAzOCAxNC44NzQgNS4zMDAzOCAxMy40ODY3QzUuMzAwMzggMTEuNDQ1MyA2LjI1MDk4IDkuNjM3MSA3LjcxNjI4IDguNDkxNDdDOC4wNDkwNSA4LjIzMTMxIDguNDc1MTUgNy45Njg4OCA4Ljc4OTE0IDcuODIwMjlDOS4wMzI4OSA3LjcwNDg2IDkuNDQ5ODUgNy40OTcwNCAxMC4wMDM2IDcuNTA0ODlDMTAuOTIxNyA3LjUxNzkgMTEuNjE1NCA3Ljk4NTk5IDEyLjAxMDMgOC41MTc1NkMxMi4zMTM3IDguOTI2IDEyLjUwMDcgOS40MjkyMSAxMi41MDcgOS45NzU0NkMxMi41MDcyIDkuOTU5MDYgMTQuNDE4MyAzLjc1NjM1IDYuMjUzMTIgMy43NTYzNUMyLjgyMzk1IDMuNzU2MzUgMCA3LjAxMTggMCA5Ljg2Njk1QzAgMTEuNjc4MSAwLjQyMDI2NCAxMy4xMjQgMC45NDY0NjEgMTQuMjQ0NkMyLjExODM5IDE2Ljc0MDcgNC4yOTE2NCAxOC42NzI2IDYuOTUwMDggMTkuNTIzN0M3LjkxMjggMTkuODMyIDguOTM4NDQgMjAgMTAuMDAzNiAyMEMxMS4xMDg0IDIwIDEyLjE3MDEgMTkuODE4MyAxMy4xNjM3IDE5LjQ4NzdDMTIuNjAyIDE5LjY2MzkgMTIuMDA2NCAxOS43NjA0IDExLjM4ODggMTkuNzYwNEMxMC4yNDI2IDE5Ljc2MDQgOS4xNzQyMiAxOS40MjggOC4yNTg3NCAxOC44NjA1WiIgZmlsbD0idXJsKCNwYWludDJfbGluZWFyKSIvPgogICAgICAgIDxwYXRoIG9wYWNpdHk9IjAuNDEiIGQ9Ik04LjI1ODc0IDE4Ljg2MDVDNy41NjM4OCAxOC40Mjk4IDYuOTYwNjYgMTcuODYxOCA2LjQ4MjU0IDE3LjE5MDVDNS43NDI2OSAxNi4xNTE4IDUuMzAwMzggMTQuODc0IDUuMzAwMzggMTMuNDg2N0M1LjMwMDM4IDExLjQ0NTMgNi4yNTA5OCA5LjYzNzEgNy43MTYyOCA4LjQ5MTQ3QzguMDQ5MDUgOC4yMzEzMSA4LjQ3NTE1IDcuOTY4ODggOC43ODkxNCA3LjgyMDI5QzkuMDMyODkgNy43MDQ4NiA5LjQ0OTg1IDcuNDk3MDQgMTAuMDAzNiA3LjUwNDg5QzEwLjkyMTcgNy41MTc5IDExLjYxNTQgNy45ODU5OSAxMi4wMTAzIDguNTE3NTZDMTIuMzEzNyA4LjkyNiAxMi41MDA3IDkuNDI5MjEgMTIuNTA3IDkuOTc1NDZDMTIuNTA3MiA5Ljk1OTA2IDE0LjQxODMgMy43NTYzNSA2LjI1MzEyIDMuNzU2MzVDMi44MjM5NSAzLjc1NjM1IDAgNy4wMTE4IDAgOS44NjY5NUMwIDExLjY3ODEgMC40MjAyNjQgMTMuMTI0IDAuOTQ2NDYxIDE0LjI0NDZDMi4xMTgzOSAxNi43NDA3IDQuMjkxNjQgMTguNjcyNiA2Ljk1MDA4IDE5LjUyMzdDNy45MTI4IDE5LjgzMiA4LjkzODQ0IDIwIDEwLjAwMzYgMjBDMTEuMTA4NCAyMCAxMi4xNzAxIDE5LjgxODMgMTMuMTYzNyAxOS40ODc3QzEyLjYwMiAxOS42NjM5IDEyLjAwNjQgMTkuNzYwNCAxMS4zODg4IDE5Ljc2MDRDMTAuMjQyNiAxOS43NjA0IDkuMTc0MjIgMTkuNDI4IDguMjU4NzQgMTguODYwNVoiIGZpbGw9InVybCgjcGFpbnQzX3JhZGlhbCkiLz4KICAgICAgICA8cGF0aCBkPSJNMTEuODk5MiAxMS42Mjk2QzExLjgzNTkgMTEuNzExNiAxMS42NDExIDExLjgyNDcgMTEuNjQxMSAxMi4wNzIxQzExLjY0MTEgMTIuMjc1NiAxMS43NzM5IDEyLjQ3MTggMTIuMDEgMTIuNjM2NkMxMy4xMzM1IDEzLjQyMDcgMTUuMjUxMSAxMy4zMTUgMTUuMjU2OCAxMy4zMTVDMTYuMTMxIDEzLjMxMiAxNi45MTc0IDEzLjA3MTYgMTcuNjIxOSAxMi42NTk3QzE3Ljk0MjMgMTIuNDcyNCAxOC4yMzkgMTIuMjQ5OCAxOC41MDY0IDExLjk5NTZDMTkuNDI0MiAxMS4xMjM1IDE5Ljk4MzcgOS44OTQ1NCAxOS45OTkyIDguNTI4OThDMjAuMDE5MiA2Ljc3Nzc4IDE5LjM3NzQgNS42MTM1NCAxOS4xMTM1IDUuMDk4MDJDMTcuNDU3OSAxLjg2MjIgMTMuODgzOSAwIDkuOTk3OTEgMEM0LjUyMDE2IDAgMC4wNzM1MDY5IDQuNDAyMDggMCA5Ljg1OTQ2QzAuMDM3MTM0NyA3LjAwNDU0IDIuODc0NTMgNC42OTkxNSA2LjI0NzM5IDQuNjk5MTVDNi41MjA4NiA0LjY5OTE1IDguMDgwMzkgNC43MjU4MiA5LjUyOTA3IDUuNDg2MTVDMTAuODA1MiA2LjE1NTkgMTEuNDc0MiA2Ljk2NTE5IDExLjkzOTIgNy43NjgwMkMxMi40MjIxIDguNjAxNjQgMTIuNTA4IDkuNjU0NDYgMTIuNTA4IDEwLjA3NDJDMTIuNTA4IDEwLjQ5NCAxMi4yOTY0IDExLjExNTUgMTEuODk5MiAxMS42Mjk2WiIgZmlsbD0idXJsKCNwYWludDRfcmFkaWFsKSIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMS44OTkyIDExLjYyOTZDMTEuODM1OSAxMS43MTE2IDExLjY0MTEgMTEuODI0NyAxMS42NDExIDEyLjA3MjFDMTEuNjQxMSAxMi4yNzU2IDExLjc3MzkgMTIuNDcxOCAxMi4wMSAxMi42MzY2QzEzLjEzMzUgMTMuNDIwNyAxNS4yNTExIDEzLjMxNSAxNS4yNTY4IDEzLjMxNUMxNi4xMzEgMTMuMzEyIDE2LjkxNzQgMTMuMDcxNiAxNy42MjE5IDEyLjY1OTdDMTcuOTQyMyAxMi40NzI0IDE4LjIzOSAxMi4yNDk4IDE4LjUwNjQgMTEuOTk1NkMxOS40MjQyIDExLjEyMzUgMTkuOTgzNyA5Ljg5NDU0IDE5Ljk5OTIgOC41Mjg5OEMyMC4wMTkyIDYuNzc3NzggMTkuMzc3NCA1LjYxMzU0IDE5LjExMzUgNS4wOTgwMkMxNy40NTc5IDEuODYyMiAxMy44ODM5IDAgOS45OTc5MSAwQzQuNTIwMTYgMCAwLjA3MzUwNjkgNC40MDIwOCAwIDkuODU5NDZDMC4wMzcxMzQ3IDcuMDA0NTQgMi44NzQ1MyA0LjY5OTE1IDYuMjQ3MzkgNC42OTkxNUM2LjUyMDg2IDQuNjk5MTUgOC4wODAzOSA0LjcyNTgyIDkuNTI5MDcgNS40ODYxNUMxMC44MDUyIDYuMTU1OSAxMS40NzQyIDYuOTY1MTkgMTEuOTM5MiA3Ljc2ODAyQzEyLjQyMjEgOC42MDE2NCAxMi41MDggOS42NTQ0NiAxMi41MDggMTAuMDc0MkMxMi41MDggMTAuNDk0IDEyLjI5NjQgMTEuMTE1NSAxMS44OTkyIDExLjYyOTZaIiBmaWxsPSJ1cmwoI3BhaW50NV9yYWRpYWwpIi8+CiAgICAgICAgPGRlZnM+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyIiB4MT0iNC41ODU5NCIgeTE9IjEzLjgzMjEiIHgyPSIxOC41MTg1IiB5Mj0iMTMuODMyMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMwQzU5QTQiLz4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMxMTRBOEIiLz4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgICAgIDxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQxX3JhZGlhbCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgxMi4yODE0IDEzLjkzNjEpIHNjYWxlKDcuNDUxOTMgNy4wODczMSkiPgogICAgICAgIDxzdG9wIG9mZnNldD0iMC43MTY1OSIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIwLjk0NTkiIHN0b3Atb3BhY2l0eT0iMC41MyIvPgogICAgICAgIDxzdG9wIG9mZnNldD0iMSIvPgogICAgICAgIDwvcmFkaWFsR3JhZGllbnQ+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDJfbGluZWFyIiB4MT0iMTEuOTMxNiIgeTE9IjcuNzg3NzMiIHgyPSIzLjIyODc4IiB5Mj0iMTcuMjY3MiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMxQjlERTIiLz4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjAuMTYxNjQiIHN0b3AtY29sb3I9IiMxNTk1REYiLz4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjAuNjY3NDkiIHN0b3AtY29sb3I9IiMwNjgwRDciLz4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMDc4RDQiLz4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgICAgIDxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQzX3JhZGlhbCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg1LjU3MDc0IDE1LjUyMDYpIHJvdGF0ZSgtODEuNDY0KSBzY2FsZSgxMS4xOTAzIDkuMDE3MjcpIj4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjAuNzYyOTMiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgICAgIDxzdG9wIG9mZnNldD0iMC45NDU5IiBzdG9wLW9wYWNpdHk9IjAuNSIvPgogICAgICAgIDxzdG9wIG9mZnNldD0iMSIvPgogICAgICAgIDwvcmFkaWFsR3JhZGllbnQ+CiAgICAgICAgPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDRfcmFkaWFsIiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDEuOTcwOTcgMy42NTY3KSByb3RhdGUoOTIuMTI5KSBzY2FsZSgxNS44MTUxIDMzLjY4MzUpIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjMzVDMUYxIi8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIwLjExMDc5IiBzdG9wLWNvbG9yPSIjMzRDMUVEIi8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIwLjIzMTY0IiBzdG9wLWNvbG9yPSIjMkZDMkRGIi8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIwLjMxNDQ2IiBzdG9wLWNvbG9yPSIjMkJDM0QyIi8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIwLjY3MzM4IiBzdG9wLWNvbG9yPSIjMzZDNzUyIi8+CiAgICAgICAgPC9yYWRpYWxHcmFkaWVudD4KICAgICAgICA8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50NV9yYWRpYWwiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTguOTQyNyA2LjA2MDU4KSByb3RhdGUoNzMuNjc0Nykgc2NhbGUoNy42MDQ1OCA2LjIwODc0KSI+CiAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY2RUI2RSIvPgogICAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzY2RUI2RSIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICAgICAgPC9yYWRpYWxHcmFkaWVudD4KICAgICAgICA8L2RlZnM+CiAgICAgICAgPC9zdmc+";const e=t.querySelectorAll(".txtClientName"),o=this.platformInstance.GetResourceString(Be.ShoppingInEdgeTextNew);e&&e.forEach((e=>{e.textContent=o}))}}async ECCreateOverlay(e,t,i,o,a){const r=document.createElement("DIV");r.id="divOverlayBackground";const n="\n            width: 100%;\n            height: 100%;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            position: fixed;\n            display: flex;\n            justify-content: center;\n            background-color: rgba(80,80,80,0.8);\n            z-index: 3000000000;";r.setAttribute("style",n);const s=document.createElement("DIV");s.setAttribute("style",n);const c=s.attachShadow({mode:"open",delegatesFocus:!0});c.innerHTML=t,s.id=this.divIDOverlay;const l=document.createElement("div");l.id=this.divIDContextID,l.hidden=!0,l.innerText=e.toString(),s.appendChild(l),s.appendChild(r);const u=document.getElementsByTagName("html")[0];if(i){const e=document.createElement("style");e.textContent=i,c.appendChild(e)}u&&u.appendChild(s),document.body&&document.body.setAttribute("aria-hidden","true");const d=c.querySelectorAll(this.divOverlayCancel);this.addListenerECCancelOverlay(d,s);const h=this.selectElement(c,this.divIDCheckoutOverlay);this.addListenerECCloseOverlay(h,s);const p=this.selectElement(c,this.divIDTestingCoupon);let g="";g=this.isAutofillPaymentToggleOff()?Be.ECAddressInProgressTitle:this.BNPLProvider()?this.replaceStrWithBNPLProvider(Be.ECWalletAddressAndOtherPaymentInProgressTitle):Be.ECInProgressTitle,this.utilities.UpdateLocalizedText(p,"#txtProgressTitle",g),this.utilities.UpdateLocalizedText(p,"#btnOverlayCancel",Be.inProgressExitButton),p&&(this.addCloseButton(p),this.UpdateIconImage(p),p.classList.remove("divOverlayHide"),p.classList.add("divOverlayShow"),p.classList.add("divOverlayContentWrapper"),p.setAttribute("aria-hidden","false"),h&&h.focus(),this.focusTestingTrap=this.utilities.TrapFocus(p)),document.addEventListener("keydown",(e=>{"Escape"===e.key&&(p.classList.contains("divOverlayShow")?d&&d.forEach((e=>{e.click()})):h&&h.click(),e.preventDefault())})),await this.MoveProgressBar(0,50,this.divIDProgressBar),this.ShowECOnlyCheckoutProgress(o),o&&a&&this.utilities.UpdateLocalizedText(p,"#txtProgressTitle",this.BNPLProvider()?this.replaceStrWithBNPLProvider(Be.ECWalletAAAndOtherPaymentInProgressTitle):Be.ECAutoApplyInProgressTitle)}async ECCreateUpdatePaymentOverlay(e,t,i){await this.ECCreateOverlay(e,t,i,!1);const o=this.GetShadowOverlay();if(o){o.querySelectorAll(this.divOverlayCancel).forEach((e=>{e.addEventListener("click",(()=>{this.edgeMessageService.SendUpdatePaymentDetailsResultMessage(null)}))}));const e=this.selectElement(o,this.divIDTestingCoupon);this.HideDiv(this.selectElement(o,"#divOverlayProgressCheckout")),this.utilities.UpdateLocalizedText(e,"#txtProgressTitle",this.replaceStrWithBNPLProvider(Be.EcWalletFillingVirtualCardInfo)),this.utilities.UpdateLocalizedText(e,"#txtBarCheckoutTitle",""),this.utilities.UpdateLocalizedText(e,"#txtECCurrentProgressTitle",Be.ECProgressPayment),this.ShowDiv(this.selectElement(o,"#txtECCurrentProgressTitle"))}}CreateOverlay(t,i,o,a,r,n,s,c,l,u){const d=document.createElement("DIV");d.id="divOverlayBackground";const h="\n            width: 100%;\n            height: 100%;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            position: fixed;\n            display: flex;\n            justify-content: center;\n            background-color: rgba(80,80,80,0.8);\n            z-index: 3000000000;";d.setAttribute("style",h),this.overlay=document.createElement("DIV"),this.overlay.setAttribute("style",h);const p=this.overlay.attachShadow({mode:"open",delegatesFocus:!0});p.innerHTML=t,this.overlay.id=this.divIDOverlay;const g=document.createElement("div");g.id=this.divIDContextID,g.hidden=!0,g.innerText=s.toString(),this.overlay.appendChild(g),this.overlay.appendChild(d);const C=document.getElementsByTagName("html")[0];if(l){const e=document.createElement("style");e.textContent=l,p.appendChild(e)}C&&C.appendChild(this.overlay),document.body&&document.body.setAttribute("aria-hidden","true");const S=p.querySelectorAll(this.divOverlayCancel);this.addListenerCancelOverlay(S,this.overlay,u);const m=this.selectElement(p,this.divIDCloseOverlay);this.addListenerCloseOverlay(this.overlay,m,this.checkoutPageUrlData);const A=this.selectElement(p,this.useBingRebatesPath);this.addListenerCloseOverlay(this.overlay,A,this.checkoutPageUrlData);const f=this.selectElement(p,this.shareFBPath);this.addListenerShare(f,c);const v=this.selectElement(p,this.shareTwitterPath);this.addListenerShare(v,c);const E=this.selectElement(p,this.divIDTestingCoupon);if(this.platformInstance.GetAppInfoClientName()===e.BN.Sapphire){let e=this.platformInstance.GetResourceString(Be.inProgressSapphireTitle);e=e.replace(/\$\d/,this.localDataService.GetLocalData(Ne.Q.AppName)),this.utilities.UpdateText(E,"#txtProgressTitle",e)}else{let e="";e="OtherSeller"===i?Be.OS_InProgressTitle:this.localDataService.IsFeatureEnabled(It.expressCheckout)?this.BNPLProvider()?this.replaceStrWithBNPLProvider(Be.ECWalletAAAndOtherPaymentInProgressTitle):Be.ECAutoApplyInProgressTitle:Pi.R.isExperimentActive(pi.H.inProgressTitleV1)?Be.inProgressTitleV1:Pi.R.isExperimentActive(pi.H.inProgressTitleV2)?Be.inProgressTitleV2:Be.inProgressTitle,this.utilities.UpdateLocalizedText(E,"#txtProgressTitle",e)}if(this.utilities.UpdateLocalizedText(E,"#btnOverlayCancel",Be.inProgressExitButton),this.UpdateCurrentCoupon(i,o,a,c),this.SetInitialProgressBar(n,this.divIDProgressBar),E){this.addCloseButton(E),this.UpdateIconImage(E);const e=E.querySelector("#vdoTestingCoupons");if(e){e.src=this.utilities.IsDarkTheme()?"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Progress_Dark_01.mp4":"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Progress_01.mp4";const t=e.parentElement;t&&(t.muted=!0,t.load(),this.isAnimationReduce()||t.addEventListener("loadeddata",(()=>{t.play()})))}E.classList.remove("divOverlayHide"),E.classList.add("divOverlayShow"),E.classList.add("divOverlayContentWrapper"),E.setAttribute("aria-hidden","false"),m&&m.focus(),this.focusTestingTrap=this.utilities.TrapFocus(E)}document.addEventListener("keydown",(e=>{"Escape"===e.key&&(E.classList.contains("divOverlayShow")?S&&S.forEach((e=>{e.click()})):m&&m.click(),e.preventDefault())})),this.localDataService.IsFeatureEnabled(It.expressCheckout)&&this.ShowCheckoutProgress()}async CloseWalletDrawer(e){e&&this.localDataService.SaveLocalData(Ne.Q.ExpressCheckoutState,V.CancelEC),this.HasWalletDrawerOverlay()&&this.selectElement(document,"#"+this.divIDOverlay).remove()}async WalletDrawerSkipCoupon(){rt.isAutoApplySkipped=!0,this.localDataService.SaveLocalData(Ne.Q.WalletDrawerShouldSkipCoupon,!0)}WalletDrawerCreateOverlay(e){if(this.HasWalletDrawerOverlay())return;const t=document.createElement("DIV");t.id="divOverlayBackground";const i="\n            width: 100%;\n            height: 100%;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            position: fixed;\n            display: flex;\n            justify-content: center;\n            background-color: rgba(80,80,80,0.3);\n            z-index: 3000000000;";t.setAttribute("style",i);const o=document.createElement("DIV");o.setAttribute("style",i),o.id=this.divIDOverlay,o.className=this.divWalletDrawerOverlay;const a=document.createElement("div");a.id=this.divIDContextID,a.hidden=!0,a.innerText=e.toString(),o.appendChild(a),o.appendChild(t);const r=document.getElementsByTagName("html")[0];r&&r.appendChild(o),document.body&&document.body.setAttribute("aria-hidden","true")}HasWalletDrawerOverlay(){const e=this.selectElement(document,"#"+this.divIDOverlay);return e?.className===this.divWalletDrawerOverlay}ShowResult(t,i,o,a,n,s,c,l,u){const d=this.GetShadowOverlay();if(d){const h=this.selectElement(d,this.divIDProgressBar),p=this.selectElement(d,this.divIDTestingCoupon),g=this.selectElement(d,this.resultPath);if(h&&p&&g){if(window?.trustedTypes){const e=window.trustedTypes.emptyHTML;h.innerHTML=e}else h.innerHTML="";const C=d.querySelectorAll(this.resultWrapperPath);if(C){C.forEach((e=>{e.className="resultWrapper divOverlayHide"})),this.addCloseButton(g);const d=this.GetAttainableCoupon(c,o);let h=!1;if(t===e.ps.Negative&&this.isUnblockedForRewardsCampaign()&&u&&u.isValidRewardsData()){const t=Pi.R.isExperimentActive(pi.H.autoApplyRewardsOverlay)?e.zy.RewardsEligibleTowerTreatment:e.zy.RewardsEligibleTowerControl,i=Pi.R.isExperimentActive(pi.H.autoApplyRewardsOverlay)?"Shopping rewards Treatment tower":"Shopping rewards Control tower",o=new Ya.Z((0,r.S8)(),e.oN.AARewards,location.pathname,t);this.platformInstance.SendMessage(new fe(e.R.ShoppingRewards,e.in.Information,i,o))}if(t===e.ps.Positive&&void 0!==i&&void 0!==o&&a){if(i>=.01||this.checkoutPageUrlData?.supportedNoOrderTotal){const t=c?.filter((e=>e.couponCode===a))?.[0]?.isPrivateCoupon??!1;this.SetPositiveResult(g,i,o,a,n,s,d,t),C[0].className="resultWrapper divOverlayShow",this.showResultMainDiv(p,g);try{const t=(0,be.Jl)(this.currency),a=this.formatPrice(t,o-i);if(a&&a){const t=new Xe;t.init(ut.g.EdgeImpressionId,(0,r.S8)(),location.pathname,e.G7.Driver,this.edgeMessageService,this.localDataService),t.updateTotalPriceInStorage(a)}}catch(e){(0,r.Md)("error in updating total price "+e)}}}else t===e.ps.Negative&&n&&this.shouldOfferCashBack(n)?(this.SetNegativeResultCashbackUpsell(g,n),this.handleCashbackUpsellTelemetry(n),C[2].className="resultWrapper divOverlayShow",this.showResultMainDiv(p,g)):t===e.ps.Negative&&this.isUnblockedForRewardsCampaign()&&u&&u.isValidRewardsData()&&Pi.R.isExperimentActive(pi.H.autoApplyRewardsOverlay)?(this.SetNegativeResultUpsellRewards(g,u),C[5].className="resultWrapper divOverlayShow",this.showResultMainDiv(p,g),h=!0):t===e.ps.Negative&&n&&!this.shouldOfferCashBack(n)?(this.SetNegativeResult(g,d,o,n),C[1].className="resultWrapper divOverlayShow",this.showResultMainDiv(p,g)):t===e.ps.Error&&(!0!==l?(this.SetErrorResult(g),C[3].className="resultWrapper divOverlayShow"):c&&c.length>=1&&(this.SetShortcircuitResult(g,c[0]),C[4].className="resultWrapper divOverlayShow"),this.showResultMainDiv(p,g));const S=g.querySelector(this.divIDCloseOverlay);S&&S.focus();const m=ja.StorageKeyPrefix+(0,r.S8)();this.edgeMessageService.SetStorageValue(m,JSON.stringify({value:h.toString()})),this.addListenerCloseOverlay(this.overlay,void 0,this.checkoutPageUrlData,void 0,!0)}this.focusResultTrap=this.utilities.TrapFocus(g)}}}ECShowResult(e,t,i,o,a){const n=this.selectElement(document,"#"+this.divIDOverlay),s=n?.shadowRoot;if(s){const n=this.selectElement(s,this.divIDTestingCoupon),c=this.selectElement(s,this.resultPath);if(n&&c){const l=s.querySelectorAll(this.resultWrapperPath);if(l){if(l[0].className="resultWrapper divOverlayShow",o)if(l.forEach((e=>{e.className="resultWrapper divOverlayHide"})),i&&i>0&&t&&e){const o=this.selectElement(c,"#txtPositiveHeader");let a=this.platformInstance.GetResourceString(Be.successTitle);const n="@TEMP@",u=this.formatPrice(n,i);a=a.replace("$1",u);const d=(0,be.Jl)(this.currency);a=a.replace(n,d),o&&(o.textContent=a);const h=this.selectElement(c,this.resultCouponDetailsPath);if(h){const t=this.platformInstance.GetResourceString(Be.successSubTitle);if(t){const i=document.createElement("P");i.className="txtMedium",i.id="txtResultPositiveCoupon",i.textContent=e.couponCode,(0,r.B7)(h,t,i),window.trustedTypes&&(h.innerHTML=window.trustedTypes.emptyHTML),h.appendChild(i)}}const p=c.querySelector("#divPositiveCouponDetails");if(p){const e=document.createElement("P");e.className="txtSmall";let o=this.platformInstance.GetResourceString(Be.SavingsWithoutCoupon);o=o.replace("$1",`${d}${t}`),e.textContent=o;const a=document.createElement("P");a.className="txtSmall";const r=t-i;let n=this.platformInstance.GetResourceString(Be.SavingsWithCoupon);n=o.replace("$1",this.formatPrice(d,r)),a.textContent=n,p.appendChild(e),p.appendChild(a)}this.ShowDiv(this.selectElement(s,"#divOverlayResultSavings")),this.ShowDiv(this.selectElement(s,"#divOverlayResultCoupon"));const g=this.selectElement(c,"#txtECPositiveHeader");g.className="txtSmall txtOverlayResultPositive",g.style.color="rgba(0, 0, 0, 0.83)",g.style.margin="16px 0 0",l[0].className="resultWrapper divOverlayShow"}else{c.querySelector("#txtECResultNegativeTitle").textContent=this.platformInstance.GetResourceString(Be.BestDealTitle),this.utilities.UpdateLocalizedText(c,"#txtECNegativeHeader",Be.ECsuccessTitle);const e=this.selectElement(c,"#txtECNegativeHeader");e.className="txtMedium txtOverlayResultPositive",e.style.color="rgba(0, 0, 0, 0.83)",e.style.margin="16px 0 0",this.utilities.UpdateLocalizedText(c,"#txtResultNegativeCheckoutCvv",Be.ECsuccessSubTitle),l[1].className="resultWrapper divOverlayShow"}this.addCloseButton(c),this.showResultMainDiv(n,c);const u=c.querySelector(this.divIDCheckoutOverlay);if(this.utilities.UpdateLocalizedText(c,this.divIDCheckoutOverlay,Be.expressCheckoutButton),a===V.FieldError?(c.querySelectorAll("#divCVVSVG").forEach((e=>{this.HideDiv(e)})),this.utilities.UpdateLocalizedText(c,"#txtECPositiveHeader",Be.ECErrorTitle),this.utilities.UpdateLocalizedText(c,"#txtECNegativeHeader",Be.ECErrorTitle),this.utilities.UpdateLocalizedText(c,"#txtResultPositiveCheckoutCvv",Be.ECErrorSubTitle),this.utilities.UpdateLocalizedText(c,"#txtResultNegativeCheckoutCvv",Be.ECErrorSubTitle)):(this.utilities.UpdateLocalizedText(c,"#txtECPositiveHeader",Be.ECsuccessTitle),this.utilities.UpdateLocalizedText(c,"#txtResultPositiveCheckoutCvv",Be.ECsuccessSubTitle)),this.isAutofillPaymentToggleOff()){const e=c.querySelectorAll(this.divOverlayResultCheckoutDetailsPath);e&&e.forEach((e=>{this.HideDiv(e)}))}this.BNPLProvider()&&this.showBNPLTotalAmountDialog(s,c,a),u&&u.focus()}this.focusResultTrap=this.utilities.TrapFocus(c)}}}showBNPLTotalAmountDialog(i,o,n){const s=this.selectElement(o,this.divOverlayResultNegativePath);s&&(s.style.margin="44px 0",s.style.textAlign="center"),n!==V.FieldError&&(this.utilities.UpdateLocalizedText(o,"#txtECPositiveHeader",Be.ECAddressSuccessTitle),this.utilities.UpdateLocalizedText(o,"#txtECNegativeHeader",Be.ECAddressSuccessTitle),o.querySelectorAll(this.divOverlayResultCheckoutDetailsPath).forEach((e=>{this.HideDiv(e)})));const c=this.selectElement(o,this.divOverlayResultCheckoutTitle);c&&(c.style.marginLeft="16px",c.style.marginRight="16px");const l=this.selectElement(o,this.divOverlayFooterPath);this.HideDiv(l);const u=this.selectElement(o,this.bnplTotalAmountFooterPath);u.className="bnplTotalAmountFooter divOverlayShow";const d=this.selectElement(o,this.bnplContinueButtonPath);this.utilities.UpdateLocalizedText(o,this.bnplContinueButtonPath,this.replaceStrWithBNPLProvider(Be.EcWalletExtraDialogContinueButton)),d.addEventListener("click",(()=>{y.onBnplContinueButtonClick()})),this.UpdateIconImage(u),this.utilities.UpdateLocalizedText(o,"#bnplFooterCancel",Be.inProgressExitButton);const{lowerThreshold:h,period:p,upperThreshold:g}=this.getTotalAmountDialogData();let{amount:C}=this.getTotalAmountDialogData();this.finalAmountWithAA&&(C=this.finalAmountWithAA);const S=this.selectElement(i,this.bnplTotalAmountContainerPath);S.querySelector(this.bnplTopBannerSection).classList.add("bnpl-top-banner-section-exp3");const m=document.createElement("STRONG");m.textContent=this.platformInstance.GetResourceString(Be.EcWalletTopBannerBoldText);const A=S.querySelector(this.bnplTopBannerContent);A&&(window.trustedTypes&&(A.innerHTML=window.trustedTypes.emptyHTML),(0,r.B7)(A,this.platformInstance.GetResourceString(Be.EcWalletTopBanner),m));const f=S.querySelector(this.bnplLogo),v=this.utilities.IsDarkTheme();f.innerHTML=this.getBNPLProviderData()?.getLogoFunc?.(v),this.utilities.OnDarkThemeChange((e=>{f.innerHTML=this.getBNPLProviderData()?.getLogoFunc?.(e)})),S.querySelector(this.bnplLogoSvg).setAttribute("aria-label",this.platformInstance.GetResourceString(Be.EcWalletInstallmentZipLogoDesc)),this.utilities.UpdateLocalizedText(S,this.bnplTitlePath,Be.ECWalletExtraDialogTitle);const E=this.selectElement(S,this.bnplSubTitlePath);p&&(E.className="bnplSubTitle txtSmall divOverlayInlineShow"),this.utilities.UpdateLocalizedText(S,this.bnplSubTitlePath,this.platformInstance.GetResourceString(Be.ECWalletExtraDialogSubTitle).replace("$1",p));const P=this.selectElement(S,this.bnplFeeDescriptionPath);if(p&&P&&(P.className="bnplFeeDescription divOverlayInlineShow"),P){window.trustedTypes&&(P.innerHTML=window.trustedTypes.emptyHTML);const e=this.platformInstance.GetResourceString(Be.ECWalletExtraDialogFeeDescription).replace("$1",this.platformInstance.GetResourceString(Be.ZipPayment)),t=document.createElement("A");t.target="_blank",t.href="https://zip.co/us/quadpay-terms-of-service",t.textContent=this.platformInstance.GetResourceString(Be.EcWalletExtraDialogFeePrivacy),(0,r.B7)(P,e,t)}const I=this.selectElement(S,this.bnplShoppingCartValuePath),T=this.selectElement(S,this.bnplCartValueInputPath),O=this.getBNPLProviderData()?.continueToMessage,y=new class{constructor(i,o,r,n,s,c,l,u){(0,a.Z)(this,"amount",void 0),(0,a.Z)(this,"lowerThreshold",void 0),(0,a.Z)(this,"upperThreshold",void 0),(0,a.Z)(this,"showTotalAmountDialogErrorMsg",void 0),(0,a.Z)(this,"setInputValue",void 0),(0,a.Z)(this,"handleTotalAmountDialogLoading",void 0),(0,a.Z)(this,"bnplContinueButton",void 0),(0,a.Z)(this,"continueToMessage",void 0),(0,a.Z)(this,"twoDecimalRegExp",/^$|^[0-9]+(\.[0-9]{0,2})?$/),(0,a.Z)(this,"hasValidationError",!1),(0,a.Z)(this,"onKeyUp",(e=>{"Enter"===e.key&&this.onBnplContinueButtonClick()})),(0,a.Z)(this,"onChange",(e=>{const t=e.target.value?.trim()??"";this.onInputChange(t)})),(0,a.Z)(this,"onBlur",(e=>{const t=e.target.value?.trim()??"";t.endsWith(".")&&this.onInputChange(t.slice(0,-1).trim())})),(0,a.Z)(this,"onInputChange",((t,i)=>{let o=t.slice(1);this.twoDecimalRegExp.test(o)||(o=i?"":this.amount),this.amount=o,t="$"+o,this.setInputValue(t),this.hasValidationError=!this.isTotalAmountValid(o,this.lowerThreshold,this.upperThreshold),this.bnplContinueButton.disabled=this.hasValidationError,i&&Ha(o)||this.showTotalAmountDialogErrorMsg(this.hasValidationError?e.aK.VALIDATION_ERROR:void 0,this.lowerThreshold,this.upperThreshold)})),(0,a.Z)(this,"onBnplContinueButtonClick",(()=>{this.hasValidationError||(t.a.postMessageToHost(this.continueToMessage,[this.amount]),this.handleTotalAmountDialogLoading(!0))})),(0,a.Z)(this,"isTotalAmountValid",((e,t,i)=>{if(!t||!i)return!0;const o=Number(e),a=Number(t),r=Number(i);return!isNaN(o)&&!(o>r||o<a)})),this.amount=i,this.lowerThreshold=o,this.upperThreshold=r,this.showTotalAmountDialogErrorMsg=n,this.setInputValue=s,this.handleTotalAmountDialogLoading=c,this.bnplContinueButton=l,this.continueToMessage=u}}(C,h,g,this.showTotalAmountDialogErrorMsg,(e=>{T.value=e}),this.handleTotalAmountDialogLoading,d,O);y.onInputChange("$"+C,!0);const D=window[e.zS];D&&D().then((e=>{e&&e>0&&y.onInputChange("$"+e,!0)})),T.oninput=y.onChange,T.onblur=y.onBlur,T.onkeyup=y.onKeyUp,g&&(T.maxLength=Number(g).toFixed(2)?.length+1),T.title=this.platformInstance.GetResourceString(Be.EcWalletExtraDialogTotalOrderAmount),I.appendChild(T),this.utilities.UpdateLocalizedText(S,this.bnplAmountReminderPath,Be.EcWalletAmountTaxShippingReminder);const b=this.selectElement(S,this.bnplLicenseTextPath);if(b){window.trustedTypes&&(b.innerHTML=window.trustedTypes.emptyHTML);const e=this.platformInstance.GetResourceString(Be.EcWalletExtraDialogLicense).replace("$2",this.getBNPLProviderData()?.name),t=document.createElement("A");t.target="_blank",t.href="https://webxtsvc.microsoft.com/Terms",t.textContent=this.platformInstance.GetResourceString(Be.EcWalletExtraDialogTermsOfUse);const i=document.createElement("A");i.target="_blank",i.href="https://privacy.microsoft.com/en-us/privacystatement",i.textContent=this.platformInstance.GetResourceString(Be.EcWalletExtraDialogPrivacy),(0,r.B7)(b,e,t,i)}this.utilities.UpdateLocalizedText(S,this.bnplMsDescription,Be.EcWalletMicrosoftDescription),window[e.X4]=this.handleBNPLResult,S.className="divOverlayShow",this.selectElement(document,"#"+this.divIDOverlay).focus(),d.disabled?T.focus():d.focus()}SetInitialProgressBar(e,t){const i=this.selectElement(document,t);i&&(i.style.width=e+"%")}isAnimationReduce(){return this.animationQuery?.matches??!1}SetPositiveResult(t,i,o,a,n,s,c,l){if(!t||!a||!(i&&o||this.checkoutPageUrlData?.supportedNoOrderTotal))return;const u=this.localDataService.GetLocalData(Ne.Q.CashBackActive);let d=-1;if(u)try{const e=ho.GetLocalDataService().GetLocalData(Ne.Q.EstimatedCashback);if(e?.cashbackValue){const t=parseFloat(e.cashbackValue);t&&(d=t)}ho.GetLocalDataService().SaveLocalData(Ne.Q.EstimatedCashback,null)}catch(e){}const h=this.platformInstance.GetAppInfoClientName()===e.BN.Sapphire,p=this.isValidCashBack(n),g=!h&&p&&u&&n?.commissionType&&n?.commissionValue,C=g&&!s,S=this.selectElement(t,".txtOverlayResultPositive"),m=this.checkoutPageUrlData?.supportedNoOrderTotal?l?this.platformInstance.GetResourceString(Be.successAutoApplyWithInboxCouponNOT):this.platformInstance.GetResourceString(Be.successTitleAnimationNOT):h?this.platformInstance.GetResourceString(Be.successSapphireTitle):C?d>0?this.platformInstance.GetResourceString(Be.successCashBackNonStackableTitleRefresh):this.platformInstance.GetResourceString(Be.successCashBackNonStackableTitle):g?this.platformInstance.GetResourceString(Be.successCashBackTitle):l?this.platformInstance.GetResourceString(Be.successAutoApplyWithInboxCoupon):this.platformInstance.GetResourceString(Be.successTitleAnimation);if(m){const A=(0,be.Jl)(this.currency);if(m.includes("$")){const e=(0,Oo.Ux)("span",{className:"txtSavingsColor"});e.textContent=this.formatPrice(A,i);const t=(0,Oo.Ux)("span");if(h?t.textContent=this.localDataService.GetLocalData(Ne.Q.AppName):g&&s?(t.className="txtSavingsColor",t.textContent="%"===n.commissionType?`${n.commissionValue}%`:`${A}${n.commissionValue}`):t.textContent=`"${a.toUpperCase()}"`,window.trustedTypes&&(S.innerHTML=window.trustedTypes.emptyHTML),!C||d>0)(0,r.B7)(S,m,e,t);else{const i=document.createElement("span");i.className="txtSavingsColor",i.textContent="%"===n.commissionType?`${n.commissionValue}%`:`${A}${n.commissionValue}`,(0,r.B7)(S,m,e,t,i)}}else S.textContent=m;const f=this.platformInstance.GetResourceString(Be.ShoppingInEdgeText)+" ";S.setAttribute("aria-label",`${f}${m}`);const v=this.selectElement(t,this.resultCouponDetailsPath);if(v&&!C){const e=this.platformInstance.GetResourceString(Be.successSubTitle);if(e){window.trustedTypes&&(v.innerHTML=window.trustedTypes.emptyHTML);const t=document.createElement("p");t.className=c?"txtSmall":"txtMedium",t.textContent=a,t.style.display="inline-block",(0,r.B7)(v,e,t)}}if(c){S.style.fontSize="20px",S.style.lineHeight="24px",S.style.marginBottom="0px",v.style.marginBottom="23px";const e=this.selectElement(t,".txtSavingsColor");e&&(e.style.fontSize="24px",e.style.lineHeight="29px");const i=this.selectElement(t,"#divOverlayResultCoupon");i&&(i.style.marginTop="4px"),this.AddAttainableCouponElement(t,c,o,!0)}else if(s){const e=t.querySelector("#divPositiveCouponDetails");if(e&&!this.checkoutPageUrlData?.supportedNoOrderTotal){const t=document.createElement("P");t.className="txtSmall",this.replaceValueWithBoldText(t,this.platformInstance.GetResourceString(Be.SavingsWithoutCoupon),`${A}${o}`);const a=document.createElement("P");a.className="txtSmall";const r=o-i;this.finalAmountWithAA=this.formatPrice(A,r,!0),this.replaceValueWithBoldText(a,this.platformInstance.GetResourceString(Be.SavingsWithCoupon),this.formatPrice(A,r)),e.appendChild(t);const n=document.createElement("span");n.style.margin="0 10px",this.utilities.IsDarkTheme()?n.style.color="#FFFFFF":n.style.color="rgba(0, 0, 0, 0.83)",n.innerText=" | ",e.appendChild(n),e.appendChild(a)}this.localDataService.IsFeatureEnabled(It.expressCheckout)&&(this.ShowDiv(this.selectElement(t,"#divOverlayResultExpressCheckoutPositive")),this.utilities.UpdateLocalizedText(t,"#txtECPositiveHeader",Be.ECsuccessTitle),this.utilities.UpdateLocalizedText(t,"#txtResultPositiveCheckoutCvv",Be.ECsuccessSubTitle))}c||(C&&d>0?(S.style.marginBottom="0px",this.AddNonStackableCashbackElements(t,a,A,i,d,n,S.textContent??"")):p&&n&&this.AddCashBackElements(t,n,s,u,a),p&&!u||this.AddImportFromBrowserHtml(t),(!p||p&&s)&&this.AddShareHtml(t));const E=this.localDataService.GetLocalData(Ne.Q.ApiResponse),P=!!c,I=d>0,T={autoApplyResult:e.ps.Positive,isAttainableCoupon:P,supportedNoOrderTotal:this.checkoutPageUrlData?.supportedNoOrderTotal,isInboxCoupon:l,isSapphire:h,isNonStackable:C,hasEstimatedCashbackDiscount:I,scenarioHasCashBack:g,isCashBackActive:u,autoApplyTitle:S.innerText};if(this.inboxCouponsInjectedUtils.shouldUpsellInAASuccess(E,P,I,!1!==g&&void 0!==g,u,T)){const e=t.querySelector("#divPositiveCouponDetails");e?.parentElement?.appendChild(this.inboxCouponsInjectedUtils.createAASuccessIBCConnectUpsellWrapper(E,T))}!p||!u||s||d>0?this.utilities.UpdateLocalizedText(t,this.divIDCloseOverlay,Be.successExitButton):this.utilities.UpdateLocalizedText(t,this.divIDCloseOverlay,Be.useCouponButton),t.setAttribute("aria-labelledby","txtPositiveHeader"),t.setAttribute("aria-describedby","divOverlayResultCoupon");const O=t.querySelector("#vdoResultPositive"),y=t.querySelector("#imgAutoApply");if(l)y&&(y.src=this.utilities.IsDarkTheme()?"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Success_InboxCoupon_Dark.png":"https://www.bing.com/api/shopping/v1/ux/images/autoApply/Shopping_Success_InboxCoupon.png",y.style.maxWidth="300px",y.style.maxHeight="300px",y.style.display="block"),O&&O.parentElement&&(O.parentElement.style.display="none");else if(O){O.src=He(this.utilities.IsDarkTheme());const e=O.parentElement;e&&(e.muted=!0,e.load(),this.isAnimationReduce()||e.addEventListener("loadeddata",(()=>{e.play()}))),y&&(y.style.display="none")}}}replaceValueWithBoldText(e,t,i){const o=(t=t.replace("$1",i)).split("|");if(o&&3===o.length){e.textContent=o[0];const t=document.createElement("B");t.textContent=o[1],e.appendChild(t);const i=document.createTextNode(o[2]);e.appendChild(i)}else e.textContent=t}isValidCashBack(e){return void 0!==e&&!(!e.isRebatesUser||null!==e.isRebatesSupportedDomain&&!0!==e.isRebatesSupportedDomain||!e.commissionType||!e.commissionValue)}isUnblockedForRewardsCampaign(){const e=this.localDataService.GetLocalData(Ne.Q.ApiResponse);return e?.retailerData?.isEligibleForRewards??!1}shouldOfferCashBack(e){if(_e.Z.IsMobile())return!1;const t=this.localDataService.GetLocalData(Ne.Q.ApiResponse);if(this.localDataService.GetLocalData(Ne.Q.CashBackActive))return!1;if((null===e.isRebatesSupportedDomain||!0===e.isRebatesSupportedDomain)&&e.commissionType&&e.commissionValue&&!this.IsCashbackUpsellBlockedDomain((0,r.S8)())){if(!1===t?.cashback?.userRebateResponse?.isRebatesUser)return!0;if(null==t?.cashback?.userRebateResponse?.isRebatesUser&&!1===t?.userInfo?.isBingSignedInUser)return!0}return!1}IsCashbackUpsellBlockedDomain(e){const t=Object.values(this.cashbackUpsellBlockedDomains).filter((t=>e.includes(t))),i=this.localDataService.GetLocalData(Ne.Q.CashbackShouldStandDown);return t.length>0||i}SetNegativeResult(t,i,o,a){if(t){const n=this.localDataService.GetLocalData(Ne.Q.CashBackActive),s=this.isValidCashBack(a)&&n&&a.commissionType&&a.commissionValue,c=this.localDataService.GetLocalData(Ne.Q.EstimatedCashback),l=c&&!(0,ki.TF)(c.currency)&&!(0,ki.TF)(c.cashbackValue),u=t.querySelector(this.negativeTitlePath);if(u)if(s){const e=l?this.platformInstance.GetResourceString(Be.noCouponsCashbackEstimated):this.platformInstance.GetResourceString(Be.noCouponsCashbackActivated);l&&(a.commissionType=c.currency,a.commissionValue=c.cashbackValue);const t=this.createCommissionArrow(a,l);t.style.verticalAlign="middle",(0,r.B7)(u,e,t),u.style.lineHeight="34px",u.style.marginTop="4px",u.style.width=l?"315px":"300px"}else u.textContent=this.platformInstance.GetResourceString(Be.BestPriceTitle);this.localDataService.IsFeatureEnabled(It.expressCheckout)&&(u.textContent=this.platformInstance.GetResourceString(Be.BestDealTitle),this.ShowDiv(this.selectElement(t,"#divOverlayResultExpressCheckoutNegative")),this.utilities.UpdateLocalizedText(t,"#txtECNegativeHeader",Be.ECsuccessTitle),this.utilities.UpdateLocalizedText(t,"#txtResultNegativeCheckoutCvv",Be.ECsuccessSubTitle));const d=this.platformInstance.GetResourceString(Be.ShoppingInEdgeText)+" ";u.setAttribute("aria-label",`${d}${u.textContent}`);const h=t.querySelector(this.negativeDetailsPath);if(this.localDataService.IsFeatureEnabled(It.expressCheckout)||h&&(h.textContent=this.platformInstance.GetResourceString(Be.BestPriceSubTitle)),h&&s&&(h.style.marginTop="25px",h.style.fontSize="14px",h.style.lineHeight="20px"),s){const e=this.selectElement(t,this.negativeCashbackHeader),i=document.createElement("P");i.classList.add("txtSmall","txtResultNegativeCashbackHeader"),i.textContent=this.platformInstance.GetResourceString(Be.noCouponsCashbackActivatedHeader),i.setAttribute("aria-label",i.textContent);const o=document.createElement("DIV");o.innerHTML=Ze.Z.getTrustedHTML`<svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M7.02381 0.976562C10.903 0.976562 14.0476 4.12123 14.0476 8.00037C14.0476 11.8795 10.903 15.0242 7.02381 15.0242C3.14467 15.0242 0 11.8795 0 8.00037C0 4.12123 3.14467 0.976562 7.02381 0.976562ZM9.28524 5.87193L6.14583 9.01134L4.76237 7.62788C4.55665 7.42216 4.22311 7.42216 4.01739 7.62788C3.81166 7.8336 3.81166 8.16714 4.01739 8.37287L5.77334 10.1288C5.97906 10.3345 6.3126 10.3345 6.51833 10.1288L10.0302 6.61691C10.236 6.41119 10.236 6.07765 10.0302 5.87193C9.82451 5.6662 9.49097 5.6662 9.28524 5.87193Z" fill="#008A21"/>
    </svg>`,o.setAttribute("aria-hidden","true"),o.style.display="flex",e.appendChild(o),e.appendChild(i);const n=t.querySelector(this.negativeCashbackOfferDetails);n&&(n.href=`https://cashback.microsoft.com/details?merchant=${a.merchantName}&domain=${(0,r.p$)()}`,n.target="_blank",n.textContent=this.platformInstance.GetResourceString(Be.noCouponsCashbackActivatedOfferDetails),n.style.color=this.utilities.IsDarkTheme()?"#63ADE5":"#036AC4",n.style.textDecorationLine="none"),t.setAttribute("aria-labelledby",this.negativeCashbackHeader.replace("#","")),t.setAttribute("aria-labelledby",this.negativeCashbackOfferDetails.replace("#",""))}const p=this.localDataService.GetLocalData(Ne.Q.ApiResponse),g=!!s,C=!!i,S=this.isValidCashBack(a),m={autoApplyResult:e.ps.Negative,isAttainableCoupon:C,isCashbackScenario:g,isCashBackActive:n,estimatedCashbackValid:l,isValidCashBack:S,autoApplyTitle:u.innerText};if(this.inboxCouponsInjectedUtils.shouldUpsellInAAFailure(p,C,g,S,n,m)&&h.parentElement?.appendChild(this.inboxCouponsInjectedUtils.createAAFailureIBCConnectUpsellWrapper(p,m)),this.utilities.UpdateLocalizedText(t,this.divIDCloseOverlay,Be.noCouponsExitButton),t.setAttribute("aria-labelledby",this.negativeTitlePath.replace("#","")),t.setAttribute("aria-describedby",this.negativeDetailsPath.replace("#","")),t.style.maxWidth="calc(100% - 10px)",t.style.width="600px",i&&o){h&&(h.style.marginTop="0px",h.style.marginBottom="24px");const e=this.selectElement(t,"#txtContentNegative");e&&(e.style.marginLeft="42px"),this.AddAttainableCouponElement(t,i,o,!1)}const A=t.querySelector("#vdoResultNegative");if(A){A.src=s?He(this.utilities.IsDarkTheme()):Ge(this.utilities.IsDarkTheme());const e=A.parentElement;e&&(e.muted=!0,e.load(),this.isAnimationReduce()||e.addEventListener("loadeddata",(()=>{e.play()})))}}}SetNegativeResultUpsellRewards(t,i){if(!t)return;const o="#pResultNegativeUpsellRewardsSubtitle",a=t.querySelector(o),n=t.querySelector("#hrResultNegativeUpsellRewards"),s="#divResultNegativeUpsellRewardsContent",c=t.querySelector(s),l=t.querySelector("#divResultNegativeUpsellRewardsTitle"),u=this.platformInstance.GetResourceString(Be.RewardsUpsellTitlePrefix),d=i?.rewardPoints+this.platformInstance.GetResourceString(Be.RewardsUpsellTitleMiddle),h=t.querySelector("#spanResultNegativeUpsellRewardsPointsLeft"),p=t.querySelector("#spanResultNegativeUpsellRewardsPointsSuffix"),g=t.querySelector("#imgResultNegativeUpsellRewardsLogo"),C=this.platformInstance.GetResourceString(Be.ShoppingInEdgeText)+" ",S=i?.usedPoints,m=i?.maxPoints;if(l&&n&&c&&a&&h&&p){c.style.marginLeft="5%";const e=document.createElement("span");e.style.color="#138757",e.textContent=d,(0,r.B7)(l,u,e),l.setAttribute("aria-label",`${C}${l.innerText}`),n.style.removeProperty("display"),n.style.setProperty("display","block"),a.textContent=this.platformInstance.GetResourceString(Be.RewardsUpsellSubtitle),g.setAttribute("src","https://www.bing.com/api/shopping/v1/ux/images/autoApply/MS_Rewards.png"),h.textContent=S+"/"+m+this.platformInstance.GetResourceString(Be.RewardsUpsellPointsLeft),p.textContent=this.platformInstance.GetResourceString(Be.RewardsUpsellPointsDetailsSuffix)}this.utilities.UpdateLocalizedText(t,this.divIDCloseOverlay,Be.noCouponsExitButton),t.setAttribute("aria-labelledby",s.replace("#","")),t.setAttribute("aria-describedby",o.replace("#","")),t.style.maxWidth="calc(100% - 10px)",t.style.width="600px";const A=t.querySelector("#vdoResultNegativeUpsellRewards");if(A){A.src=Ge(this.utilities.IsDarkTheme());const e=A.parentElement;e&&(e.muted=!0,e.load(),this.isAnimationReduce()||e.addEventListener("loadeddata",(()=>{e.play()})))}const f=JSON.stringify({promotionsData:i}),v=new Ya.Z((0,r.S8)(),e.oN.AARewards,location.pathname,e.zy.PromotionsBannerShown,f);this.platformInstance.SendMessage(new fe(e.R.ShoppingRewards,e.in.Information,"Promotions Banner Shown",v))}SetNegativeResultCashbackUpsell(e,t){if(e){const i=e.querySelector(this.negativeCashbackUpsellTitlePath);i&&(i.textContent=this.platformInstance.GetResourceString(Be.CashbackUpsellTopText));const o=e.querySelector(this.storeNamePath);if(o){const t=this.localDataService.GetLocalData(Ne.Q.ApiResponse).cashback.merchantFullName??"",i=e.querySelector("#imgStoreLogo");if(i){const e=(0,r.S8)();this.utilities.AddFavIconSrc(i,o,e)}t&&(o.textContent=t,o.setAttribute("aria-label",t))}const a=e.querySelector(this.negativeCashbackUpsellDetails);if(a&&t.merchantName){const i=this.platformInstance.GetResourceString(Be.CashbackUpsellOffer).split("$1"),o=this.createCommissionArrow(t,!1);if(i&&i.length>1){const e=document.createElement("P");e.style.display="inline",e.textContent=i[0],e.setAttribute("aria-label",i[0]),a.appendChild(e),a.appendChild(o);const t=document.createElement("P");t.style.display="inline",t.textContent=i[1],t.setAttribute("aria-label",i[0]+i[1]),a.appendChild(t)}const r=e.querySelector(this.infoIconPath),n=this.createCashbackInfoTooltip(this.platformInstance.GetResourceString(Be.CashbackUpsellInfoButtonText),t.merchantName,r,!0);a.appendChild(n)}const n=e.querySelector(this.cashbackUpsellJoinNowPath);n&&(document.createElement("DIV").id=this.divIDOverlay,this.addListenerActivateCashback(n,e));const s=e.querySelector(this.negativeCashbackUpsellPrivacyPath);if(s){window.trustedTypes&&(s.innerHTML=window.trustedTypes.emptyHTML),s.style.color="#7A7A7A";const e=this.platformInstance.GetResourceString(Be.CashbackUpsellPrivacy);s.setAttribute("aria-label",e);const t=document.createElement("A");t.target="_blank",t.style.color=this.utilities.IsDarkTheme()?"#FFFFFF":"#036AC4",t.style.textDecoration="",t.style.textDecorationLine="",t.style.webkitTextFillColor=t.style.color,t.href="https://www.microsoft.com/rewards",t.textContent=this.platformInstance.GetResourceString(Be.CashbackUpsellMicrosoftRewards);const i=document.createElement("A");i.target="_blank",i.style.color=t.style.color,i.style.textDecoration="",i.style.textDecorationLine="",i.style.webkitTextFillColor=t.style.color,i.href="https://www.microsoft.com/bing/rebates-terms",i.textContent=this.platformInstance.GetResourceString(Be.CashbackUpsellTerms);const o=document.createElement("A");o.target="_blank",o.style.color=t.style.color,o.style.textDecoration="",o.style.textUnderlinePosition="",o.style.webkitTextFillColor=t.style.color,o.href="https://go.microsoft.com/fwlink/?LinkID=521839",o.textContent=this.platformInstance.GetResourceString(Be.CashbackUpsellPrivacyCookies),(0,r.B7)(s,e,t,i,o)}const c=this.platformInstance.GetResourceString(Be.ShoppingInEdgeText)+" ";i.setAttribute("aria-label",`${c}${i.textContent}`),this.UpdateCloseOverlayStyle(e,this.divIDCloseOverlay),this.utilities.UpdateLocalizedText(e,this.divIDCloseOverlay,Be.CashbackUpsellExit),this.utilities.UpdateLocalizedText(e,this.cashbackUpsellJoinNowPath,Be.CashbackUpsellJoinNow),e.setAttribute("aria-labelledby",this.negativeCashbackUpsellTitlePath.replace("#","")),e.setAttribute("aria-describedby",this.negativeCashbackUpsellDetails.replace("#","")),e.setAttribute("aria-describedby",this.storeNamePath.replace("#","")),e.setAttribute("aria-describedby",this.negativeCashbackUpsellPrivacyPath.replace("#",""));const l=e.querySelector("#vdoResultNegativeCashbackUpsell");if(l){l.src=Ge(this.utilities.IsDarkTheme());const e=l.parentElement;e&&(e.muted=!0,e.load(),this.isAnimationReduce()||e.addEventListener("loadeddata",(()=>{e.play(),e.setAttribute("aria-label","media")})))}}}createCashbackInfoTooltip(t,i,o,a){o||(o=(0,Oo.Ux)("a",{id:"infoIcon"})),o.innerHTML=this.utilities.IsDarkTheme()?Ze.Z.getTrustedHTML`<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none" aria-hidden="true">
        <path d="M4.5 5.5C4.5 5.22386 4.72386 5 5 5C5.27614 5 5.5 5.22386 5.5 5.5V7C5.5 7.27614 5.27614 7.5 5 7.5C4.72386 7.5 4.5 7.27614 4.5 7V5.5ZM5 2.75C4.58579 2.75 4.25 3.08579 4.25 3.5C4.25 3.91421 4.58579 4.25 5 4.25C5.41421 4.25 5.75 3.91421 5.75 3.5C5.75 3.08579 5.41421 2.75 5 2.75ZM0 5C0 2.23858 2.23858 0 5 0C7.76142 0 10 2.23858 10 5C10 7.76142 7.76142 10 5 10C2.23858 10 0 7.76142 0 5ZM5 1C2.79086 1 1 2.79086 1 5C1 7.20914 2.79086 9 5 9C7.20914 9 9 7.20914 9 5C9 2.79086 7.20914 1 5 1Z" fill="#FFFFFF"/>
        </svg>`:Ze.Z.getTrustedHTML`<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none" aria-hidden="true">
    <path d="M4.5 5.5C4.5 5.22386 4.72386 5 5 5C5.27614 5 5.5 5.22386 5.5 5.5V7C5.5 7.27614 5.27614 7.5 5 7.5C4.72386 7.5 4.5 7.27614 4.5 7V5.5ZM5 2.75C4.58579 2.75 4.25 3.08579 4.25 3.5C4.25 3.91421 4.58579 4.25 5 4.25C5.41421 4.25 5.75 3.91421 5.75 3.5C5.75 3.08579 5.41421 2.75 5 2.75ZM0 5C0 2.23858 2.23858 0 5 0C7.76142 0 10 2.23858 10 5C10 7.76142 7.76142 10 5 10C2.23858 10 0 7.76142 0 5ZM5 1C2.79086 1 1 2.79086 1 5C1 7.20914 2.79086 9 5 9C7.20914 9 9 7.20914 9 5C9 2.79086 7.20914 1 5 1Z" fill="#7A7A7A"/>
    </svg>`,o.href="#",o.setAttribute("role","button"),o.setAttribute("aria-label",this.platformInstance.GetResourceString(Be.InfoIconLabel)),o.setAttribute("aria-describedby","infoTooltip");const n=(0,Oo.Ux)("div");n.setAttribute("role","tooltip"),n.setAttribute("aria-hidden","true"),n.id="infoTooltip",o.append(n),a&&n.classList.add("rightPositioned");const s=(0,Oo.Ux)("div");s.className="txtSmall",s.style.fontSize="12px";const c=(0,Oo.Ux)("a",{id:"offerDetails",href:"#"});return c.textContent=this.platformInstance.GetResourceString(Be.optionNonStackEcbOfferDetails),c.addEventListener("click",(async()=>{await this.utilities.SendClickTelemetry("User navigated to rebates learn more",e.$S.RebatesLearnMore,po.bS.REBATES_LEARN_MORE,Co.FV.REBATES_LEARN_MORE),window.open(`https://cashback.microsoft.com/details?merchant=${i}&domain=${(0,r.p$)()}`)})),c.addEventListener("keydown",(e=>{"Escape"===e.key&&e.preventDefault()})),(0,r.B7)(s,t,c),n.append(s),o.addEventListener("mouseenter",(()=>{n.setAttribute("aria-hidden","false"),o?.setAttribute("aria-expanded","true"),s.setAttribute("tab-index","0")})),o.addEventListener("focus",(()=>{n.setAttribute("aria-hidden","false"),o?.setAttribute("aria-expanded","true"),s.setAttribute("tab-index","0")})),o.addEventListener("mouseleave",(()=>{n.setAttribute("aria-hidden","true"),o?.setAttribute("aria-expanded","false"),s.setAttribute("tab-index","-1")})),o.addEventListener("blur",(()=>{o?.matches(":focus-within")||(n.setAttribute("aria-hidden","true"),o?.setAttribute("aria-expanded","false"),s.setAttribute("tab-index","-1"))})),c.addEventListener("blur",(()=>{o?.matches(":focus-visible")&&o?.matches(":focus-within")||(n.setAttribute("aria-hidden","true"),o?.setAttribute("aria-expanded","false"),s.setAttribute("tab-index","-1"))})),o.addEventListener("click",(e=>{e.preventDefault()})),o.addEventListener("keydown",(e=>{"Escape"===e.key&&e.preventDefault()})),o}createCommissionArrow(e,t,i){const o=(0,Oo.Ux)("div",{className:"imgCBTag"});o.innerHTML=i?ze():Qe(),o.setAttribute("aria-hidden","true"),o.style.float="left",o.style.display="block";const a=(0,Oo.Ux)("span",{role:"group"});a.className=i?"spanCommissionValueSmall":"spanCommissionValue";const r=(0,Oo.Ux)("div",{className:"divCommissionValue"});if(r.append(a,o),e.commissionValue&&e.commissionType)if(t){const t=(0,Oo.Ux)("span");t.textContent=(0,be.Jl)(this.currency),t.style.fontSize=i?"8px":"10px",t.style.position="relative",t.style.bottom="0.3ex";const o=`${e.commissionValue}`.split(".");1===o.length&&o.push("00");const r=(0,Oo.Ux)("span");r.style.fontSize=i?"12px":"16px",r.textContent=o[0];const n=(0,Oo.Ux)("span");n.textContent=o[1],n.style.fontSize=i?"8px":"10px",n.style.position="relative",n.style.bottom="0.3ex",a.append(t,r,n),a.setAttribute("aria-label",`${t.textContent}${o[0]}.${o[1]}`)}else{const t="%";e.commissionType===t?a.textContent=e.commissionValue+t:a.textContent=e.commissionType+e.commissionValue}return r}SetErrorResult(e){e&&(this.utilities.UpdateLocalizedText(e,this.errorTitlePath,Be.errorTitle),this.utilities.UpdateLocalizedText(e,this.errorDetailsPath,Be.errorSubTitle),this.utilities.UpdateLocalizedText(e,this.divIDCloseOverlay,Be.errorExitButton),e.setAttribute("aria-labelledby",this.errorTitlePath.replace("#","")),e.setAttribute("aria-describedby",this.errorDetailsPath.replace("#","")))}UpdateCloseOverlayStyle(e,t){const i=this.selectElement(e,t);i&&(i.style.background="transparent",i.className="btnCashbackUpsellCloseOverlay",i.style.fontFamily="'Segoe UI', sans-serif",i.style.color=this.utilities.IsDarkTheme()?"#FFFFFF":"#036AC4",i.id="btnCashbackUpsellCloseOverlay",i.style.justifyContent="center",i.style.borderStyle="solid",i.style.borderColor=i.style.color,i.style.borderWidth="1px",i.style.borderRadius="4px",i.style.width="258px",i.style.height="32px",i.style.fontWeight="400",i.style.fontSize="14px",i.textContent=this.platformInstance.GetResourceString(Be.CashbackUpsellExit))}SetShortcircuitResult(e,t){if(e){const i=t.couponCode,o=t.title;this.SetShortcircuitTexts(e,i,o),this.SetShortcircuitEventListeners(e,i)}}SetShortcircuitTexts(e,t,i){this.utilities.UpdateLocalizedText(e,this.shortcircuitTitlePath,Be.ShortcircuitTitle),this.utilities.UpdateLocalizedText(e,this.shortcircuitDetailsPath,Be.ShortcircuitSubtitle),this.utilities.UpdateLocalizedText(e,this.shortcircuitCouponCodePath,t),this.utilities.UpdateLocalizedText(e,this.shortcircuitCouponDescPath,i),this.utilities.UpdateLocalizedText(e,this.shortcircuitCalltoActionPath,Be.ShortcircuitCalltoAction),this.utilities.UpdateLocalizedText(e,this.divIDCloseOverlay,Be.ShortcircuitExitButton),e.setAttribute("aria-labelledby",this.shortcircuitTitlePath.replace("#","")),e.setAttribute("aria-describedby",this.shortcircuitDetailsPath.replace("#",""))}SetShortcircuitEventListeners(e,t){const i=this.selectElement(e,this.shortcircuitCouponBtnPath),o=this.selectElement(e,this.shortcircuitCouponCodePath);i.addEventListener("click",(()=>{navigator.clipboard.writeText(t),this.utilities.UpdateLocalizedText(e,this.shortcircuitCouponCodePath,Be.ShortcircuitCopied)})),i.addEventListener("mouseover",(()=>{o&&o.innerText===t&&this.utilities.UpdateLocalizedText(e,this.shortcircuitCouponCodePath,Be.ShortcircuitCopy)})),i.addEventListener("mouseout",(()=>{o&&o.innerText===this.platformInstance.GetResourceString(Be.ShortcircuitCopy)&&this.utilities.UpdateLocalizedText(e,this.shortcircuitCouponCodePath,t)}))}addCloseButton(e){const t=Ze.Z.getTrustedHTML`<svg id="flyoutClose" aria-hidden="true" width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
    <path d="M5.33008 5L9.37305 9.04883L8.8457 9.57617L4.79688 5.5332L0.748047 9.57617L0.220703 9.04883L4.26367 5L0.220703 0.951172L0.748047 0.423828L4.79688 4.4668L8.8457 0.423828L9.37305 0.951172L5.33008 5Z"/>
    </svg>`,i=this.selectElement(e,".closeIcon");if(i){i.innerHTML=t;const e=i.querySelector("SVG");e&&e.setAttribute("aria-hidden","true"),i.setAttribute("aria-label","close")}}async AddNonStackableCashbackElements(t,i,o,a,n,s,c){const l=this.selectElement(t,this.resultCashBackDetailsPath);if(!l||!s.merchantName)return;const u=(0,Oo.Ux)("form",{style:"display: flex; flex-direction: column; row-gap: 22px;",role:"form"});u.setAttribute("aria-label",c);const d=(0,Oo.Ux)("div",{className:"radioWrapper"}),h=(0,Oo.Ux)("input",{id:"recommendedOption",type:"radio",name:"savingsType"});h.setAttribute("checked","");const p=(0,Oo.Ux)("label",{id:"recommendedLabel"});p.setAttribute("for","recommendedOption");const g=(0,Oo.Ux)("span",{className:"txtLarge"}),C=(0,Oo.Ux)("span",{className:"txtMedium"});d.append(h,p);const S=(0,Oo.Ux)("span",{id:"nonstackOr"},`- ${this.platformInstance.GetResourceString(Be.optionNonStackOr)} -`),m=(0,Oo.Ux)("div",{className:"radioWrapper"}),A=(0,Oo.Ux)("input",{id:"alternateOption",type:"radio",name:"savingsType"}),f=(0,Oo.Ux)("label",{id:"alternateLabel"}),v=(0,Oo.Ux)("p",{className:"txtMedium",style:"font-weight: 600;"});if(f.setAttribute("for","alternateOption"),f.append(A,v),m.append(A,f),a>n){h.setAttribute("value","coupon"),A.setAttribute("value","cashback"),this.PopulateCouponOption(g,o,a),C.textContent=(0,r.fZ)("optionNonStackCouponAppliedSubtitle",this.platformInstance.GetResourceString(Be.optionNonStackCouponAppliedSubtitle),i);const e=this.PopulateECBOption(v,n,s.merchantName,!0);this.HandleECBFocus(A,h,e)}else{h.setAttribute("value","cashback"),A.setAttribute("value","coupon");const t=this.PopulateECBOption(g,n,s.merchantName),i=(0,Oo.Ux)("a",{id:"offerDetails",href:"#"});i.textContent=this.platformInstance.GetResourceString(Be.optionNonStackEcbOfferDetails),i.addEventListener("click",(async()=>{await this.utilities.SendClickTelemetry("User navigated to rebates learn more",e.$S.RebatesLearnMore,po.bS.REBATES_LEARN_MORE,Co.FV.REBATES_LEARN_MORE),window.open(`https://cashback.microsoft.com/details?merchant=${s.merchantName}&domain=${(0,r.p$)()}`)})),(0,r.B7)(C,this.platformInstance.GetResourceString(Be.optionNonStackECBAppliedSubtitle),i),this.PopulateCouponOption(v,o,a,!0),this.HandleECBFocus(h,A,t,i)}p.append(g,C),u.append(d,S,m),l.append(u),l.style.display="block",this.UpdateClickHandlerForCloseOverlay(t)}PopulateCouponOption(e,t,i,o){const a=(0,Oo.Ux)("span",{className:"txtSavingsColor",style:"font-size: inherit;"});a.textContent=this.formatPrice(t,i),o&&(e.style.marginTop="-5px"),(0,r.B7)(e,this.platformInstance.GetResourceString(Be.optionNonStackCouponApplied),a)}PopulateECBOption(e,t,i,o){const a={commissionValue:t,commissionType:"flat"};e.style.display="inline",e.style.columnGap="5px",e.style.alignItems="flex-start";const n=this.createCommissionArrow(a,!0,o);n.style.height=o?"20px":"28px";const s=this.createCashbackInfoTooltip(this.platformInstance.GetResourceString(Be.optionNonStackEcbTooltip),i);return(0,r.B7)(e,this.platformInstance.GetResourceString(Be.optionNonStackEcbApplied),n,s),s}HandleECBFocus(e,t,i,o){function a(e,t,i){const o=e.checked?"0":"-1";t.setAttribute("tabindex",o),i&&(i.setAttribute("tabindex",o),e.checked?i.setAttribute("href",""):i.removeAttribute("href"))}o||i.setAttribute("tabindex","-1"),e.addEventListener("change",(()=>{a(e,i,o)})),t.addEventListener("change",(()=>{a(e,i,o)}))}UpdateClickHandlerForCloseOverlay(e){const t=this.selectElement(e,this.divIDCloseOverlay),i=t.cloneNode(!0);this.addListenerCloseOverlay(this.overlay,i,void 0,e),t.parentNode?.replaceChild(i,t)}async AddCashBackElements(t,i,o,a,n){const s=this.selectElement(t,this.resultCashBackDetailsPath);if(s)if(o&&a&&i.commissionValue&&i.commissionType)await this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,"User applied stackable coupon",new ht.Z(e.xu.StackableCouponWithCashback,void 0,void 0,(0,r.S8)())));else if(!o&&a&&i.merchantName){const o=this.createCashbackInfoTooltip(this.platformInstance.GetResourceString(Be.optionNonStackEcbTooltip),i.merchantName),a=document.createElement("P");a.className="txtMedium",a.style.display="inline",a.style.verticalAlign="text-bottom";const c=this.platformInstance.GetResourceString(Be.successCashBackNonStackableSubtitle),l=document.createElement("b");l.textContent=n.toUpperCase(),(0,r.B7)(a,c,o,l),s.appendChild(a),s.style.maxWidth="236px";const u=this.selectElement(t,this.useBingRebatesPath);u&&(u.textContent=this.platformInstance.GetResourceString(Be.earnRebatesButton),u.style.display="block"),s.style.display="block",await this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,"User applied non stackable coupon",new ht.Z(e.xu.NonStackableCouponWithCashback,void 0,void 0,(0,r.S8)())))}else if(!a){const o=this.selectElement(t,this.divJoinRebates),a=document.createElement("DIV");a.id="divJoinRebatesWrapper";const n=document.createElement("P");n.className="txtMedium",n.textContent=`${this.platformInstance.GetResourceString(Be.successCashBackUpsell)} `,n.style.textAlign="start";const s=document.createElement("a");s.id="aLearnMore",s.setAttribute("href",`https://cashback.microsoft.com/details?merchant=${i.merchantName}&domain=${(0,r.p$)()}`),s.setAttribute("target","_blank"),s.className+=" txtMedium",s.textContent=this.platformInstance.GetResourceString(Be.successCashBackLearnMore),s.style.color="#52a3e2",s.style.textDecoration="none",s.style.display="inline",s.addEventListener("click",(async()=>{await this.utilities.SendClickTelemetry("User navigated to rebates learn more",e.$S.RebatesLearnMore,po.bS.REBATES_LEARN_MORE,Co.FV.REBATES_LEARN_MORE)})),n.appendChild(s);const c=t.querySelectorAll(".hrDivider");if(c){const e=this.utilities.IsDarkTheme();c.forEach((t=>{e?(n.style.color="#B9B9B9",t&&(t.style.borderColor="#5F5F5F")):(n.style.color="rgba(0, 0, 0, 0.83)",t&&(t.style.borderColor="#E8E8E8"))}))}a.appendChild(n),o.appendChild(a),o.classList.remove("divOverlayHide"),o.classList.add("divOverlayShow"),await this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,"Cashback is not active after auto apply",new ht.Z(e.xu.CashBackNotActiveAutoApply,void 0,void 0,(0,r.S8)())))}}async AddAttainableCouponElement(i,o,a,n){if(!a||!o?.couponHeader||!o?.couponPriceThreshold)return;const s=(0,be.Jl)(this.currency),c="@TEMP@",l=n?this.selectElement(i,this.attIconPromptPos):this.selectElement(i,this.attIconPromptNeg);let u,d;l&&(l.innerHTML=Ze.Z.getTrustedHTML`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24" fill="none">
    <rect width="24" height="24" rx="12" fill="url(#pattern0)"/>
    <defs>
    <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
    <use xlink:href="#image0_5278_57317" transform="scale(0.00390625)"/>
    </pattern>
    <image id="image0_5278_57317" width="256" height="256" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAHYtSURBVHgB7b0LvC5ZVR+4VtX3nXPuq28/6W5okEYQRA0EhYDMTEBjUIkCcWRGf4pmTCQZH0kgMS/zI+2YjFHRDkmG6ahM0GR+SWvwMb9xVBJBJyGGkMgQo5Go0DwaaJp+3b6Pc85XtWa/1t5rrb3rO/eee5v+zu1a99ap+qp27b1r77X+a+21XwAzzTTTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTphHCTFc93X33e46dPPnQkxGXtwLQ9bjAaxH7k13XbSNi55hg6BHPdh08OCDev933H9vd3f3Yy1/+8gsw01VNMwBcRURE+HM/93PPAOhfhH33Ale5z3NC/mx3OOHvFp0TdXcNTujd0YH/zdfxjOGeZwt33nN37hkBfqdHeL8DjH+/2lm896XPe959MNNVQzMAHHG6++67bxpH/Kp+2f9xJ7Yv6/vuyZ1T6l7Q+UC+9oLeJeFHFEKfACA9CxDgfvuLcE7krh0ewO+4YP+SevzF0ydO/NqznvWsXZjpyNIMAEeQnNCf3N/f/5OIi2/qei/0Tvy7Bbhr6Lu+CD4yCLDQMwBgAgAp+Bifh98+FQYIf4mFUQIuIJD75y4fcudfcG/+k+c//wt/1YUfYKYjRTMAHCF6+9v/2ecB7H9X1/Xf5IT+2n6xgEXvBL5fJMH32rzP2p41O4OB0vb26AQAsObnayjWQDYIwgXFayL//x6A8cf88by5mXBkaAaAI0Bve9vbXgDY/w0n5K9ygu/k3gm8F3ov/E7gg/D3WvCjtk+mPv+uBL/Lwi59AFn4feICELI1IJsGERuCRUABCOg8IL3dmSQ/+JznPOdDMNNG0wwAG0z/+9ve9tx+gO/vF/2rFv2iK4K/yEJfTH5/Lcz+ZO4XwZ/Q/Gzqd8H1B/5/eQ7pOdRA0Bkg8BQuIxCM4+iciPS2Cxfgf3nBC55zL8y0kTQDwAbSj//4j1+/Guj7nHn/7a55v/SCH4S/i1rfA4AX8ij8fRZ+qflRCD47/LzEdlBMe9nOl6AAaEAAdRMAu/azECODgP9Loz/ODER/9/j28s2333773K24YTQDwGYR/m933fUNTqR/xAn5zYvFMgj+ol9mk79XJj9r/eL4ixq/K5pdmvogTPv0PFw1Bd0IvRV+CQKdfZ8/J1kDDgjGkT44DqvveO5zn/0vYaaNoRkANoTe+ta3PmkE/Ec99q9aLr3gp0OY/FHz12Z/5wCgePmF8GeBL4IO/EtYAPEZiHa/EXzbLOjYaZiAgJ931l8Qvy36BzwIOCig4Sc6oDe67sNHYKbHnWYA2AD6B29961fACD/pNP0tXviXQfCd1g/av5j+nT9nwe+zcy8CQGzvg9D+3g5XQm+rG+vuvazBMwBYMChCzwDQdfqswSDGTcU3ADSOvz8M4zc++9nPeC/M9LjSDACPI73pTW/qbrrp5r/utPffctq931puJa0fTf8+C38x/0ObH4XHP5v8XdH6SuBtFWe1rG4VICjaO5y64gTshPaPAg/pnByOvQGDbD3IbMQmwTAMuw4I/vwzn3n7XTDT40YzADxOdNdddx2/sLf/j53J//XLRRT8bPr30vSfEv5etPXTOQu/qFbCKOss8FLwiX/Gv6prD8s53BcaP9xLwp4Fvo9A4M8MAH5gUmeaB9xTMDprYBhWvmnwltuf/rQ3zIOIHh+aAeBxoB/+4R++cbHc+QUn1C9ZOq3vAWC5MO1+pflTtx92CQRY4xcACIIf5Bjl+Jwi5HxN/FAKvxjUk6LIvQSdAYGWBdB3SeAb1wYo2FGYGgXgHIO+WfAzRKtvnnsJPvs0A8BnmZyz7ym7u6tfdoL9BcvFNsQ2/5bS/Fn7JyAIbX7sxYCePnbngdD8ScB9lbLgs8DH3/EcAIBSRx2HcciBlF8vTkLZHGBzXpr9LNzyzELvhyWL6wIEXXYaUkjUNQfGAVb7++88dmzrNbfccstZmOmzRjMAfBbpLW95y23DAL/qhPpZQfNb7S9Nf7YCrNmf2/pdEnxu02MUcj9dRwh+EPiRf1MBgAwMALohAKUbT3btdaUHQFoCWugxCv1CA4Bzb5RnvQYBjzyUmgPOL/Cu7e3+a2YQ+OzRDACfJbrzzjtvJure7bT5c7zQbwXh345tf+X1d9dhYo/X+ovc5Re1vjD5KbX0qWh818cWhX6MQh497iSepWMU4BCItJ+AXQHWChDmP2t/PvcLf91VAODvewCI110GgvBesip83GGsgEPH1bB65zjsfe3cHPjsUA8zPeb0Az9w1+muG97pNPgXRbM/aX7v9e9Luz9bAF05YpvfnaEPIBDa/eSPKJVZ449R+9PgzkPoanMCReH3OIQ++HhepfPAz8cUJoYN8fB7Ic4xnqn8zhZFABcqaY8kmiKJ8rUdi4CghyXzTEX4XNcg+bwvfcmLf/anf/qnCWZ6TGkBMz2m5Lr6tra3L/w0UPeHWdsv+6Txu9jeX3SL/FsKfujrZ82PxeTPLjsv/CMLYDxYSKUAB+EdhPYfTXPAx0WiGaAsgHghB/sM3Zi8/aWN79Pqxy7noed0nNaP1oY2NnlsAWH6ptDc6INl4P699sUveelHXLC/DDM9pjQDwGNM11573Z004ldEMz9p/L5o/L5b5va+1P7s7WePf+7eI3b4GcFnTc6af4xa32pySAIKSaMHkk5B0f4H4QCETo8CHJP3f8w+ACfovQMGJ/D9qIGmWAGyjeHRqws+gABtOX5/L7DlG++552O/9Tmfc9vbYabHjGYfwGNIP/qjb/lWJ2Rvc4KOW0tv+m/DFvf58zmM8xfe/yz8fXL6ofL0B0UttT2b8/JamPgZBBIoxPdSHOwIhHJWY4e4O7DDygfAFgBy//8igkAAgEU598vefac5L7vgF1h438BS9BakuOOoQecPWK3OjePeS2+77bb3w0yPCc0WwGNEP/qjP/r5q9XwDxbdEqOWj869vi/m/iJp+0XW+qXLTw70AdGtV4R/LO17PlZDFHp3PaxEO3/FYOGP1H4fWOsLEPCr/KRhuxEIKHv9o7OuOP1GCQBegMcEAqEZ4M+9sACSq0m2L6CMCchzFkKnQGkOuKI6Pu7TP7vvvvu+5ElPetKjMNMVpxkAHgO66667lmceOfd2p9tO9Gzyd7Jrj/v6l7rLD6Pnn4f5xvZ+MdKKF18K/xAce8MqnsO1v78ftf648gDgcGNw8QwuzhFje5wwiKoDhmDgU2hbuDjcP/Lmue+jD3dHJ4wU3MXBD+DOYxc9/kH4XZyhnZ8EnxZR8PuQ1z6aLNIxaEYY+p9DmjTQpbEB7Bj0sEELevbe3urN7vL1MNMVpxkAHgN69NHzb3BC9sJFmszDffsLoe3rQw735e4+SN18QvBHEh79IWn7AYb9MRxe4Acv/Pvu1ZUX+O68E/V/3xO+F/vF/4fD8HsjnPjIsXO7Dz98ot+/qT/RPQQP7bjW/I1OCp/sXn/WOO4/j8bhj4zj8Hyi/a0RB+fDdEDg2vjBGvDavx+SDyBp/54tAO8HcCBA0RfgtX/pbIxUbIBBzDdwv+IPB4JsEcQ1D8bF+Gfuvffedzz5yU/+ZZjpitLsA7jC9CM/8iPPGFb4ASfUJ3yX39aWb/fHrr+t1P238F2AvRn808Uhv7yAR/b2hy4+o/FZ6IPgs/A7wd8bo+Dvd48i9e9w2vlntrYXv/qKv/y8Qw2s+dk3vevaFW1/hUvvfxjG/T8x4v42da7t0I/BEohAgKL938f+f3/27fvQxo/tfN/eX2wtwu/lVrxe+OvgE/C/++QXSECSBgt52AgjBVd7H+q68YvmQUJXlmYL4ArTMOCPODV5ou94UM8ya/9etvnlSL905NV72EZO3vrYVPfafwjavxL+PX+44Kvuw07r/+gJ6N7+FX/tSx6Gy6TX3PHyh9zpp/1x95vedcuw2v6zw7j6TueYu8EDkbcIvMM+mv5dymMfrJWe2GPpjz71MPBYgGL+q2nG7jwGzU+xCULxvp8CTf3i9v1h76+5V74XZrpiNFsAV5B+6Ife8secev4V5/RzXv+dqP2T578M+xW9ANw08At9IHf78dBeKCZ/0vxF8Few2nNaMQi+1/xwn2vjf9/eIyd/7LV3fOEePIZ091955+n9Zf/GYdx74wj7x2HhxwT4njv2/PfpvMhWwCJYAYvUA5A0//bCWQKLrP3L9SL2FqThw2GjEvTNHj9KcO/8eVo99/Zbb/0wzHRFaAaAK0R+bv+pk9e91/X5f3EQeg8A4RyH/IYmgBB+Py6gz/6B1O0HZSEP1d5fhXHyQeOvsvC737volDH9xHKkv/qVb/jSB+CzSD/5vb98u1PXbx1g9xXOExgsgTAEeCGbAFHo+czCH4R8KwIANwcCAGxxk2CRugf71N3oUxz9MGHYW+391G1Pvvl1MNMVobkJcIXo1KkbXu2ccl9cRvSxU0/P51/0xezPYYTpH0f58ai8MfSHR6ffECfMrDwIeDCATzmE+Nav+Qtf+kvwONDrvv8VH3Km/lf95N/8Fd8k+MFxf38nzDuKC4HGJoB0/2M9y7AMLBrylOEhtP3HtOQYBadj6KBIU6EXXf+N99zziR/4nM+59bdhpsumDma6bPJ78rn2+d/wI/bYmWe9+7a9X1b17dRmHTlOGPNoPm/+DqkJEIWffnN/6F/4yu94fISfyeWXvuX7X/H3nUfz5c7r/4kw9iA1U1arfT+QJxxDOlbchAnXY/FjpK7LQc5TyMOaoyshjkcKIOAMiu6vw0xXhGYAuAL05jf/vT/mZPQFHWt8tVx3uZcX95QLeybt3/GsOx7uR2khzcEI/4rejbvdy179HS/6KGwI/ak7vvo3ll33UtdX+MFhNSpfxRCAYD+CwMBgwEAwivOYvnPMg5lGHr7M/kQ/KBpDOb72k5/85O0w02XTDABXgFwX3Z/3xnsYyCMFXoGAOHq5caeYEQfsKGfTPx1D0p7D+KurYeuVX/3dL964FXVf9/1f+yFcdi93X/C7QZuH+f37Quit8JfrlQSEAHhyKDOVWYbAG510y9UKvwtmumyaAeAy6Yd+6O/f7rTTV8ZFOxZa0A0I8OYd5RrFLr0+NuKFsqL2ozF5vz0IDO/bHenVX/v6LzkHG0rfdser73Vf9ApXHh8NTQEWfgaDfD3EpgJr/JXU/KTmMeSmALsTXDmlcvyWj3/848dhpsuiGQAul8bVtzh57XO7HqNwawuANb5e0x/FZpws/JCcaGwBRI043LsY8dWv/rb/5gxsOP3pv/119+ACv9b5Rc4O7LhMxzgUAOBmDWv8fL3SFgD3hlAeE5FHCF7vXC9fBzNdFs0AcBkUnH8E3whpbf4wiUfM5OuwM82ATjn98mKZeept0v5xEw0WnJX7+Q1f/q1f+nE4IvTtd7z2/a4wviN/AzsDg+ZnIBjSqEYJAqX9XzcD8pIFeVUkxP6bYabLohkALoPuvPMf/mHHoM/Ka/bJlXvl77SgZy8AoFP76/nYoo0bR9ONqe3vBIPGH3rFN7301+GI0eu/7xvf7pT1OwIIjKtozYz7YVhvtAaydZPmNIjfqidgFAudgPEF9C9zzsAnwUyHphkALoP2d1ev8V1/LORy2e5Omf0s/Oz5N5o/nAoAjGz+0/DB5ZP2vw+OKOH2+N1OfB8ZR9sUGAIQjKz5R7uOQRJ+aQHkCVGQhxW7clzu7dErYaZD0wwAl0X01bwlF+/L14ntuTvUZj9rftkEQDb9kXg33QAAXkAcg7/x5S9/+ZFdHPPPfe+3frzr6H+NgLbKvRpD6tkYci9HAYFBrF8olznj3oDsC/RjA+IQwa+CmQ5NMwAckt7ylrfc5Jrrz8O0NZfarScLPxZgYM2fdurt0io7ZTB2bP+XHoDhX7/8T77k/4YjTh3svcWB273SCvBgkIU/HZT7/YvW59/ZEUh6ibGwODriy8jPPZ7pUDQX3CFpdYH+Gz/prYOybl807Ys1wCvd8n3kfv+k+bu8MEYZNssj/9zNvw1pr5+jTK+/4/XnoKM7x2TZEK2E4AuhT78ZCPJqxHIR07EMkvKUVhO+6SMf+cjnw0yHohkADkkD0Uvi8lUIKDfpTKP6Otk0QO31577/PD6e+/9pZCvgt9/9H3/5V+Aqob0Rf8KJ89nYtBHC7jV/OgoQkPYBSPM/9pLmUYHhL/ppyIsXw0yHohkADksjvRCU8Fsg6MQeeqjG+/P22rwzTtkrL3UBwvgTd9xxxwhXCb3hjj/9APTjO4IvIB15kpM4aCxdoLycefvgpQYwbZAGXwwzHYpmADgE+am/Tlr/UJy9J4Vfb3bRKXAw3X62CxCzFTDuYH83XG206P55nOCUzP8MBmOeQSgFf1T7HMglxutmgLt6Hsx0KJoB4BB0+vQttzr+u47N/bzLTd7xRgt98fqD6v8HMQAo+wC68f0v/uoXfwyuMlodO/urlJoBwQIYhyz41sk3Cu0PUvOLLc3yMuZxw5HPnx2Bh6O50A5BOKye7UcBluWszRZXDY3PS1/pVXFB9ATEJoC7fBdchfSGN7zhvOO294RVh7PWH5LGN1ZABoFRjAEALfzcG+BXEQa89t57770eZrpkmgHgEDTQ+Ix4xYt281IeKDbUwSz0KJ1+SvCLk5+nAbka+bdwlZIT638b/BwwqjEP2RKwbX2xB6F8DlR1CeKFC8PTYaZLpnlFoEOQ66q6jffOKMIvBZsn+BQq7X3IQBDiCOvgx8g8AKxW8AG4SsnZTL8JVDT+mHo98toHCgRGDQyjBgcu/wwCA90CM10yzRbAYWikm7gPT8g0gLAC+C6aLj+e9y+C5yaAO+1+6qGP3ANXKW1tdb9LrP1BCHfo+mQb31oD0PYH+GZCMBFS4wlpnhNwCJoB4BDkdNP1ifMC4UQ41OigBV4JP1/Tfa997Wsf01V9H0861Z3yO/4OLPxx7gNprZ/HRIjJUY1mQd0MGK6BmS6ZZgA4BDkdfqwt/JQH9vBvHQDzvWj680KZ8drVxv1wFdPvP/r7zhE4XiAx7JmKyAsroAg4a3jIoNDyBYz+9jGY6ZJpBoBDkOt5XrDy5vV7C9nRuwQKEKDGBF4M1AHLLlzFdMcdd/gC2I1Cz135EQyEmKdmQR7tI9YELD0AueO0OAKXMNMl0wwAhyDHdH3WWOmvZtT0O58Su6J5Jpk87oYzwNVNFDYEzOU25tIrg3tkzwjkpkAW/kb4ENMIPcx0yTQDwOGoK6Y+5bn8+ig6LZNh8EAMCgEf8GoHAG+uU9bw5a4pK/07m/ygmwTycE2qGQAOQXM34CGIwvAzy6zxehoEhCYD6StI72vnwdVMpECTTNkI878ARdH6sdvQTwBCjorfm5XZIWgutEMQESAYjSW1e24GkG4GGONWXPPz8aoHAEqN9lgaTphxNJaRLQISUFqDavQZ+Mtx5uVD0FxohyHkdamE0ItZfXJsv7UQSJq1INu1BGlhgKucUtlRnOxIBLUFJa0CAg0QpMs9ojFBPfRqpouhGQAOQaH3jiSzjtGkpQYDByqe7kr7YzF944oXVzlhlupUJtwDQNBqLsmmgQXT7ASksCfhzMuHoNkHcAjyPgC5km+4Is3ANUOX8D6s3QYsxfuEsADYAwJKqDUQkAQJ1CDA3YA1oM50qTSj5iGoI6qcV9rct9pfPBMmv9ZqTwwm9rKLpAV7+igvVc+M3wDTvOCZLo1mADgMqTn8xYyFysyP/dwohR2LpuNwxSN+1SwCtIai8KsmU9b+uvy4iWCtKXWdhhS7JsAMAIegGQAOQeM4IE9c0UDQNv+ziUstphfmLD4RzIAssABpKPB6K4CdfKYZIK2EeG8GgEPQDACHIN7Bt2htycRjPmTbNo30g6LZQL8TPVlwtVNYAMRbAFjKqQCB/W0BdVQrKEsfgot3BoBD0AwAh6DksQc9oUUwMNZgAFTMVWXu8qQWz9z9E6AbEOOUPp4SrCwkIeyorCrdW5ABU4Txy67NdOk09wIcgpAZkdpajMh2b6UBL9ClMGnYHxU/QehFGK76kcC+/eT7UECBo58eYECUYKqJEMsxkrIGZgvgEDQDwCGoaHLW7i2z34ADMQhwFxiUOGgU8wmudqIkr2w51cIPuK5ZEIcAFyuBmwJPBAfqlacZAA5FSfvTaKyAIR44JMYeQDJvBI40bs1Hg9KpxXFc3RTHQGjgJFt+MDStAWQAIJ5CTU8g4HxsaAaAQxD5LidiRi3CLjUapOt49OIeBId1MINJNCPoiTEMKC/owWVDWuiLP4XL0Z87UM2ntO4idwMGEJidgIeiGQAOQ3k56wEkEGRGJhb8UTzrkp7qvcsq2gCknV9PhF5AvzVY8HUG66mAQCyjFUSWlODqhb9PzxHKRExeRIWgOc16pouiGQAOQX6temQGTiDgN730BwRtz2fHuMS/5SKAJLqtqfgAnghTAfKyXknoKQm+L78g6HyOgh+1P1sBbBFAKb/cDJvpMDQDwGGIN7X0U9CFFVC0Fmsyd0Zm4mTGBhn316zBRjHQ5eonZzk5f/0QgDGCgBf4RSwzSmWWBT9ZA8gAoFdTZXdgKL95JOChaAaAQxAlCyCCgGwKMBMPwhpgcIjXvCw4/5UTXPAJ4AXg5bzjrsC8NZgoP19OxM2AlSuvPjwLezCGYwTekzE4A325PUEGUT0WNAPAIWhYOcZ0At73WLa4NpYAsuBTcWZFpuWuLMwebGbi/ongAxhWrhTGsPU3jUX4gzWQmlVB8B1rBq+/F34ci6WEZWiw9wOOfD13Ax6KnlBm07ve9abF6d1PfsGxfvUFXTc8a9nTbdjjaeeUOondxJJSSSkPgVGdueoY+L4H8IX7++P1mDb77Loeun4Bi96du4UDhmX43afDP/dnr826PmkyuX4FRc1I4+5nji3vf19a5pr7DEqgMoAoWL+xIwHFsxKeh8uEc3o8pnO4n4J24v4l4Y9wYYQ4grDmxRLzw4Gi8NK4H8ru3k8v/qgT+h1MW6b3rjx8WYXy8mW3WKQyXKQyjb87V7a9L2d3gNiDMaTiLbLxzEcW3QO/M6YelVSAacwQ5UKhVCju3ZU7zrgsPOyaaR9fdMvfHfHU+3b+z+0P41W0NftBdNUDwLt+9i9cewIeevVicf5Pbm+NL91a7F+/tRhhuXAtzwWEHXsdDzbWk6E8WIe7rcCM8ItmO/Di/lHDR9FMDNqlPv/4O4TCMg4AeS+xvKeYrhC5boBuHFiJlYNj9EAjMpId0jctDe6RRDFNH1EXQ1n/YA0hO/kAylDn1LU3jmr6b9lODXMm4marqYcEuTxL2eX2PwLIXZjjB0COm3MgS6aFcH2X0vG7NwdgWbjcL+9DWP4K4PbPw/KG/wefcsc5uIrpqgWAX7v7279o2T3yxuXiwmt3tnaP7SwHWC5H2Fq6KnaCv+ij4Pdd3LY7UEsLYulmomSuxx48yWBp+6/0brwsLf3cd02Yn4MSgAIA5X0ecqzzFIWR1shi6mFACSCTIfMehTlt0LACUGCEb6Yi0IEA8vJmBbRI5AnySEiUH6oIRdlgjh8Vm5pyQ11uOakMBPqLs73Eu7J4EOi7qAmCSZcckN4PQTufcUDwj2G19Q/x6f/gQ3AV0lUHAL/0U9/2zO3FmR/cWZx71c72+W5nawhCHwTf1a3X+ovOa/8o+H3QAEkjCa1XJIEqYNCCkwIXfk13+Mq0LPxtMSIYOKzoHcQUZdbEJFLOv0XABqvnT5GaXX6bjBKbt2PMAURQP88ZzIHEh1OJk0yGbCKgyyADT5HSVsAEpGSet8thklj4fRw9RgCQB3I3ZACCXRiO/Rgsjn0/3vz3PgVXEV01APC+u759ef+xM9+73Z/5nmPb53aOba9g22n87aDxhdb3IOAqnDV/hxja8Uqe1pFVj/K+uac1EmQ92jQ05IW27LMs1IBgk5VgJISUn6FK6RLoEgRrMokmusJ0fmR4Ew5t3i7mm6iOIxzJAsgggKJd2EcgwGQRjMcehNXxN8Itb/3HeJX0214VAOC1Pg0P/tOdxSMvOu7AemcrCn7Q/Fn4MZn9LPwYHVDBAlhTDFPSKqVSPQDQKhCzVlSquKVuL4UuUeGtjYfzMHUPJ65t+EtO2EQqmlHKYmh9J7K5BKAKkEw8ADX25PsoBD5d+zOm37lpgMUiGJbuOPl/weKW1+F1dzwER5yOPAD8wtu++Y/28PC/OL585IbjO/tK+L3ge7N/6TV+AAAWfud9docHgeBgYkeSp8MIY4taFoJ8JtOhxj37XvV8TSZJavuWJFwGrQPEiw3boimAOYRyX0+iIDsBAFn4MZqJYdwWFmDgpoF/b3TP949/EPaueQ3e+ubfhiNMRxoAfuEnvuXrOvr0Pz229ej28e0o/DtbXutDEP6tRdT6i76Lmr9Pgo9dAIEut/WwLgk05jNAaX9yu7du+BuGn2hgmyCTGmodXSmgOixV1g/fB8htdBs235Ya35j4lQMEQLWDAEy9INQ+CZkXHb3KJxjhzlaAaBIEnyBbAyBAwJ1X258GOvGVeO2d/xGOKB1ZAHjHj73uVT3df/fxrUe2jrv2/jEh/FtLjA6/oPW7BABd6kfG2B/vu5CC6d+VzuuDNDGuOU+Fu1KU41vH4S0zA6CNUA0ga1FLiC6l6bEuGxPZqkBxXbwHFcc6cEWh/dkXkAGgK0CQz1CshgAC7rS//SAM13wZXvdD74cjSEcSAH72x1/3Ilg98O5jy4eOnciaH5zp74WfNb8HgS5p/T4CgBf8jgfiiM5/0Q//2EnwFaDKwmg8WxfmYuI56J3Wu1P3AKabBvYZXkTYKeCdajIcWJVYBNoCwKKLTQG+XjAIYGkeeAogsPMx6E68BI//4MfgiNGRA4B/8VPffiucue+924vP3HZiew+ObTvhd+39nS0M2n97WYR/sYijx3pM2t8BQBlBxp8utX/iliZDtYpqDUhkkxcnXp9ST404W8x+idm5Is8/26S+WzYJDgjbumGfy+pH1P6ALPS9OPi3BQGKo7/3jr0PTlz7UsQ79uAI0ZGaC+C7pN9x14M/1sNDt233e7DVj7DsUv9+OEcn3yKZ+/7fAuPwUXcHwuixMJ/cjvpFIfSWyRpSkbVVgyFbz6R2k6Z81lAyLMJFO9TkMxn3xWjog55bcxoaaUw1D1pFCHAwuLTe5UG5ceB/Oz82v1Ugjot9BiaI9yEMlAAghQsTjEDUZRrlGawF0Wz0Jy9FtPslcObR73dX3wNHiI7UUqo/c9e3fCusHn7lVr8bhH/RR+FfBsDGMKgnaHuMgt/jwn2gO2gRzf4wfTfOIssVm6+nSFgIUoinqDWKnBrvT8XVun9QHg/K20Ej2+mAe9Q4psLARNipeOgS3m3Fc7Fxc31PWU7+8CCwcoW17469oRz7Q7znn/kJi37msXcCUlzzIYwX8BbC1u4b6OHveTEcIToyAPCL/+S7rnHC/wMLPOsEfhU1vh/Rl300UfgXydz3wh8BoBfCb2o/CIYQcD5PMee653QRcVzsYdO6nDin8n2YOC+1DOCA51f6gAPybSm/gwUgGAi8wAfBdxK/u4rnDAKUVixjazINIV44RFjs30n0piMjV0cmo2cf/sxfwuGRJy1xFQVfCP8CMVgAbPovWPjThBy0bcFwCCeOZdqLpXWMD9AWhnXvHSRIrThsWnBAOL43wnphaeVhPCDsxQgowPpvXFcXB33TQQJfxcvNCoLKGvRnL+x7/liVw4OCv5/XfJUg4DXR/h+BR3e/Ho4IHQkA+Lmf+J5TtDr3XQvcdWb/KIQfG6b/Ipyj4EetXy0ZRzgtMDB1Hw/WLJJ5xsY9OOA9OOCdixHU1u+pdwGmBck+n2raTN0HuDghbYVt5Xkq3DogOSgfgZJDeKpcuEmwLwBgP90r679Gngo9CT663e+hI7JPwZFwAq72PvVNOJ65drFYhQUlVRctQOriK57+cKQVY1SzL1Q81h71FvMB1OEUeaah9Q64g7RRI8qLeocu8qUpJ93a+C423UO8b/NDa54fmkSlt5yFIZ1Gs0+GU3WJfjEIJ/z+hpP4fmUmDiXBZ8du6FHYfwE89Dde5m68CzacjoQFMO6d+9Md7Dohd9of4yLbuUsW48i+Pjj90gCftPYeGrOOpjTLlGZSXmDmCqMxyFwDh4dpYVun0eAi8qjCUf3uVBzrzP5KK8K0Zq3uYZ2uukZTnnBx+W3mLV5Tqyw4703dK+pmKv5m+aebHgRWQ2oKDPHa7+QU/AEUrQF+v/NrH+x+MxwB2ngAuPvHvvN2GM8/v3clHLR/7oaNK8QF8x+09mcxVfU7TvCFJMkEPD8ga4sG40imAuFI4rjCPWwzGECbAZtMfUBe+TyuiYcuIp78m9qCDlP3aL3Q2iHDre8dYVoIp37L6FvfV6WD7TCemtYH12uqwxU7AVcRAIIvYIgAwOsSZqtw/zX0oTftwIbTxjcBcP/RP0HD+a5fjJBm7eYxG17443TeNL4//IuVLBfo8Ce2BuI1tPu25W/FDWts06ZQY/1OSEPcs9E34rLZuiiiSwyfsnSotA5DE0UZ0qdyVg+A1zqicivFFccHYR0/tlIAaA7MoolroMIsPC4gaP0+AkA/pNGDox4X4MN2+9fCiQsvcr9+HTaYNr8JsL/7pR3th201/CEHYYVFo5CFP4JBICpKJw/IEyv4aI0lBNJqMaasEaU1kA5oHTJOEY7jyO+BTlv+BpAraE1o1sbvqW+ZSIM1L8JEPLAmfmjEN5EOcZ3wSmGNvIa6Iq3RYxWx8GNRsNQQ/lY+cpmnM7SeQ7scSwbKtTf5V9wEGOPhlzsLzYB0TWn/gn7/j8KG0+Y7Ace9F3WuMFNHSxIxzAIfmwJdMP1zRWPR9oEy0xCocf/MFC3VZxm8xUSJKeufrbCteIX6tfFSQ1XSVDyQFxtGMlmZEtSp68Y5a2Wbd1qfP/6JqadATYyUIJBuSB1POf5YDiz4IYxYpaiZPrbuY/28FZ6mnqWLMQn6KvkE/PBg/5uZU25o6ngXNpw22gL45Z/8Sydo2P8cXgY6deylsubFNiMQYDqUcLNmAQkG9gZMM78kEpHl+BHWasd1wkYijsbaeFFAeKcA0xYVWpXjC98v4sVKu2EROnFuH6h+o/3OpBXJxEPmAFtk/mKEehaxzBOU+OOLJJ7rdf5auJ0FXVlp7fSq31P1lvOT8uJBYEzafjUWS8A3D8ZRWgLPhA2njQaAs2fOPQ3G/T6um5/EgBD0v2IXTAlwhgXJnJaocV7HGFPvrhN+mohjbN9njaffK2CAUJic0jrfxX9XBIGYgXNeMJvaat1OI9zyfWuykwAaK/BrD7D3SGY6509baeXbc5lAKy6Or9EsaOWjRSSbeSkvoizydbAEEhAMQxH+VVo92u9vMOw/nehNG21lb3YTgIZrcRzi3IvwuxwZCAQgtMxx9skUSl4AmjDmceqGuG9fsgxFE9et9/CAsDDxviHebLQ4O6NQYfKV8G/1PtnoUL1HacxELhIuezTv4gH5q8pU/hAPqfUywNpZgFNk68aWd7OsUYSl+j5TsACS8KtriA5BBgMatuD+88fc3TOwobTRADCOeyd8TaHQNop/eJntDABQCV/Wholzp1hJxdu6rgKuCdN6jhNx00W8exC1wIow87FZ01eUieR1SuJf2txcgGQAixrfYYLIRw2vPlShrZdfrQwswLyORxJOA2oLuC0p0LD8JCJgSyBYbiz8XfmNI1sBHTxKjodnADgU4TBuk1pKCpTgy4oy+t8Qc26j7ltci/JBIyqwYc3vzLjUfrbu/TVJryNr0WhhkZpNB8qCDlEIYWrPAVH+SkDTPQSdhP0NwEVCenMSLJuEFK8+gTTjsVXGnHkUHyPzCRMZImiH44DU+mhD3N/P15x5f90lJwel80630WMBNr8XIGn/6p55znxs67vietRy1mSILBTYNiMBaoYC83tKiIwA1hpxIk5cEy/U4GcBIadNLGzUfluuw4et8iyPyWRAWs6qGLDkqeQFM0YWuyN5+Dky0M0PVGVQQD0HJLh0gZcfZD/Q/lRAJNIeJ173xwXYaDoScwG02S+u5b2WFq84V2uWzJyWuSwzgUnTXkPrPms4MELeyov4sFa8IQ6TmaZUimTTWIPwlmBQypOUsBLWWBAcQbQG8s5bqNMjm49KeVIxE0jbJnnzrpxUsghQgC5UWATFsoIG4k2cWySRvwon7k+NMZCZt3wn+zb95c5mDwY8EgAgijTfIPmArwUTlrkAooZa7ckqLmwLP5hMVBoB1mde/qDGQzwoDprOh7xpuvCIu/9GzL99jwFxkyjFHYspFUbHkjmmfTGiBPIeGYjGeqB2xpG77WSzogFaUetHCwAbwYr2x1IW6ybbHaQIKpCgCVAxN7ERP5/zgeJ7abYALptYMZDUGEVRccGj1eStmhfvZH40pmtm7ikGo4lrG6bFhCpf4prsffsMDgCIpJ6ZAf0RxqKkkXPpHJql7noUU5VJgkBOOhV6GFtBARDC9ml9tAg63jAnJQv2m1NmWzgnZY3PeW1WgLq9D1JhS8AkmLQIWnWUtLOtDiXLgo/UUuatuEADraJQH1zIm40AR8oC4B9yqCgjgbI4IRqa6m1jznE9yzpGMPEq4cM258AB9+w1B2SNy3mjKUk3CJXfz+IDSvMP6eyFfoxAMA5R6CUIsPM6lhcBT18nloIEAgoA0tEtolXggaDrqZFFUl9iFWZT4LmHxhbDFMDw95tqLlT4QrxVokpRyNnhMjxORowiIJUg8mDeqfK0eXSkFgWFLJMkJNg8x6l3tZRSk7F0XNV16x7L4GSFC05WWeDM6nzp63QejVSENDtQo914UYowDD0KPwXhh3wO164cxoEKGEDhZV4cJ0SdpBrTxIuui0DgBX4cxiD85K4p7KoNZYdlkU0paBVIoP1m0NqZRDGF+1hQPkcso6Bm96TME4lE1AAoG5QVOLbiIVAjDHMeTISZH2YfwGWTHNaay9pWNjMZqZ/iJXWh3s9WQKV8I6cwvzWJZNwkEkahJbDxjhHyZpySRHhe2JSv8/BzDHNQYhc0xe7pFQSBz4cDk8EDAHdVe0AQHm1iTZyWyuZt8cYe09lr/c6dx7AWZr+k0PMFC8g+Alu2+ZsQSlsezJeTOpkvR12mVOql+YIAHxu/ukaZhnhEGoRUXFJzKH+LyJuKdW4CXB6ZMuWx8VJz8bW11HOd59lkRhilcqbqVmEygAmhNBmtLhFa8q/uHRRvxcly6DMWwQ+anyIA+FGoq6ip/XlYjel6DMLvrwM4DCTKMPkLOrFpSto9KeymlAAgmP9hIdwO/BRtDyLdggKQhC31Flh6DoTCTsWZ5mxMlIW4Fyf7UMHksSXBUNWPbF5UXaH8oI6mYIKoMstDOg6hLWRA+dH+eneYUh0bQRsNANShFg+pTUjoEcMb0tSLIdSPdnwAZgxMMScQrbkHTS1SwqDmTLpILU/r8pdUcRZ+EJqfsvCPXtid0K/2ByfgA6z2BthfDTDsj7By51V6PvieAG4KiJWMMO2biH6BlT6q9K6P1/7AVQSDbumBxp2HNPbFHw4Ieg8EfsHG1CSQXX2TZdcoCx6nMFKsP2qWkxw/KNJTKK4FGqfqTb4PohpF/avqUUKf/oh8Zdo+QbDBtNkjAZ1tahG+Mi+JDFQDqHY5avbB/GINCFVNEVb1WQWS3MURqjBTnGbeQxuPiUMKv1w9h4WftbwTfC/8+/srJ/wr2HPH7q4HAoI9DwL7FBe0WVF2BsYUKG6ZHpa6wyDsfRD83gm0Py8KECzcMXRO4NNaGLk5UerEWwK8s/akzLUEX5QNph8EUviEVLPwY12mbAFItlGWxwg6QwY0AKDyEyjFn5siIgKbYHhpbgJcPrWEjgxDTIVPtahHkU1IPYrnrWgJ2r4AzaFtogPuTeqJJPw8Gocdhzz0NE1LJaftByfZ+17od/ed4A9w4cIKLpwf3QFw7nwHD53dgk88fAzuP3cMzuwuYG/oQ1xLJ8Enliu4fuc83HrqHJzc3oMt93u5WMHC77O47OM2a4ulE+wF9M4R0Ll3Bwcgi7ETo1+RESAujrvk6drGIDqgjILp775zlMAtpU9JI2hAJ3XSOD8FtvJaZE4uNoIiX1We2RrrTBz+vLdcxxWPO202APhdWGTdpsLOQM+Fz0QNpE8vq+4gnBBmwaXE2p/DQm3dacI2Qx1EtCZ8yGBaAUE5n4rge9c+OcFfuWPvghf8fTh3boCz50Y4cwbho58+Ce//+HXwu/efhvvObUeHn813lprYz3/jzi587nUPwxfe9AA8+fSjsL10gLDVwdKBwmK5gMUQgcDvg0EOAHp3ZKciQB5XEJZu802FRh3I71dtfQ6LVOo43aeUv1BkYn4DpWHFTRA2gICtspaAIh0HiUmKlSTQhJ1++kOMyeGO7f2L5YTHhY6OBSAFGOqyz2Yj/862J0Hl2eHLcUKjM96nRTYMP8Ala/t1Qg5T95Pws0fNU5iEMgrhD7a8M/v3g9Y/7wDg7NkRHnqkg//80evg3b93M/zeAydLwXSQR9vaocXx27ogjJ++sA2f/sRN8BvueOrJs/Clt30KnnXjA3B8xwGBS285eCBYuiwsXS/AIoBAWLCN7Co98Ve/LMJDUiIl9sh3hKIv+RPoqoTUALOsGwnI8jtlNCqszgyJ9gu7JLUSQMGbpoIJDuaTDaCjNQ7AUFXx+SaIChWVyD9TxR9YN3QR6ZXG6rSAX+wzmfe83ry0K/M0U3ck4V/tw+7enjPx9+GRMwB/8IkT8Av/6anw25++JrCr18CysRQG/YxQxt8Lr1nubsW4BpMHmY8+egL+2e88HW4/fSP88Wd81FkEZ2Fn2Ict92yZ1D45Nhqd0U/UaUQV2BV6DwB0b806IbHlla3A5PijZFe0EHzC0mAcjBaEzk8rLS6bCruxkU7LF7WuzjeEjsZswFQDapFMwOJzkfInNHwm1M+lICsGyJoRlNWwFsipQoTp0FY7oTkrUDHClEfuDFHzOyEchz1n8u/B+fMDPPgIwr/+3VvgZ3/rNtgNmjkxrzBhs3JNY/3DWP1UiHHcfpmqG353mIXgDx45CW/7wOfBlz3tE/BCZxGcoH2XHSf8Lk9e/Ml7BOOODal6SncghhGFYkddgEsXFKVcKRdNBgJL0lQT35+rAGsdkWEyfXPCwvQ6tvPTEnps3N9QOtJOQPuMB2mxpsPG+6p/mqAxWERrcx530MoSM5Kq9JwQTGsie23VC3v886iaJPyQNP/ohG+16zz9rr1/YYD7H+7h537z6fCuP7g5vBO64XKesai6cgrCG88UhJiHrvvfGQQCyLq/Y2zc7znn3y996MnOl7ADr3jmR+CUA6Mx2hRACaFjcXUghhLE3oCwnRuWz80CXK5zkZEuWxZEVYymrEU0ScNL1EMZNFsAoEupRJw0BNrMygiy9QSFH1tOjnkcwGWSqFlmjtwxVG7EUzIrJ4UTRZ21LICKis1IhkkrcJHaW/2uv6P5XL6eRuFlDjTCD+NuMP3Pu+69B8/08M//wzPh3370JmfuxyXSs8CkKb9d6goNws3f3KV1BDGuZhOcbmn3FD8+IPgD3O+gBxMO+bL1d/7Dp66D8/sIX/uce+C0zxfuAU8djrjVpwFFmHbQikOJR/RDiVMhjKJMSxXq9rkokgpkjXGU60Vd1GWtqgs1GLTC60lBOMEvnDmTpj+2+6ma3gjafACQsJ5RG0VN6s0/Vd1LgBCmHQogkPLarNgRMhNgMRLb+czctAYEJomlIalMlYpo93vT27f7XT//mbM9/Oz7Pxf+3b03O63fRaHjuNRgJEgmPSTzPp0x9naE0RbkRwdiApvYr+eTZIkSK/OH+H77M9fA1n+9DV75nI+4dIcs/LzIcRwW3CXtz1vpUQAeBc4AldxYcCWBhVVAU+9RQKWZBxVqV5YGTCgNYIsI6njyMGACNSQ45y/9mKcDXya1JFPCeKsNmM1GywjJBM1AAk2rLZOxO0nkx/CJUiltMKnzqC0CAjHhPrWXqWh/3ycavP77YUTfWdev/+sffDL82j23uvZ+D3GJdHYYoimLyKTxe2MGidv8/ozRMdihB4EuZcfr+i4CAYlFRVnS3aPfvO9auOH4eXjp7Z9yt4fYy9DFIcN+uHAQej+E2FnBw+AHD8XJRNhpcFL1AQK3UzlXo/eM8MtvRRuucSYRpqor0mm0nmkrQEQkTREZ1wbTRgNAUED+Qgk8FI0vKkQKXp6oRXKJCWhqnPx+JbFiearEMVJzKHMTAKRTQZmsMt2cuFFbTNnzzwjDY33TAH+v/V0X3PldgI/cfwp+4b88I4zQi4Nt2G8AisMVTybhD557DwhccGnBDwj7W1A0enzLAMcs+CEOL9g8Jj+AFMG7P/IkeKrrGXj6jY84oR9cfvbjUOFVXDfADxjy10Pv5wrECUlR/lFbagiyQ0KVVGURANRme34fU35Fx10LjU0a4ZawEFSGpLkg80gayDJPKr7Y7IFAG70vQC9/kP1RlyvKM5WmAo2k4yBQW1BFnYYaWEIYbdqRTYvEL2EBWMDSZPLuf/LaESi2mw6/KUoim//jKgzhPXuhh5/5wDPhgvf293HsfgCeLloByNtW+yZBH++XzVMg3O/SJJ8w4y8fafKPH/PfpyZFupezzNcpjytXRr/inI/ndnvYW8X5Bn5E4uBHJqYJSH4Gohd8/5snIHH50YSWVuVn6wUaJBZFYctOrRRtlEZOn4te1J1UKKqt2KpLFa9Mj+Pb7IFAGw0AgUTxFaGTLGAqGZLiTBo8awEjlFL4o/UmKrrFYoaByMTT7AcGaDN0uEZQGqR40EQWGB1iE4DGwbX9AT7w8Zvgd++/Lk3aSZN0urI7Ur4GSE0DTFHHjVTzLkphX0V+r1MgEA4fL0KOUyBryjIGkPrYmR34rU9dC3vOMbjvQWBIAJCAYOWBIAk/H1x2SLZcoBJU2UyjRpiqqgQITAELWSDg7lAoth4KUJFx4QQwCdSYztyG0UYDAPFcIClswJVGbUYgcdF6RjYNqCqRBENAi4nG8q5tCzYZtNIQLeZAAQIIeVkuNv/DkF8KmvadH3xaFuao/HmX5CL8HQqtngU+HtJi4HvFeki+BO7H78xoRG6epJE0HO+/+/h1IW8rtgKc4I/jGA4axrwOQbxXluZqFYOsG9lb0/TAT9QRiTjAxGHvqegkr5m4lWUgE8m/0Wj/zQeBjQYAxMY82lyJWIQNoEb7vCouToNEAxxSTxjYaabVO1TaiqrLmdakwWxfAQNAdgDmSX8kVE0c8+93nfrw/afhQw9ekwQTIItEFmaOL/7BZK6jOMKTbC2kJkNqK2tLQAMFdmh619JAInf+9LltuOfBE64ZgNHkH4d4eEtgjDMViRcj8e+Ircxk8VSCJ54rrS5BtQJoynUh/QwCt3T5N9JDMNFS450K0C1iNCFuo2jzLQArpKJm5OKr+bZkCjKoDyYuPqd4eXNRajEiQMUovHmnNVNbYFEOBgEl/cXsl0LME/6DBUDOvO7gfR+9OQojUDHtuW3P0bBWxxx7BgFOp+skEEBuBnD6XV4NSFgUqHJcshtaMwS/9elTAQBWYeGRYgGEg6L2D70KHiDSKMTgquONNiSA2rqiUv36mbib67K2xnLRizi1/wFzPLL+lfDLOJWpgbAOTDaZNnxrMMLSRks3zTkPw6eEZvyCYRX1i6CMRReAUnaraSB3szKpMElOFXWiZM42A3xfmOh6NFPkJG+ZXNjv4T9/8oaUPbF0l0wwC31h5oJQ2vMeOy5IvEfKqgnWgA/YpbkB1IWxA5nfU68Hl9uHHjzm8tjBsaD9/aIjA/TUxSHDYxxnMIxxWbIo7HKtBlFI8pYpbvUzZ5t0GZCuf4EJKh6Ucco4TFgVLme1JfRUPsMix4bSRlsAXWNFoFJPVIFBRnm+IP1eOEaoTbpwto1PEweY8IIKg0iGplqDSGaR+Wftk7U/apOGol/i4XM7cN/Z7fgGa24Q5nyR/xJNPtDmOFkS0gJIgTn9tCCojlTEYiTjUSf8nzm3lXbLjiY/sfYXjetYD8JBmxEF67I2ZSddM+0t0IVGACPfZM5TZOo/b2QCpvrJXFQBNp822wcgJq8rHiRqtuPa3tlSI3n8dyucqTm1jJgKV7+rmQnTPdR5AnsWGkT2/UtLIE8EpNCsveeBU1C0OEGxWkkq/6z9EYRAh6i1lmOQEGijAAVydjrhWOSsj0leS+H7wUOfenQ7LBQShT7NFEjLBQXnHwt/uCiz+hQu2vIec5ar8m8KsqmnSoOLcGsBQa78S6V8FF9JRDJ5C+/vbfZcgM32AXRIYJA7EjbRVohsDlaQvKwia+tK/ZjSFC0QgHaeJuMHaLQ7ZWalJYD6uROq+x49llEMRaQovyvto07irz9yswGxauFIR6HMbGwCYM4WiSzxcFtiCUvNgc+cW/jVyeKag0Lz89RjEs4/uUWYKglZr6K8SAo0iPpW4zVMRgPgiBdSPGjqWGKZrueYitxJqQYBaJ/9xdZmzwXYaAAY6+VrBBA0vPQExYEDIIRMmJnpvlSeOg7J7SXNljDXqE9gmx4WqJBMpPFuOuHEEYOe3VtCRjGhoXP7HSF5vpOTsIq3pMeCnTU959cCT46i2BWxeJIUSclxknZuH9kJnx190cdXCoOEl56Fl/Lv8omKxG+aFFKANvpCTkN8krEqbZyo0xaMZZ2J0ErXpr+htPkjAScKskxqgaZgk3LSUBUPtZBfaI38S1SmAgwlvGjARocn+x2NtFRcuQFeLAEvzrurHuKsOy+Mo7ACKJjnpd1LuZsQTczhmg2NFBbEfRRZy74DftChApxctv4iZXd/5F2IhESng4FB1kH5UappEkAbgiffQQGqk218KnVvLQ8dNxnrQnQpt8K3+HTuBryC1BB0rngJAu2KxToe5k8A7TiUSZKOgSwj2llgBlCUxrFmqv02Kap5UpCHQB4YQNB3Uui18IYR/GwJyILIea85l9IzTM7AnDyI5oAEEY4v34jdlBTmFgwhD5hRGO0HRhgTWrQlHnKlnvKmiaqqB5FCAoFKqzeENOMYgbYcOdoGPxRMq+u+iW4b7gM4ekuCNRgDGQ24qKm48OTtVlT5FUrajtpvKIVPRWazQKY+KQsaHHf8nfJVy2KdCCYgSPNpfb/8zmIQmQUQ05NKxiCtB1DEO9wvKwORyBumpQGpvE4qIyAM/7D/SJaAXA5JKkLbfoRFP0DeUxAAyjoBJLMDvNgQik/mTysF16gJe0POckwJ5HgN7qP8wfdkWipPDa5JMs/LlWcmkPWWtxRLkY3zegCXRwbtywSPUvDKycMXlHShqUcpMiGkkmyA0rkMtWwJ4Wemiy1tLOFFAvp11p6NRSV4IEyWEH+kLXghgoC/vP7EbtKyHVTwlr9jBPYAyLKQgk/SlKHioEPRp89owMtv5ZWWcj1EL3+cWTiGfPl3T24NQfhZAKUhkA0HFL9NmYX7JLAIoGVMgEQsQs6RCUbKrspxkUjXNkMwgWKFMzI+FnCVH9BAys+6uRfg0ERjPQ6gdUjGBCPQamtxgsrMQyUopNMBEycVMzBqAtSMEpWgeqdok3RIVKi+jYRp4Y8eeC8uP7X2lmvO5Q8JQMAfTkK7ClWqugtFngrjo3LukWqziDxJ1RneZaFPvQChYGJz4Lrj+2kjURC9C1D7IUuGdXkTqKYTiufx07F8gHTYSn4QB5hPJ5NWqRMUBhDpNKHEq/JrBwOpZ+n3hlsAmz0OoKNsbfEpL0zBJPhfV4IOVwlqrmAqlQkNVG+9z+mauFT8Im8spJTb5FSsFkjPx9HEk7R/2Hp3EZx6T73+LCz7uC1QMMlHXi8gCSDv9y3jlfnJXYhiLIF2VIgPS2WdNRoV4cD4C1PaQfunWYtPOrmXVv6Rw4mF1pcDlnL+TD5lVkSZZOuFqAonP0FViXxm08i/sRZokGlOvG/zrYCAmny0abTRADAM2tDlbiMleInICmGqMhJMRA0Gk2FlGJJcRPp3ZAisBDvHa6753cz0JOWNQPSbpRf80yL84eh7uMZp16dfdzaniVYlCaEWcisynhoj4mMi/4tSFkgqHYGULY8ENtn5V5oB1x/bh9PHVmHhj16sClT3bEqwJSgaHVS9KIPMfGKFvkRgWi+5rqr6J3swMPLnpqnknKbilYlrxXv8TbDxdGTWAygyRmC3n2hpDlsxqUqM4INighBGMpqNW74mhD43QSyDmfcjM6JhSkxbfJEGA2DV6YV/yx0LWG6N8PynPpi07Zi0IVsAfMRECeyHlMxIa0mBEsr8ioKn0vsQ1hGEMsKPaAWhB8AdT792F7aWAywWcSkwnqLcoZiu7M+AucwoJ2VsLFNHCI2qmBBkG1B1F1v+EN8pl0tDkM5Fk566ppJ2jhtLXjZ8a7CNB4AsuOIGpUqyFUIk+YDqypoSUskEWXXAGo0BhSlzhaf3VbxMUreUM8l38m4/8rsSAODSuWu3oF928OJn3AdLHJOGSqZ3xd2Y88fWAH8M5W+0+SSogXHkYonvUJzRF8t+iNo/PHGOP3d8wS3nYbkcAwD0HgAkCAggUEONqba+qnw06oCa9YhVeLvyE4D9RtAAJMtJAAqJQzBZm58kb27NKwJdFmFLeAG1iUt8FwTjC7MSQMp4g9EhM4ttYtgmZ04nxGVZCrXlIJlFMq6IM2vjsMvvKKwB/8BXT58sgG2HA0u4+fQF+OKnPQDAS3ZH9FBmPaRBQspsT2a2cVsWsEwhbSFR3oo4rQ/I7f7UDBi9BeBA4XOc9r/pGr+pKGUAWDAIdGl5cCwrEqlvF2VBBwm8CUOt8i6fVGMc1XHkG4K/yopNYhciRajrV2UODb9uLh2dgUBQBB4TYtsx40oGZOlPVroJxu+R7kVXJr7VAswgVkus+QhUecYCAOEYkiUAoKyAAAJbsLWN8MovujcMCiIaUr6ToAsLJA/KqRjRZtBeU/0zm8exrT+Oq7jYh1+nMGR0BX/kaefh+M4Ktrc8AHRhmXK/XmEfthx3B8a1Czs2rgnrbNAU4Ouso7oWDjz7SY3PgfgZqhlUpTfah9iu/xxx4hLOx3gEJD/RkWgC2ArKFQn6vn3OpjkLMYByatfaIzGmdPo0HUFKU5RbKo3R5JsBI8epHxJbAHEmTQGBUEW+GeAAYLHjTgt4+pMehS971n2JGYspLg8EK2Ck807ClyL9B+k6NhXYxJfCP8R2P8SzB4Pn3rQLT71h1wn/6JoACMtF0v5e8HMzwINBAgEs+xfQQbJiyzCXcBmaK+uRJoAj+3ZQh9VBRX3mpglW8VXdgVVk9TubSkdqUVCmylEnwylhVjxdtIYUapsGgTYTG8yk0wGQE1qsltKH1FJYPx9GfYSmQOoR6GIzAJY7sL2D8KrnfwyedOoC5D553p8bkhdD2ckCIGQWQhmQvkHmkzMgQNxOzKflQcBvT+au/cCf//aZ5+Dk8RXs+OwtvfB37uiDwIej71L7v4O8d4EBRGoJ+kTdk8hTuAel2WabYGTPYx1fqRvSxZTjPyBv9r5o8m06HY0mgBRYwaAV4ySSbUm76mzTERTOSSBRp6nCqPxgzXDpXLVlG9/CD0iuDhysAGfW+8X/JAiwFeABIFgBW3DD6T34My/9fdjyQ28hCSUXyCh8AuGbpF8jCTkLn7wvuZzGPG9fdvWNTvDHpPk72IevevajcJPLy7Gd0VkAndP+PSyWXdD84QhNgAgIHa9CrFyh0+VEoLNU3QPSPIBQ1Vnddm/1Cghtn52BoEFEZk0Ju85z9SHzegCXR7L0iO9k4W6MxCPIWr6aAEMSNIwG5kgblVvJBwgBIqiYrnJSZSEXwic0DQ9uKs0AAQLBLwCxU933BvQ7DgSOwWJ7Ac95ysPwp178Yde+HmIsJAcbyXwVjmdgyMuBUekVIDL3qMQZvf+80Ode8Pp/2eeeh2fdegFOHB/gmPNNbDnBXy6jsC/6rlgAnRP+LloE2WwX9cTlYAXOOglV/QQfkG6ulQ1OTR2aOpLxp1UJ63pspSvzOuYcQnt5sHTM6wFcPqkSlIIHoDQCGaFFwEnTsrA998tjcbxNVLwEjtxn3ohbZZUkILDm43tiyy0GBb9mfrACVgUIMgj4DvZoBfimwM6xHl7qfAHf9CUfcSCwCm3yKLwASsrI9pCQAgUEOTgoPQ+9i2zypxV9/Jbk4y74HYpe9oxz8CXuuObkyjn/ALa3o/AvF11o/8cjCn/P7f60nBCJvBAYxU1rBD+3x03bP9epiHdKiGV4SrnJA6RMGJkPUzyg6p+gCR7+mPcGPDz5ybCDFTYAVRFy4khGMyrdhHb1G1DCWECgWiA0/SwmRnkYnvmpcbK5YMxPzdzMZADSnlTamsP6zSi90IclweSa/DyedpGsgNhbcOzYOXj5538CTmztw9t+4xlwYX/pvqXLE2SyRDHgKAAlITjpmsbSlCBK6/olze/M/x534as+/yw872lO+E/sB+Hfcqb/ljP9l0t3+LZ/av8vgum/iCCA2f8PPHOvYaCZC10PcfSjKEOK8AWyiurLWqhDABRgCbl+ZHFhy3gnCVBUgKkq60QbPhlo42cDTranG0jPjxEbGkVFWM4q7Fh+V237LPwiM62uJ/4pfEoo0qVGViKz8XbdEFYBRz/X3m+qlwEA0gKdfewR8G3/5RC29D5B5+HFz7wfbr32PPz4v34O3PPgtdE8xqIVY1kI5MwylASdoAg+pNF+7PUPW3ut4IZjj8Iff/bDcPvN5+HksSE4/bzZv72MQh+cf4sut/n7zgk/9uHosIeyoAaqagDQWCrPsh5QPjAFH+UZ1XtZiKvIQICIZgTJD5UySHGE32QiVCYplIqleTrwoSn0chO0p4OSZOh4KsxSanzaAmAtxIKN2kxukeQVlS/FIjodflFoXBRNxpLlxMgMZqtBxJ8uFrxtWB+bAp63Fq6/37W/jy9H+LzlOfjyZ38C3vae03HJLmkqAWqh9zQmYQ/PxbbgaTXfvKqvc/idXOzB//iH7oMbrt2FkycIdlxPxJY3953wL7yG98LfCc3vhJ+1v2//y25JCYgTpSe/WofBVigC7rbjMsvhjdKoE9BlpP0DzaQKAyhAxVie3Zr0NpA2GgC6Me1fm3gZzXUgCQigFby0yhTlQFRpoige2LjP6UozWixrPUUp05TDUWX66vApZS+P+3GQTeHqPoEARgDwXYOe45Ynnbf5LODubln5OGYwZ0I6RPPCnEn7F1M2Of2C1ufuvri7T4/7YUGSbWd5bDntHhx+i+jZX3jPf6c1/yIdUfNrVxPlstR1Zp9nbQuN+pblK2uPdDzqsa3QljURMoMZHKqeisyEDRS3YT11mz0X4EhsDCJLUHqR0VYCFYDWGm/CJCQAyq30NHhGsGWr5khNMkfFpOU+KKajbDUUgSyMBNqkyHl2efFbaaeRdjLPYaxtsALc9fKUe3xOpMvDdDGXF4EpHwCzTv+YPf0j7+gzxHa/3+BzdEe0ZKlYKPt92P87jPiDLlsBWfj7ZRB+f3C6knI1iPqoytsKc4XK2BBinQDpnyCVfmWKCEuN0hqA+UkTpaDwH2sqe//CZnsBN94HkMs082vhANUEEIyRvbtZ0BSoC5Lch+WOXRJGCTSqN5sWRpUOGK1PmfuJhUrc5vn6URu736sEAj6lZU5ZtyXEsgBSxZICFixlyE4+pfUpa/7g9FvtOxBKPQsksp3TxOBwRFoELR/b+97sZ+HvDla+RmamilLiZRMwsPFSXdxQCzGpOGT9q6Ak+Ed+lOUn+9KGdwMeqTUBK60vh2nKepR2HzOLQn3I2jLfzGa6jk8xLpU7NjqQSjycK3WV4tAmCMrEklBLvowCHZf5Cotw9iQkAoTmEQek9QJSxkLPQlrui/KaA3KQD2/XVUz+MW3tzQCBckulkgzwGIfONU868tp/CdEm6CB71uXn69KoZBJNuOq5Kt81EZsIJfjL4kOOtHxavlZWo33RfpTVBoxW86Kghye/NVg2ZhuCXggrQS0tedBmesWNqUal+7epqlqpimBCQyDfMBHpOww6hpnJXDDDqWnC4pp0HrLJlLS/5Efpu4i/h3Ae0wSkOMFnDB7/MWn+lHh+LxsfBEojE4PB6GcA9tBaJJWkMMJ6wZelgLI4RXedfK/6IYTVSqDu6cE2Kok0mQk5Hyg9jaoepEJK17MFcHgKPoCq+LhWQCEvNlSGNftlj08JnM4jKC6ssMBoD3ErhsPyHio1UTKEbPIDQHELTjFgem/k70Dx3aiBgoWSrRPi5bowp8xSShlAWJPz/eT4G+I5R0qk8i1uawDKAtACs7oMRa6aQcGEyY53LbqgLqbSQ6Pxs2USPwDBMMbYiFNWpQBCnR7V6c8WwOWRVHpgmI7rAgCy+a0qRVYaQhk0RFJIJxhWhJfLRUurgt+Rz4v2LZqCNUl2MXL6qvGPE4wsAY/0WQ15lc+ovJkSJEAl9HlBEW73sxNw5JF/KRxAsSQk47eAwNSPLMtcTnBxxKCTS2hE1cUnz7KeZLFJBSBZAQRMl3LCSQABAe75fgY8ALl5SHk3hZ4tgCtLsp1edqbSnMFar/b4Az+pKx2rhHSF20CiWq0jsAiMZNICOKyXpbMy/CXDcSo/rd8aGHITQDK40PolitTfH97jAT9pNqGYOVjmUxSfghoyLOPPYaFImykr+QmNL9Sfl0OZTwYdB+OafTeAtb2fgQiV7kcQeUT9G+Q1iUTVfQLr22kC4QbSkQAAqShbJrkUOGk+k/DYg6r8JDDSlGzwrjTezY3qN7V+A4mmAcfE7X7RbBHhZNzKqmkdKjESQp2cezyEmNVhej6ylUBlph/QCHYZLBBqnsvE+/VJ9TggVBaBLMiWEEihNeZ5OUuQAdFuRyWPwTeCWGl6m158IdkVlFVEJdPNOCowIw0KUOJX4fwxNwEuk4z2CGdh+kYrABsMl4QbW/GgMMU1Sed9UbICYMCaeY1Kt0FE+ll5kMpldrCV5boTe8r4LADwyjXBk1cizWATGHJMPEsqU2XMP6TNOiV4mOfAXYVCwlPZEbEJjmA1YwYwW8ZCfipZkk0r+dk52VKQUXBRVUNT2qgknHEt1ysrhMIvJHmpBWIoKpEamZSIMjcBDk9hMhAYQZWmr7iXwzBXhmsTTqgJnixjmcBaGJnRQT5gsZ0AdxKMZB8JHpFx5jYvadNWNHiMpMgzQeUfCO+zNytGNmYpGkFZAOE1EmCpCjc3JTqWVnFgTl48KzmuhQe0j01RtpZkygVwykvlbeUDApnrRnAyAUA7ZVVgaryT07TlgHXcEhw2mDZ7LkCc5h4oIzeAcjzlchZntewTiN+Vd5cFLwlzC+0BgCptIN6znCyFvwIf8Q0IagZiYMSsfcz2Yf7eKAoiH1bwi/aW24fp7sCxCH54b1QgEL+N3W9cyKAyI3EivNola0PmrQKwEgeq+HTZxWAo0kddaAACtJuvmx2IoC2IWL6l/C3lLlNu1bEWeP7g9FAqnrkJcIUoF3htcqPkFRDXVCojV2RLKJmmVFPWBphfy8mZd6QB0owDSlzsiyiCWrSP+pRsEoBAO/HBQviLzLIwd+HZKMMBhzcZTDfGBCiyCRD9AAR5MU8lBKh+UyqXyYlY+bpC1kJ2Gp/4XDQjNXOZo6h2aJCMJqVfQEMI/wEA0h4HIJhMgvX23AS4LAoGbBZAqNDXDkjRb4LQKo24qd5QEi+iuizfK4Ft8HKLwgYb1I656FhtnCogsow38jj9jABJS0btzh79MuVX/h6V9u9c4CH9lpZAbO+TSBvr8pJgTEpu+cPNC1i+KZkGpTlmtLwsCOFwY7lTTXJs1LkBhjw/I5yxJEEKeoo1w9/UMu+Tk7Wy1GYL4AqRFHr+beshcVslyNU9tFFmJpomYSbyO2KEmIroIojkNtIguAuKlZHDCoGrtM5IIDfwiGfKUWetlhmXAHIzIYk4xaG+fD2yQxKKtRB+p0u5BDonL0EYCWprqxRhCWhFlGSZgHKqS1CxhY6yjPjxunpAtrhSYGrbImgBXvKPqgcVecnvRfLC40lHYzIQNYRenOWCnmWFIFIDcbQWqtNZazoKjUyNd5r5Bs1U7UAlXilBrfat+mjm9twbQmlz0eKpJ2EXU34nlgvHoxcAASPNxfNfxgKkV9MZ+Rv4vs9Pj+K5VZ2y2w0bhYSqSaV6C3IZNK4bZaXK3VY+iafCUuHPAVGsrVetImkDQaIN3x34SDQBPJGtfFXglE9ysAff1ryGTe2g6rREJ2wFoXVIh5U/q/db8QnNXASgZJJUg7aYt6oplJxvIB2BuTuPnYDm+4KmTxN/WILTO8ViEIVLxSFIJPcRyI8rfwDXE5JwruaCSEKNUC/J3hDupuTIOpDlb1U4inqZEEF2JqroqZEVrgdOXjWDZEAoGZoChA2jzZ4MhJgXeJUWgKJwz2gT0OHkrUobW1OytSyYRHqZNMmn0qws97I5DlEYqkFLlAYGqdGM+joLPy9cmr87SWCaMZi1eng0ghq2nJx+kemTUI/cxo/h7W4m/DcwvhxHLZgcBRiAyKcE1Ph9oIwBWQQVNW+mR6RlDez1ZP1H1IkAxCMAUcchDTFspGmfTYIAHAnh97TZk4HSIm9NU9Ac1lwTSgcUN0qrVD0T9UhSqC+OSLFzVoNlnDoUYSrt8rILrXrPCG68pMKdzI0ZAEYBCPwMkvARgGqjp0E+KaLgJhTtf1I+ggQUKYK8gu6IuuxDVCgcsqVQZb2wwOXfVpvbYmiWc46sEl77Lk+BjtcU5hNIq8G4XSYFmDE5107liwFR9vxS+j07AS+fWINUTFcFMrckKIiuG6yeQRVhEM1sr5p0QKdF6i1xT2gGkslITZMypLUjgb2p/SAUhbAj4XUu8/UZWOyaicp7rfr++feYAYFBABQo1Bo/H+JzcxkDgJxyw36ZEk6Mp1gj9AAgIzSJTfyW3wYCmGzvwcS7OU1QOFyabVViNp4EEvNIwMNTaAJY5mK2ygUutIotaiVDRedFkxZ0xIa5uJsua70UILcbL0ZLwYSiIpMc6TPKDJHABCNw+Zz2DZCz/LLoyT5riGJYdtAomr6kT9Uh5+XxaEINBCmfqQURwcesSiwcsqY0VLkprdwSeC4jNHE1QBwaSXG3H7MEiYeo6h+ALO8xP+Wiobq4OI4R1udnQ2ijAQDF/ttomc3f5EpI14LPwo3cz88VkaQvOgJFbVmBEtcFNlIUcmARx0nVaxNWhb5dNKQci8Z5NDJgBV+65PPQ3ngLhYexePoxh1GTfkBMCArbfY/5Hh/ZIki76saeAQDjL4QMXRRXMKdWGauv5DItRSa/MbxNjfJEALKDtqwAWhLgKvNaBF2/TKbuZPok6wLWXHuamwCHp4EvqFG3F1EBWVtXZmOMrRJiEa6sXpOEyGjSlsWhZD4xqHQqZeYTCwjwaEBucpCZlKKmM0jA414A1f4vjr3oexBAokz9VDrKYiiSbHcbRijjBoCFJ4MxGq0Iub5UjYnytKSaY6DkvFF3oEDCxl8JoE1LZD+WQdmp0OajmSnQloJ2yprw/phHAh6e/LLgPOEt8SZUmjDNgmu26dFqH0ECF5oMlS0A1p7QJmpeNuLj8e1QhDhPTwUAJO18pAIyqslBwq7OWl9cQ7QIgk0hrJWYbGJ7O3JHanwQ04PD/SFZBTxdWOYfputmoiyUcEPB3fwargH6SyGOuHUfSmKKVew7UwDT4sMmD2207Ac6MtOBI6G+T0VHqad5lJ1mMBQqRba3p3glp2q0ceWwammfELE1+EWC6YJnJbKZTkJEdBMAa+YLzsAkfWO5F7Q1djnO/MHEIFAG94DcWpxICD5P+o/3QimbNq9qlmXQwosSWjt1PhdbA1AVsIOoCzLaWEPJRD50/ki8z4CbS01WgHwnlwPWwm/zM+8NeHgaOzFAm6J46PGhoNrHSpCFKZ1JVKKc991cUgpKvds2XwUYLUYLINRQIVYrkLHxRSayQpecKQ9uU/AIPjlfPy8mSCL/XFCUskLAyBG3AhvM2YPBEH8HoIAMAmXAYMp/Whykah9PISzVQeRtO6NPAi9r61z3MgIB8iph056SYE7mdSX8Jq/qZcsUZDJctSk2jzbbAvBL4SvkBW1qpt8oCl/xGoLS9KIhWqxYE3+NF6iAwCgDleY0MFgTAcWZ31rTXGFBswFU2OjT6JFX94HAqJhXAuJX4tp/ANoHUJn/VJYEj92DaQtymCASmrGVv4kXmyOCOT7QJWXe1EKYI2kIvwqfnorXcgJUgiHVvFR9CzUOGaY5I2mz6GitCUioND7fkwoUBENZTZQXvaAmO4ngqbvPzCXIilcCCxZF3JwAU6UiPgcYXtZmRgmFmj8QEveT8ftw7p3r/dTOKjUBkuADZm88CXO+WAGDEfqo/SNAsOaPW4KFKFmOUAAICOS0/pi15SHKokJPsXZivgNG+3LTQ1S8uF9Faakh1LKu11mPqRCmhR9SGe/ARtPR8AHYAuZHBDUgBKpteZIV1krGqO4CIJqNWNjlteD9HD+a+Eo0Ii6r8iwTy+fKaZfiCYK/8PvPxX0Cux6ecvq864LzXXdJOGDUmi8VFoEcODRkL38U6rREOMQmgHcC3nh832FM8i1I7Okoi1uGJpLdmGg/uyrLjMkkAZbMkGwNxhmkGQRkpPWlppK5Ok8CTzg/IPMgp3FPneWLsw/gClCudILSzhRDT7NqhsLUWC/vpcw5Ldc5jVLhQtNCXccIbT7KloJNE0AIt75HNhXiZgel52kOQd4chJkeCwD0W07+F3DDyfPw1NMX4MMP7oCcU8hDfeP7se8qDAEek4c/jAHwZr6wAihtEOrOt1+7B8tFwBi/YUuwMHxff1h3CMu3ZkHJMkAgx0eqgc8sZFGuShlXApV+oDTNsfLZlEgvgmzloQb3FjgQkp6zIZs8LSvAh+02exxAB0eEbF+zHebargB5X4gYtcNUXVmtM4n8gH5HThphC6I8xzpu8Z7OC9We5tTdGUf9sdR0SSI9AGw7LNiGY1sdvPTpDwKIdn0e0jsWQfdbfkN6PoyrYv6LpsCYfp9aruD26/fCnqR+B+AuHE4A0+GZiEEB21JZhMWWM5dbVQZ1ecuyy+Aou0BJVIC8lkBIIlsjVVls1bHQK6CdB1jVW/V7w6cDbzwAKKGX9wGUNOdnsvDlg8wopMOpl6VFbt43zAJkmImgAhfFPEB12JQiccpSs+ff6W2f2MDCDwUc/NKpmJoAix3Y2lrAf/fMzziTfS8K88jr/nvt7n9HwYdk6gMl5x7FZ+O4n64LGLz4tgtwYmeA5RLDbsBdHwEgWAAYhd8vF95hmto0Kcyll4DdEbmqqG7Oyaor5R7TQAUe7N9AUS6sqREk+Oo0Gnm1eSCRvyqc4QlJ/Hu2AC6PVLly1x6Ze0T1JBVAOegtPUuMMTYSMIwQK56mmcW+A/X7Kj85Th45J5iS02rFKdKNIDDEg4HAV2G3CBYALI5BvzzmmgEE3/CCTwBCGc4L4rpo+TFp+SEKv7AAQnOAVnDbqX14wW27cMxFv1x2sOj9gdkK6DEKfrQAumLiU+sgU+ggxi9Aqi8puFNlSgYszfDiZl1CU8AnBbdRt9SKXyzHru7x79kCuAIkEVdWCNcGzw8wCG81Sn5P3rfPxH2UffQEsE7gWwc1r0nfS7dwzQYbuTnBFoBvtw+jBgFvBfTO5bw8Dsd2tuHFtz8Kr/nC+yE3BdKWX+M4KjOfHX4MBGOwAmJPwuntAV713PNwzfHRxdk5AFi4ZkAfhN+DgO916LhJgF3aDhxroUpUrANM5WvKXdaxMqdLnJRi4iD8nKbKG6RvAqr6vph6PBA47BqNMuz+PBfg8kgVuK14AD2QBirE1iPFwh24uBoRziqC+h2a+I2N+9lJJkf6xQdxUgtmMOPRioFphQxEh74LvHKH65JzpqUDgS75AdgZ6NX0MehWe3DqmBPeP3R/GBfwMx+4PryWp/UCL/cVJ/oEgR+5uTAEkLjl5AD//RddgKdcN8DxYx1sL3vYcsK/6HtYusP7AhZdF87xcPdCtwAKZ5osFDGGAHWRkSgrAmj4aAn0pAjtv8tRovkNMAlGqnqwyipYB3GJF+uMK6CQH+eul/NcgCtLjPDyNxQhLfVI4q8gFOFRx9FKKggl4KR8T7zUvEcVy6bfaaEKtcMRaGHgbyan+ZFBgAGAdZxvCnTOCljsw3JrH04fJ/iaL/oMPPXac/DPf/NG+NADS2CH4CgtgwQCw7AKgPHip+3By565D9c6EDi2jVn4vZD7JkAftL8Qftcd2bkjNgHit2ESWhJSL7+lScrLL+oS63eMXtDxpghQ/6yFGqUvqRVxTcRrRCihlwFIX88WwGUS6SMPB5WFb85yzL/UKsxV+XdVyVirFkCtJbDUMar3ysMKdEQwEKObrVCodCZe99q5cwCA3gLIwt+n9QG9Q3Ar+ALACfS2ayJc4yL74qedh8+94aPw/o8eh9+45zj83v1b8MA5F2SIpv8CVnCra+s/68Zd+MNP3oMbTo2wszXClmvzL53AL5Pw907zLzCdk9ZfONBh7a9X/LGz6yh/A4ABcAHKYJ6zNVFBMOrnVVmRTqxZJxPlrCOaeEcijzzQ3JstgCtIWfDM5hS58HU4RUawlHaRd7liTXS1fwELGnF7Nf3OtxHF3HwAyOt0YwUmTW0EDeVEbAUMMR7+gL5LvxcRBPpj7nKE7ZD8BSe0K3jJM8/B8596Fs5dQDjjjkcvdAFQdly4rhsDr/bucPIeTH3W8F67d8LMDz4AJfxR++eViEzZStHPOCpQ2FpvUIqkqla7apJ6LuqyBmloplNNKrLUUhLymT2KuRePeSDQ4akjPR04XObrRkVIsvYfmQYitbStvkEmKk1U+wZIx8OLjkQnX4P7BJMSTSZUkdfcKIMHAEpWQLjrQcD5A/oxpLsVvn3XCauzChauTe9QwTv2Bif8qzGulReWEE1j15G9+pAce1icfB4MrPCHtj/Zj8K8wCoANM1xSvWIudTWl70CSLm0Vws9AOrx/JCzVoR+LHywtgr0sETNc/Ysr+ehwJdHysxOpVoNkgFowLqOg8fDo4yXpFYx+gZBOeEkj6HJUc00lP/KIbJZypXNivy/ycRTNLhmQI8GBPquSFdwCm6FdQNxgbD0PfW45wR45bS7M++d1l8NFDoShtSbMIqlvKMuj2a9BYDexR0BYBl+8zfpuRMF/NSnsfCB0c7poSrTkC0y4CFRF3XkU9aTLXIw9W/ezTwhXxRWRzNNyyT+PMLG02ZPBx7FTB/bLRRv1kgsGAzEq57QvMaCl5cCpwZTSglnXjBoIK16qdWzCUwyfolMhpn0Zxx4b9wfw7qgyImM3CPAOVhEFHNH6LP3AOHa+x4E/HwBDwTDGAHAj0/I6y/mMvZHl2DANwPcAb5psAgg0CXnXxTT+GL8VtGrAbKgS9mQ2TtQhivyXYbelu+Xllcbfk2kdXNAyHSoF2EFaGL4Ed8heUwNyoK2BTA3AS6P9OKfBBYQMkD7SuxASWFcZqvEJa1wI9NQdtAl/SBVOpk85d8ifcuLivHIWjOgtEbGE5wuB8XuqTiCJcDM6AV80YnRHT60F9BluPQgQL6pkDZeH8OswbgXIK8sNopuScxWADcDFgEAOg8A7l/ceDSmw2VnxwHkmiCsvpXflV2jWdDUGYwVAKYSk+MV05yJNcCqyhQ0OynLToBM5ovcVkCdTwkA1grYcNr8rcHyBRuJ6VoODiHBFOY96eDhrim0FZXJwkPjEeh6VtGQfpOfUStmLIxGJtKWFWIXyJBM5tvynYuo40FC3BTIZmyfksRgxnukpM4PJPKOxDHM6HN3gDEkjFbkYb0JALzgY9L44VrmhmRaUJcbBzITdVgDg4hNbmVeEUIBmISIBOJ9Ali7IpGsLGGx5dsKoCQwpfDJyZmtBTMwrbIAZgC4QsS1k7vYEiYTqCHAqKTM9Dtnc7CxrLd5VqaZtvKhL2k6SHXfLlBaZYGm46A1zOTf9ZaAXxAUXbdz50z73BTIgtkl7R+FusfByWMfmgJhLwAPAsQWAAA3AbIFANzPH48qo+s+HEDaZAoI86QeFLv1yA/TgUW82lYoKbTTB5zOb56NKFEgIUPOAnHOY3Op8B6Jbdra8W8ybXYvQFf2BZASJ5Fb1FUllVIxQTJtlVhbFQ3GhJQk455UUaAZLiUQlidvMXHjNYjZXCvwJSBbEbFQ/J5/wSHvnHvYJ02lmgPRZPeM690rHaT1/yCt/ItFI8eIO2UFRODEas48ANQCNkHEW4BTea2AO6oysHWOE2UQLaSpBUAIpBVl/a9c/6V+ePMSUukygPOKy/E9LC/a8uAw80Cgw5N3AgatYAuVoF6Ys8F8dqRfZhBbWckiSOJah+doCNYO1FFpm76p1vKAFYl0oSVgnImcZ9ILaUAU/iDIaZxQmJKOLHgQzf/MvF3WapxwAdKkj9Wkm5IFBCNMDR/I5DfmNpuwwwVx3LguPlm3xDGgTihkGxX/xOJKodVKzaK4GQS4GzdbF4wi5lMFX1b3Npw2uwmQNgbIPCKOeE8vQln4ChvoDZmrrLc/iD2WTUQ4vBV2LMEnqLzADInqxYPeN89J3JCDiMJvIzTyYyky65i8274YkccI5L0HeElyUpZUjAtTqlgxegvHyOb7Yohar/AuxSl9UU8HYksDSLj87dhM0TiEvItxKF5SUXFvRrEuMDNHHtth+LKyAjacNhoA+j5OgQ/UQteG8HN7jsPlqs8mvg4vozR8ojTdxVkCUkBBSYiJGhpvrsUJ1kNyR6OyAUjjBb41irPaZqeAKKi7WICgyomezlRsJt48RSYMNUJMIIYE32JaoA5qaC0giF4ABcQAJu/yqt6xqGnppAARNLHmSz4fgTEAno6EBQBGu2USBc4asLnJ5JQmlxdZ+5kkCXRXIo8ZsH3HHGYsglDFBVC1Q7GRxXKP1Kda+0JdqURAEBUAIitQWP1qC1zJdPwG1tCS48GUMYrnDIo2g/FalgeJD6ocsRViA1RjeQmghaZk4qmKilo+BFK+Ds5+3upcplfxZSrseS7A4cmZgqQKOT+oj1YfP5hXMttxRTZCtmpraiBJE4wEmBj2rxKKLZVKKo2wH3w/P6U6f5QyoCwZCUIIkyMeQeWf7QPMGhpNCFlOJNBGtqJ1BuVX2WvIb7X69QtOlMJGFHE0PkKWgc0JiuclvEy3AGkl9Io/uTBTHi7swibTZjcBusW5lXRChS4XzCYWCeFX0maIpLAjiJ2DzEuW+zNQ1PWNU0k2TBASkckBQxa0SEROE9JIjSsw+Wo9yNE1UIXTmgIXW0xqafKcLuY7/B0s+DrOlhUgM2m+IuRvomfGfEjJpkIi/R3YKANp0UFdThoA49+gmnh9xmD1+WNMaJrGWPjXTpx+FDaYNrsJQHQudl1hQVWIZ+6LTatdqXZ6k2HKFL10ls8AZLsz3xrFK1JICIqvYYqfSyz1g8aleq15k79NMDhMCKz5bQHMzrlvAkMrDpp+xvFK0MyiI5yyNUxpMFEoKL9pPAAEDFjzjNHKVyM1NWhesMUuy4jTQDBVHgp2TEolMSOMvIak/3EONpg22wLA/pMrP2w19bfyFnYja3+xpV2lKakw3iQVxEjnRqUDqL0GSwIlXbVRxDQaHI44T1h+VLGKvDUBweS9YQRMvgsX8cwG1NYRGm2qN3Jpjilo2zHZpxDiQCGA5vuTrRWdi8n5iWTjxDoZlU9Q1oL195RBQH4yBZsQcVn1DADYnYWv2ezZABsNAKd2br13r/vkWddffSJMdMExgQDGI4MChUEwXY812leyyBILSuCZIbAy/RIlEGhFo7VKZD77/hrddRFE6zW0eVYB2ESZtKPE+oksRxvOlrGyAOo3bCo0hT6tNNO9PJqTXzMTixiL88jODA4TIzwbZJOXTbdOFiCb/34RVQaAZBFQhx/q8I6N7g/Y6EVBX37HHasOFv81DmN1xxgPCOfYzBrTmUYSA1ySxcCWQdLW5Xm5h6I5UabDgdLwSsuw1gdoCCWKv+W1FstJvrfXabOtfJYvYMXCOgWrYfleDouN96j+zQNz5TMeCVjM9BJTvsgfjSBTt2XSzj3UYCUP8Zxy/TXCcr7FcuFc95z18FPuktY4qJF2yK9capznX/BCrXx4HoXF+2HDaeNXBe66rX8TDBXq0oHZAvDDWWPZOwvAj4AbCkO1BK9aspqJSogJtSiEqQStm6SkUsI1UbUAJOs0koIIIJ1ucuQaq1AUv8u6BymDecw8CvBCFbf0spdWEWVhkkMbIFs3mD+EOL0MGkL42ZbOIFK+FEGWWCmY9WUMohShCaSQ897Q+OkREphym0jChENAw0ckhH5I1xAAYBi33gsbTpu/MUi/82t+yWs/kcVbAWMWfAwCz+DLQNDyck9SEphqpt0hSKer80EijFFk+SYzcJltxjCRiBvLyWIBIXSUnlfTacikm4RRuDzycxk25qHY8qS62lCY1UUTqu8vr6b7Ej01KChrQNRD7pbL75X75UwggbaFxy3BlsBDMt0JXlE+DETR9GMn1JCEn5JF4Mtni2hx8t2w4bTxADAurn0n9MfPeyuA0oy2oP1HrIQ/AgBVDB4Jm90/eRTaJZDU3soRKO5b/yPJCyFwrH1RaHDKqRgGFQKDQuFmLQY6H1I4Qh6txZHyjbWppD4iCn2JlxpBcxqo0ynCDhUwlRjsod/hFoUWfi4fqvKhP7NG3Qqr1igNDVBxYnQudHYCyu5A30099s4IOP7Brf/pzb8DG04bDwCvufPOh7Df/kUibwUskhWQLAF/OA/ssPKb5VA+cvswxFA0TcXorZ2GpgihNllFNDpNyO1TNWJsDZFMyCAHCU2mtLbIe8aCRlibhl0kBRpgwYCR4wSdjgyK5obKvikTmQ8QcbbvTAND/A4sM/eAVERk40oGlYylqks0YKCAAIvzj59lAOADkn9q6XBg56fxwFp//OlI7AyEW8ffBrgTAWBMTYHBtbG88I8Ym13+OgHAOJpyJwA6SAAPqiohaARGi5AOJhmdBWhKybb8AJbdp+5ZbQyNMK37UlZq4avwpy30Jh+ttIzirdK04ez7dd5xOoQZY40qt6VCiM+2ztKFAkEU91HsfQhW8Mek+d0xLFxL4MTq3Hj8x+EI0JEAgPfd+JRfosWp/+TaVQ4AFk74+9AbECyBIPhsBUA4j6vkFKwVg6Ei1VPOphbz52sj6PIdPlPjPWiEtdc2PWrEqYQQGhrNvDNdDjosTsSFB8TfiqcVnibSlc/l+weWYc4A8v/p2Bsa3taxfZ63PMvCz+Y/Ja2fhH/0Fuo27OOpn7/uO998DxwBOhIAcMcdd4yL7ZN/h/C4K/PYFIjCH62AAgIYQGDF+2fK6cTqgklPJ57SYtS4P/UbGs9b2rwVThJdclhsApUVZGrGUJ5NNRumwq/Ll87ftGDbOCygtcKsfWAKzs5fVOXUsAZUlGlRlPDXP8zCPxoA6N2xhBWdWg3b1/wtOCJ0NDYHdfSem2+8GxfX/huCnWgFjBoEBgkCq2QJBBCgsktwtumKwKDgiJbpa8lqX4CGaW7C27imNLUkFH/l+1NCQyZnVY+AircRD6H5JgTeirsK2oA1zi+Z1LCZF9VpCOuaBC0QbAID6jjkyyjesvWR0xRKgMKN6PCLgo9iFSCh+SmGC4PUnPAP43Gn/a/9yVN/7u/8FhwROjIA4K2A/sSp74b+9N5IOxEAXFPAA8C48geGY+Bj3x/OGgj3XT0NZTCIWN2tzU2kTooxrQarNSZOhrc2Bh2g32sPN5q49JOqKxKoKaycS5L3UT6X0mRb/KX05HIbGrJsKel4qBJB+c0SvorMSZLPodnMk3mRSXC+da5y2hwXRZ0fxp2MrPlBaPx0+CHAQxT+cdyBXbjuU+Pyur8KR4h6OEL0k//+PZ/41hd9+Yir1Zf3Y9wdxyNYcM6IvnFvtkVtr5m/9F0LHYTY0BqY+SV6mVNclRovYKL0J4pRc+oaQA68iZNn7CCanAnQg3nK+7qPsfzGHCbFSwYwlESk9JWwQ61+ScYJeZxAzoMoq3iy5Vm+qYg9/0WTWPrukI60HLD5PNc38tgIKPM/ENaYCgKAlEUYOSqY/Unrh1TCJD+hLPJIQA8S3um3A/twmoblTd9y6i9+73+AI0RHbnfg+x9+4d+9+cR7XzZegK/oxnMOiPfDirjYx/Xtw/JXybDJfesOxcNCuQEt3P0Oc7+yv25p4qzfUJqHWDFW5G2U64A0rIIJwnUPW4EQGqt6rH8b0QzGQVjb5cEfDeIdQwclr9b9yCBTTHD+eVC50ES4tL6rehaxCMX4KaxelABkwaiAolQa/CJBvZ6xszrR90htwR6egv3lTXee/kt/8x1wxAjhCNK7/sKbrt164Pz/i7v3f2EP52HR7YddbhZhY0sK21eHDS4XGNa590uLdX06e40VQIDyqC7ml0JSAMo1s4AMRTBdiOuePR6k8WY9+lwUNl12Hj5LkYbntjYIykCnBO4pjqQ+UmjKYUpSng9cE9QJ/z6ehNXy5l+6Zn/1NXjHHSs4YnQkAcDT+777zqftP3Tfv3Ig8MwFnIMeIwj0nQOCRRT2RRB6DNd9h8EC8EDgKzNcd/HzO20Nlm6lbALXJiOHIxLcIYkmlC22gSP/lklNRD1JySS/eBGrVPUBca+P5bGgSwFRvQ5E0drrQRtz/fPzbBOoVY08dUn4/Ui/LXechL3lzb+2d/ypr7zlL7/uLBxBOrIA4On9f/atT9m78MlfwfOffm5HDgS8JdANTuDHJPyULIBoCfjpwlHwoyXQ8QY63XQxSFuAf5N5JkMX5rry+r8lrq3rJrAYsliRfwNUTRxsvWvf4WfpIWMmiZemwEznv7xYWhDsZSl79RX/DMGkhF9EFWD+Bipanr8BQHwkxqHozuwfXV//Cq+B1dZN7xyP3/h1N/2VbzsDR5SONAB4es+3/cj1O7T3T+jcfV/VjWecJbAXtsH2lkCvQCBq/AwAXUT+OMLLRGpVmhCM0lxoLC/eQgv+baUS9L2DdPFUltpP7b0p6NCZ0VtzTOWggRIXSfbtqeKZuneQqUHm14HuDhZ4JFGv2jooZyf4zuwfXDf00J2GYefmf3Tjk3e+E1//+n04wnTkAcATff3d/QdOf/x76fyDfx32H9zyfoEeV8ES6DwQ+G2v+rjvXR+3xotNggQAzQkxTWoZkCIfcGUL9GLxxOZCK0BrEkMz7MEi2BBZJDPngqY/hCazGxW+BFMhuCzEuTOhpd3TAzsBy6bRzFpHOUsS3GMS/m8XBp4N4Mf3H3c9fjc+PO7c8F03f9+3/xRcBXRVAADTb/3P/8fz4dwDd9HuZ16Ewxkn4HsBCDIIdNEaKM0A0I5AT7WMq9uTpmx+59KL1Ar2JViwh6ZiXkNtKNjri4ys+UoLxRrx0kRQXRDCWqEi8Pk9ARQqmYkC5fjzprHpNwt+8PR7wXdaf1ycJtq+/udp5+RfvPWOP/VhuEroqgIAT/SmN3W/c99tX48XztwBFx56NgyPumrccwLvLIKwE64DA1/pvmmQNH/2Al8iaWEV3UQXITwt87QwILQXHFUfCtPI8VmkQyV5EaY8Nq7ZYrlkaqWHRfPrriAv+K57D52XH7edJ/ka19N33b/BnWv/1i1/55v+FVxldNUBAJNvFvzBjbtfSbuP/Llx9ehXwN6jW0gXXPU6iwCH0O7zFkGo8jXjIQPvSBMUbAOgvjsZz0TIixeihu3MGbSqjXS3ZcaHdEETGQwnEa2yFDjdFFF2kiNHIRZCsVkjGa6hnS+FEkJWml7Gd7HxBtufB4h4wV86+d8BWF5zBrdP/DxtXfPWp/zdb3gPXKV01QKApI/+xV+6fv/8/a/E1bk/huP+C2l14fNg3O2RHBCkNcWtORlogona/IXrXwJrMei31r85FbLEMqlUrXnOQkh1s5xaGeWw+dq6Cknb6mQSnMqYtXSgAK2KBi2+kUq6yq/5KA1AJEApmn4YHEJbQP3WXrfY+S+43P513Dr+rg6v++VbfvgVR7Jr71LoCQEAlj7zXb94zfl+9xnduH+L44mTI42nnC8gjIr0usBPIurCIGnv+R3CGm9dHjTt5x8M+XmhIf4e0hTEPj1zv8P28X37mb/udQx5RzS+0YtnUKeo7w0lev6dc97X7w4iDRs3yPyYeGUcNjw08hQfDFMhoJRr34hNlG0vS0PnMpSziTnMA/MLRvRxLZ/R3xk6L/t71HVnqOvPbPXb9zy0j/c86+9/9WZv4zPTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTTDPNNNNMM80000wzzTTTTDM9Iej/B4j/alMeZe+aAAAAAElFTkSuQmCC"/>
    </defs>
    </svg>`),n?(this.utilities.UpdateLocalizedText(i,"#txtAttCouponPromptPos",Be.AttCouponPrompt),this.utilities.UpdateLocalizedText(i,"#btnContinueShoppingPos",Be.AttCouponButton),u=this.selectElement(i,"#txtAttCouponTitlePos"),d=this.selectElement(i,"#btnContinueShoppingPos")):(this.utilities.UpdateLocalizedText(i,"#txtAttCouponPromptNeg",Be.AttCouponPrompt),this.utilities.UpdateLocalizedText(i,"#btnContinueShoppingNeg",Be.AttCouponButton),u=this.selectElement(i,"#txtAttCouponTitleNeg"),d=this.selectElement(i,"#btnContinueShoppingNeg"));const h=o.couponPriceThreshold,p=qe.GetSavingsAmount(o.couponHeader),g=`<span class="txtSavingsColor" style="font-size: 20px; line-height: 28px;">${qe.GetSavingsString(p,c)}</span>`,C=`<span class="txtSavingsColor" style="font-size: 20px; line-height: 28px;">${this.formatPrice(s,h)}</span>`;let S=this.platformInstance.GetResourceString(Be.AttCouponTitle);S=S.replace("$1",`${g}`),S=S.replace("$2",`${C}`),S=S.replace(c,s),u&&(u.innerHTML=S);const m=(0,r.S8)();d&&d.addEventListener("click",(async()=>{await this.utilities.SendClickTelemetry("",e.$S.AttainableContinueShopping,po.bS.ATTAINABLE_COUPON_CONTINUE);const t=`https://www.${m}`;window.open(t)}));const A=n?"#divOverlayAttCouponPos":"#divOverlayAttCouponNeg";this.ShowDiv(this.selectElement(i,A)),await this.platformInstance.SendMessage(new fe(e.R.EdgeFlyoutStatus,e.in.Information,go.r.ATTAINABLE_COUPONS_OVERLAY,new ht.Z(e.xu.ModuleViewed,void 0,void 0,m,o.couponCode))),t.a.postMessageToHost("recordAsContentViewed",["ATTAINABLE_COUPONS_OVERLAY"])}GetAttainableCoupon(e,t){let i;if(e&&t){let o=75;for(const a of e){const e=qe.GetSavingsAmount(a.shortHeader),r=a.minimumPurchase??a.calculatedCutoffPrice??0,n=qe.ShouldPromoteAttainableCoupon(e,t,r);a.successRate&&a.successRate>o&&n&&(i={couponCode:a.couponCode,couponHeader:a.shortHeader,couponPriceThreshold:r,couponSavings:n.couponSavings},o=a.successRate)}}return i}async sendCompletionMessages(e){const i=this.selectElement(e,this.useBingRebatesPath);i&&"none"!==i.style.display&&t.a.postMessageToHost(u.AutoApplyOptionsStatus,[d.UseCoupon]),await this.platformInstance.SendMessage(new it(this.getContextID(this.divIDContextID),location.hostname,location.pathname))}setCouponTextToCancelling(e){this.changeCouponText(e,"CANCELLING")}setCouponTextToPausing(e){this.changeCouponText(e,this.platformInstance.GetResourceString(Be.AutoApplyPausing))}changeCouponText(e,t){const i=this.selectElement(e,"#txtProgressCouponTitle"),o=document.createElement("P");return o.style.fontWeight="600",o.style.display="inline",o.id="couponString",window.trustedTypes&&(i.innerHTML=window.trustedTypes.emptyHTML),i.appendChild(o),i.querySelector("#couponString").innerText=t,i}formatPrice(e,t,i=!1){const o="¥"===e?t.toFixed(0):t.toFixed(2);return i?o:`${e}${o}`}}(Ue.GetPlatformInstance(),Ue.GetLocalDataService(),new Le)),(0,a.Z)(Ja,"sei",new class extends ve{HandleMessage(e){try{if(e.Command===Ce.ExtractInputBox){const e=this.getInputPath();return new Oe(e)}if(e.Command===Ce.ExtractApplyButton){if(e.InputPath&&document.querySelector(e.InputPath)){const t=document.querySelector(e.InputPath),i=this.getButtonPath(t);return new Oe(i)}return new Oe}if(e.Command===Ce.ExtractOrderTotal){const e=this.getPriceFieldPath();return new Oe(e)}return new Oe}catch(e){return(0,r.Md)(e.message)}}getInputPath(){const e=document.querySelectorAll("input"),t=this.getInputFieldWeights(e);return this.getBestInputField(e,t)}getButtonPath(e){const t=this.getPreviousElements(e,6),i=this.getButtonWeights(t,e);return this.getBestButton(t,i)}getPriceFieldPath(){const e=document.querySelectorAll("*"),t=this.getPriceFieldWeights(e);return this.getBestPriceField(e,t)}getInputFieldWeights(e){const t=[];let i=0;return e.forEach((e=>{if(t[i]=0,this.hasInputMinimumRequirements(e)){e.type&&(t[i]+=De.typeAttribute(e.type.toLowerCase()));const o=e.outerHTML.toLowerCase();if(t[i]+=De.containsCouponKeywords(o),e.id){const o=De.containsCouponKeywords(e.id.toLowerCase());t[i]+=De.idHasCouponKeywords(o)}}i++})),t}hasInputMinimumRequirements(e){const t=e.outerHTML.toLowerCase();if(this.isFieldVisible(e)&&t&&!t.includes("postalcode")&&!t.includes("postcode")&&!t.includes("postal")&&!t.includes("zip")&&!t.includes("security")){if(!e.hasAttribute("type")||!e.type)return!0;{const t=e.type.toLowerCase();if("radio"!==t&&"button"!==t&&"hidden"!==t&&"submit"!==t)return!0}}return!1}getBestInputField(e,t){const i=this.getMaxWeightIndex(t);if(i>=0&&t[i]>=4){const t=e[i];return this.getDomPath(t)}return""}getPreviousElements(e,t){let i=e.parentNode;if(i)for(let e=0;e<t;e++)i=i.parentNode;return i.querySelectorAll("*")}getButtonWeights(e,t){const i=[],o=this.getInputFieldNearbyIndex(e,t);let a=0;return e.forEach((e=>{if(i[a]=0,this.hasButtonMinimumRequirements(e,t)&&(i[a]+=De.containsButtonTag(e.tagName.toLowerCase()),i[a]>0)){const t=De.containsCouponKeywords(e.outerHTML.toLowerCase());i[a]+=De.hasCouponKeywords(t),e.hasAttribute("type")&&e.type&&(i[a]+=De.hasButtonType(e.type.toLowerCase())),e.innerText?i[a]+=De.containsButtonKeywords(e.innerText.toLowerCase()):e.hasAttribute("value")&&e.value&&(i[a]+=De.containsButtonKeywords(e.value.toLowerCase())),i[a]+=De.proximityToInput(i[a],Math.abs(a-o),e.tagName.toLowerCase()),e.value&&"remove"===e.value.toLowerCase()&&(i[a]=0)}a++})),i}getInputFieldNearbyIndex(e,t){for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}hasButtonMinimumRequirements(e,t){return!(e===t||!this.isFieldVisible(e)||"button"!==e.tagName.toLowerCase()&&e.children.length>=1&&(e.children[0]===t||"a"===e.children[0].tagName.toLowerCase()||"button"===e.children[0].tagName.toLowerCase()))}getBestButton(e,t){const i=this.getMaxWeightIndex(t);if(i>=0&&t[i]>=10){const t=e[i];return this.getDomPath(t)}return""}getPriceFieldWeights(e){const t=[];let i=0;return e.forEach((e=>{t[i]=0,this.hasPriceMinimumRequirements(e)&&(this.hasNoContentChildren(e)&&(t[i]=De.hasNoChild()),t[i]+=De.containsCheckoutKeywords(e.outerHTML.toLowerCase()),t[i]+=this.getNearbyElementsWeight(e)),i++})),t}hasPriceMinimumRequirements(e){return e&&this.hasNoContentChildren(e)&&e.innerText&&this.isPrice(e.innerText)&&this.isFieldVisible(e)}hasNoContentChildren(e){const t=e.querySelectorAll("*");if(0===t.length)return!0;for(const e of t)if(e.nodeName&&"br"!==e.nodeName.toLowerCase())return!1;return!0}isPrice(e){const t=(0,be.cU)(e);e=e.replace(t,"");const i=parseFloat(e);return!isNaN(i)}getNearbyElementsWeight(e){const t=this.getNearbyElements(e,10);if(t){let i=0,o=0;for(;t[o]!==e;)o++;const a=o;let r;o--;let n=5,s=!1,c=!1;for(;a-o<n&&o>=0;){if(r=t[o],r&&r.innerText&&this.isFieldVisible(r)&&r!==e&&!r.outerHTML.includes("hidden")){if(s||0!==r.querySelectorAll("*").length||!this.isPrice(r.innerText.toLowerCase())&&!r.innerText.toLowerCase().includes("tbd"))s=!0;else{for(n=20,o--,r=t[o];r&&r.innerText&&this.isPrice(r.innerText.toLowerCase())&&a-o<n;)o--,r=t[o];s=!0}r&&r.innerText&&r.innerText.toLowerCase().includes("total")&&(c=!0),c&&(i+=De.nearbyContainsCheckoutKeywords(r.innerText.toLowerCase(),a-o))}o--}return i}return 0}getNearbyElements(e,t){let i=e;for(;i&&i.parentNode&&i.querySelectorAll("*").length<=t;)i=i.parentNode;return i?i.querySelectorAll("*"):i}getBestPriceField(e,t){const i=this.getMaxWeightIndex(t,((t,i)=>{const o=parseFloat(window.getComputedStyle(e[i]).getPropertyValue("font-size")),a=parseFloat(window.getComputedStyle(e[t]).getPropertyValue("font-size"));return o&&a&&o>a?i:t}));if(i>=0){const t=e[i];return this.getDomPath(t)}return""}getMaxWeightIndex(e,t){let i=0,o=-1,a=0;return e.forEach((e=>{e>0&&(i<e?(o=a,i=e):t&&o>=0&&i===e&&(o=t(o,a))),a++})),o}isFieldVisible(e){return e.offsetWidth>0&&e.offsetHeight>0&&"none"!==window.getComputedStyle(e).display}getDomPath(e){let t,i;if(e.hasAttribute("id")&&""!==e.id){if(t="#"+e.id,i=this.getElement(t),i===e)return t}else for(const o of e.attributes)if(o.name.includes("data")&&(t=e.nodeName.toLowerCase()+"["+o.name+"="+o.value+"]",i=this.getElement(t),i===e))return t;const o=[],a=[],r=[];let n,s,c=e,l=!1,u=0;for(;c&&c.parentElement&&u<=5;){if(t=c.nodeName.toLowerCase()+",",n=c.nodeName.toLowerCase()+",",r[u]=c.nodeName.toLowerCase(),c.hasAttribute("id")&&""!==c.id)t+="#"+c.id+",";else{for(const e of c.attributes)e.name.includes("data")&&!l&&this.getElement(c.nodeName.toLowerCase()+"["+e.name+"="+e.value+"]")&&(t+="["+e.name+"="+e.value+"],",l=!0);if(""!==c.className&&(s=c.className.split(/\s+/),s.length>=1&&s.forEach((e=>{""!==e&&!this.isTemporary(e)&&this.getElement(c.nodeName.toLowerCase()+"."+e)&&(n+="."+e+",")}))),c.parentElement){const e=c.parentElement.children;if(e.length>1){let t,i=1;for(t of e)t===c&&(n+=":nth-child("+i+")"),i++}}}o[u]=t,a[u]=n,c=c.parentElement,u++}const d=r;let h="",p=!1,g=new Array;return u=0,o.forEach((t=>{if(!p){const o=t.split(",");for(let t=1;t<o.length;t++)p||(d[u]+=o[t],g=new Array,d.forEach((e=>{g.unshift(e)})),h=g.slice(1).join(" "),i=this.getElement(h),i&&i.outerHTML===e.outerHTML&&(p=!0));u++}})),p?h:(u=0,a.forEach((t=>{if(!p){const o=t.split(",");for(let t=1;t<o.length;t++)p||(d[u]+=o[t],g=new Array,d.forEach((e=>{g.unshift(e)})),h=g.slice(1).join(" "),i=document.querySelector(h),i&&i.outerHTML===e.outerHTML&&(p=!0));u++}})),p?h:"")}isTemporary(e){if(e.includes("is"))return!0;const t=["a","e","i","o","u","-"];let i=0;for(let o=0;o<e.length;o++)if(t.includes(e.charAt(o).toLowerCase())?i=0:i++,i>=5)return!0;return!1}getElement(e){try{return document.querySelector(e)}catch(e){return null}}}(Ue.GetPlatformInstance()));var Xa=Ja;class qa{constructor(e,t,i,o){(0,a.Z)(this,"domainName",void 0),(0,a.Z)(this,"cashbackValue",void 0),(0,a.Z)(this,"currency",void 0),(0,a.Z)(this,"isPdp",void 0),this.domainName=e,this.currency=i,this.cashbackValue=t,this.isPdp=o??!1}}class $a{constructor(){(0,a.Z)(this,"ItemIndex",void 0),(0,a.Z)(this,"ItemPrice",void 0),(0,a.Z)(this,"OriginalItemPrice",void 0),(0,a.Z)(this,"Currency",void 0)}static Create(e){const t=new $a;return t.ItemIndex=e.ItemIndex,t.ItemPrice=e.ItemPrice,t.OriginalItemPrice=e.OriginalItemPrice,t.Currency=e.Currency,t}}var er=$a;class tr{constructor(){(0,a.Z)(this,"OtherSeller",void 0)}static Create(e){const t=new tr;return e.OtherSeller&&(t.OtherSeller=er.Create(e.OtherSeller)),t}}var ir=tr,or=class{constructor(t){(0,a.Z)(this,"Guid",void 0),(0,a.Z)(this,"ExpMonth",void 0),(0,a.Z)(this,"ExpYear",void 0),(0,a.Z)(this,"FullName",void 0),(0,a.Z)(this,"MaskedCardNumber",void 0),(0,a.Z)(this,"CardNumber",void 0),(0,a.Z)(this,"CardType",void 0),(0,a.Z)(this,"Address",void 0),(0,a.Z)(this,"Cvv",void 0);const i=t.metadata.summaryLabel.substr(0,t.metadata.summaryLabel.indexOf(" ")),o=t.metadata.summaryLabel.substr(t.metadata.summaryLabel.length-5,t.metadata.summaryLabel.length);this.UpdateFileds(t.guid,t.expirationMonth,t.expirationYear,t.name,t.cardNumber,e.sj[i.toUpperCase().trim()],o,t.address,t.cvv)}UpdateFileds(e,t,i,o,a,r,n,s,c){this.Guid=e,this.ExpMonth=t,this.ExpYear=i,this.FullName=o,this.CardNumber=a,this.CardType=r,this.MaskedCardNumber=n,this.Address=s,this.Cvv=c}};let ar=function(e){return e.WalletDrawerFlag="WalletDrawerFlag",e.BnplFlag="BnplFlag",e.CashbackOnly="CashbackOnly",e.WalletDrawerDemoApiResponse="WalletDrawerDemoApiResponse",e.CheckoutData="CheckoutData",e}({});var rr=class extends et{constructor(t,i,o,r){super(e.Vm.UpdateRewardsData,t,i,o),(0,a.Z)(this,"rewardsData",void 0),this.rewardsData=r}},nr=i(56854);let sr="";async function cr(t,i){try{await async function(t,i){const a=t[0],n=JSON.parse(a),c=await lr(t[12],ar.WalletDrawerDemoApiResponse),u=L.Create(c||n);if(sr=u.impressionId,i){const t="Edge Driver Injected",i=new l(s.Injected);ho.GetLogService().LogClientEventV2(e.in.Information,e.R.EdgeDriverStatus,t,i,sr)}let d=new ir,h=!1,p=null;if(u.retailerData.UpdateCurrentCheckoutPage(location.pathname),t.length>=2)try{const e=t[1];if(e){const t=JSON.parse(e);ho.GetPlatformInstance().UpdateLocalData(Ne.Q.LocalizedStrings,t)}}catch(e){}let g,v,E=!0;if(t.length>=3&&"true"===t[2]&&(E=!1),ho.GetLocalDataService().clear(),ho.GetLocalDataService().SaveLocalData(Ne.Q.ApiResponse,n),ho.GetLocalDataService().SaveLocalData(Ne.Q.ImpressionId,sr),t.length>=4){const e=t[3];let i=null;e&&(i=Tt.Z.CreateFromObject(JSON.parse(e))),ho.GetApplicatorStateService().SaveCouponApplicatorState(i),i&&(i.ImportOptions&&ho.GetLocalDataService().SaveLocalData(Ne.Q.ImportOptions,i.ImportOptions),i.CashBackActive&&ho.GetLocalDataService().SaveLocalData(Ne.Q.CashBackActive,i.CashBackActive))}if(t.length>=5){const e=t[4];if(e)try{const t=JSON.parse(e);ho.GetLocalDataService().SaveLocalData(Ne.Q.ImportOptions,t)}catch(e){}}if(t.length>=6){const e=t[5];if(e)try{const t=JSON.parse(e);ho.GetLocalDataService().SaveLocalData(Ne.Q.CashBackActive,t)}catch(e){}}if(t.length>=7&&(g=t[6]),v=function(t){let i;try{t.length>=18&&t[17].length>0?i=t[17]:t.length>=20&&t[19].length>0&&(i=t[19])}catch(t){const i="Error extracting EnabledServiceFeature",o=new l(s.Error);ho.GetLogService().LogClientEventV2(e.in.Error,e.R.EdgeDriverStatus,i,o,sr)}return i}(t),t.length>=7)try{if(Pi.R.Create(g,v),ho.GetLocalDataService().SaveLocalData(Ne.Q.Experiments,g),Pi.R.isExperimentActive(pi.H.calculatedCutOffPriceFiltering)&&ho.GetLocalDataService().SaveFeature(It.calculatedCutOffFiltering,!0),Pi.R.isExperimentActive(pi.H.aaEarlyReturn)){ho.GetLocalDataService().SaveFeature(It.aaEarlyReturn,!0);const e=Pi.R.getServiceExperimentValue(pi.H.aaEarlyReturn);ho.GetLocalDataService().SaveLocalData(Ne.Q.AAEarlyReturnVariant,e)}}catch(e){}let P=!1;if(t.length>=8)try{if(Pi.R.isExperimentActive(pi.H.expressCheckout)){const e=ho.GetLocalDataService(),i=t[7],o=JSON.parse(i);if(o.checkout_user_data){const i=JSON.parse(o.checkout_user_data);if(i){const{Profile:o,Payment:a,IsSkipPayment:r,IsSkipProfile:n,BNPLProvider:s,SkipAutoApply:c,TotalAmountDialogData:l}=i,u=await lr(t[12],ar.BnplFlag);if(Pi.R.isExperimentActive(pi.H.showPaymentOptions)||u){const t=new W;if(!r&&a&&a.guid&&(t.Payment=H.CreateFromSettingsData(new or(a))),n){const i=e.GetLocalData(Ne.Q.CheckoutUserData);t.Profile=i?.Profile}else o&&o.guid&&(t.Profile=F.CreateFromSettingsData(new Z(o)));const u=r||!!t.Payment,d=n||!!t.Profile;u&&d?(t.SkipAutoApply=c,t.IsSkipPayment=r,t.IsSkipProfile=n,t.BNPLProvider=s,t.TotalAmountDialogData=l,e.SaveLocalData(Ne.Q.CheckoutUserData,t)):e.SaveLocalData(Ne.Q.CheckoutUserData,i)}else if(o&&o.guid&&a&&a.guid){const t=new W;t.Profile=F.CreateFromSettingsData(new Z(o)),t.Payment=H.CreateFromSettingsData(new or(a)),t.SkipAutoApply=c,t.IsSkipPayment=r,t.IsSkipProfile=n,e.SaveLocalData(Ne.Q.CheckoutUserData,t)}else e.SaveLocalData(Ne.Q.CheckoutUserData,i);c&&(P=c)}}const a=o.checkout_in_progress;if(a&&"true"===a&&o.checkout_current_state){const t=Gt.CreateFromObject(JSON.parse(o.checkout_current_state));e.SaveLocalData(Ne.Q.ExpressCheckoutState,t),t.CheckoutProgress&&(P=!0)}let r=!1;const s=await lr(t[12],ar.CheckoutData)||n?.checkoutData;if(s){const t=new f.Z(s);e.SaveLocalData(Ne.Q.CheckoutElementsData,t);let i=!1;t.CheckoutPageUrl&&t.CheckoutPageUrl.split(",").forEach((e=>{i=i||m.ZP.IsOnPage(e,location.pathname)})),r=i&&t.IsExpressCheckoutEnabled}r&&e.GetLocalData(Ne.Q.CheckoutUserData)&&e.GetLocalData(Ne.Q.CheckoutElementsData)&&e.SaveFeature(It.expressCheckout,!0)}}catch(e){}if(t.length>=9){const a=t[8],r=t.length>=21?t[20]:"";if((a||r)&&i){const t=u?.retailerData,i=t.domainName;try{const n=JSON.parse(a||r);if(n.action===o.v.Clipping){const e=n.data,o=t.GetCurrentCheckoutPage()?.clippingSelectors;if(o&&i)return void ho.GetClippingService().TryClipCoupons(o,i,e,sr)}else if(n.action===o.v.ItemizedCashbackAddToCart)try{const e=u?.retailerData?.GetCurrentCheckoutPage(),t=e?.productAddToCartSelector,o=n?.data;return i&&e&&t?void ho.GetICDriverService().HandleAddToCart(e,o):void 0}catch(t){const i=ho.GetLogService(),o=`Error Itemized Cash Back Add To Cart : ${t?.message}`,a=new l(s.Error);return void i.LogClientEventV2(e.in.Error,e.R.EdgeDriverStatus,o,a,sr)}else if(n.action===o.v.InstantAddToCart)try{const e=u?.retailerData?.GetCurrentCheckoutPage(),t=e?.productAddToCartSelector;if(i&&e&&t){const e=n?.data;return void await ho.GetInstantAddToCartService().LaunchInstantATCOverlay(u,e)}return}catch(t){const i=ho.GetLogService(),o=`Error Itemized Cash Back Add To Cart : ${t?.message}`,a=new l(s.Error);return void i.LogClientEventV2(e.in.Error,e.R.EdgeDriverStatus,o,a,sr)}else if(n.action===o.v.OtherSellers){if(d=ir.Create(n.data),void 0===d?.OtherSeller?.ItemIndex)return}else if(n.action===o.v.BackgroundAA)h=!0,ho.GetLocalDataService().SaveFeature(It.useBackgroundAutoApplyResult,!0);else if(n.action===o.v.PDPconsentAA){ho.GetLocalDataService().SaveFeature(It.autoTriggeredAutoApply,!0);const e=n.data;e?.BgaaResultAvailable&&(h=!0,ho.GetLocalDataService().SaveFeature(It.useBackgroundAutoApplyResult,!0))}else if(n.action===o.v.ApplyClickedCoupon)p=n.data,p?.couponCode&&(ho.GetLocalDataService().SaveFeature(It.applyCopiedCoupon,!0),u.coupons=u.coupons.filter((e=>e.couponCode===p.couponCode)));else if(n.action===o.v.ApplyProductBestCoupon){const e=n.data;e?.productBestCoupon&&(ho.GetLocalDataService().SaveFeature(It.productBestCoupon,!0),u.coupons=[e.productBestCoupon])}else{if(n.action!==o.v.ApplyExclusiveCoupon)return;{const e=n.data,t="exclusiveCoupon";e[t]&&(ho.GetLocalDataService().SaveFeature(It.exclusiveCoupon,!0),u.coupons=[e[t]])}}}catch(e){return}}}if(t.length>=10)try{const e=t[9];if(e){const t=JSON.parse(e);Ii.Q.Create(t),Ii.Q.setRawStorageObject(t),Ii.Q.setStorageObjStr(e);try{let e;if(t?.InboxCouponsHashedUserId&&ho.GetLocalDataService().SaveLocalData(Ne.Q.InboxCouponsHashedUserId,t?.InboxCouponsHashedUserId),t?.InboxCouponsUserHashedEmail&&ho.GetLocalDataService().SaveLocalData(Ne.Q.InboxCouponsUserHashedEmail,t?.InboxCouponsUserHashedEmail),t?.socialCoupons&&(e=JSON.parse(t.socialCoupons)),e&&e.forEach((e=>{const t=/(http|https):\/\/(www\.)?([A-Za-z0-9]*\.(com|net|org|info|coop|int|co\.uk|org\.uk|ac\.uk|uk|__and so on__))/;e.coupons?.forEach((i=>{const o=t.exec(i.retailerLink);if(o&&5===o.length&&o[3]===u.retailerData.domainName){const t=new ni.Z;t.attribution=e.influencerName,t.couponCode=i.couponCode,t.title=i.description,u.coupons.push(t)}}))})),h&&E){const e=vi.Z.GetBackgroundAutoApplyStateString(t);(0,ki.TF)(e)?ho.GetLocalDataService().SaveFeature(It.useBackgroundAutoApplyResult,!1):ho.GetLocalDataService().SaveLocalData(Ne.Q.BackgroundAutoApplyState,e)}const i=u?.retailerData?.domainName,o="ECB_Processed_"+i;if(t[o]&&ho.GetLocalDataService().SaveLocalData(Ne.Q.EstimatedCashback,t[o]),t[S.Q5]&&(ho.GetLocalDataService().SaveLocalData(Ne.Q.AutoOpenData,t[S.Q5]),ho.GetLocalDataService().SaveLocalData(Ne.Q.LastCleanedData,t[S.Gr])),n?.isCashbackEstimationSupportedForDomain){const e=A.Z.Create(n?.cashback),i=(0,r.S8)()?"EstimatedCashback:CartData"+(0,r.S8)():"EstimatedCashback:CartData",o=JSON.parse(t[i]);if(o&&"Storewide"===e.category){let t=0;"Percent"!==e.commissionType&&"%"!==e.commissionType||!e.commissionValue?e.commissionType:t=o.value*(parseFloat(e.commissionValue)/100),parseFloat(t.toFixed(2))&&ho.GetLocalDataService().SaveLocalData(Ne.Q.EstimatedCashback,new qa(u?.retailerData?.domainName,t.toFixed(2),"$"))}}c||Ei.Z.GetSuggestedCouponService().Init()}catch(e){}}}catch(e){}if(t.length>=13)try{if(i&&ho.GetEdgeMessageService().SendEdgeDriverStateChangeMessage(V.EdgeDriverForCouponInjectedAndStarted,JSON.stringify({enabledFeatureNames:[C.NewSkipCoupon]})),await lr(t[12],ar.WalletDrawerFlag),await lr(t[12],ar.CashbackOnly))return}catch(e){return}if(t.length>=17&&(_e.Z.enabledServiceFlights=t[16]),t.length>=19&&ho.GetLocalDataService().SaveLocalData(Ne.Q.CashbackShouldStandDown,!(0,ki.TF)(t[18])&&Boolean(JSON.parse(t[18]))),i)if(void 0!==d?.OtherSeller?.ItemIndex)ho.GetOtherSellersService().AddToCart(u,d);else if(P)ho.GetCheckoutService().StartExpressCheckout();else{const o=u?.retailerData,a=o.GetCurrentCheckoutPage()?.clippingSelectors,n=o.domainName;if(a&&n)return void ho.GetClippingService().TryClipCoupons(a,n,new K.V,sr);if(i&&!h&&t.length>=11&&!(0,ki.TF)(t[10]))try{const e=JSON.parse(t[10]),i=(0,nr.H)(),o=(0,nr.r)(),a=ho.GetBackgroundAutoApplyService(),r=a.GetBackgroundAutoApplyScenario(e,i,o,t.length>=21&&t[20].length>0);if(r&&!await a.SetUpBackgroundAutoApply(u,r,i,o))return}catch(e){ho.GetBackgroundAutoApplyService().LogError("EdgeDriver",void 0,e?.Message)}if(!Pi.R.isExperimentActive(pi.H.disableZeroSuccessRateCouponShuffling)&&0===u?.retailerData?.retailerTrivia?.SuccessRate){const e=u?.coupons?.filter((e=>e?.isPrivateCoupon)),t=u?.coupons?.filter((e=>(0,r.Mu)(e,u?.retailerData?.domainName))),i=e?.length>0?e:t?.length>0?[t[Math.floor(Math.random()*t?.length)]]:[u?.coupons[Math.floor(Math.random()*u?.coupons?.length)]],o=u?.coupons?.filter((e=>i?.indexOf(e)<0));o?.length>0&&(o.sort((()=>Math.random()-.5)),o.forEach(((e,t)=>{t<o.length-1&&(e.isLowSuccessRateCoupon=!0)}))),u.coupons=[...i,...o]}const s=new At(u,e.og.FromBackground,(0,r.S8)(),location.pathname,E);ho.GetBackgroundMessagingService().HandleMessage(s)}}(t,i)}catch(t){if(i){const i=ho.GetLogService(),o="Unhandled error in edge driver: "+t?.message,a=new l(s.Error);i.LogClientEventV2(e.in.Information,e.R.EdgeDriverStatus,o,a,sr)}}}async function lr(e,t){try{if(!e)return null;const i=JSON.parse(e),o=i?.use_edge_wallet_drawer;if(t===ar.WalletDrawerFlag&&ho.GetLocalDataService().SaveLocalData(Ne.Q.UseWalletDrawer,o),!o)return null;if(t===ar.BnplFlag)return i?.use_edge_wallet_drawer_bnpl;if(t===ar.WalletDrawerDemoApiResponse){const e=i?.use_super_coupon,t=i?.mocked_api_response,a=t&&JSON.parse(t);return o&&e&&a}if(t===ar.CashbackOnly){const e=i?.is_cashback_only;return!!e&&(await ho.GetWalletDrawerService().ShowWalletOverlay(),!0)}if(t===ar.CheckoutData)return i?.checkout_data}catch(e){return null}}window[e.PK.HandleBackgroundMessage]=function(e){return Xa.ProcessMessage(e)},window[e.PK.HandleContentMessage]=function(e){ho.GetBackgroundMessagingService().HandleMessage(e)},window.TryExecuteAutoApply=cr,window[e.Zd]=t.a,window.SendSequenceSupportedMessage=function(){ho.GetEdgeMessageService().SendSequenceSupportedMessage()},window.CheckAndExecuteAutoApply=function(e,t){(0,r.cz)()||cr(e,t)},window.ExecuteUpdatePaymentDetails=async function(e){const t=e[0],i=JSON.parse(t),o=JSON.parse(e[1]);await lr(o,ar.WalletDrawerFlag);const a=await lr(e[1],ar.CheckoutData)||i?.checkoutData;a&&o&&await ho.GetCheckoutPaymentUpdateService().UpdatePaymentDetails(a,o)},window.HandleWalletMessageFromHost=async function(e,t){await ho.GetWalletDrawerService().HandleMessageFromHost(e,t)},window.CancelBackgroundAutoApply=async function(){ho.GetBroadcastChannelService().GetNewInstance().postMessage(new ft(p.CancelAutoApply,e.ps.Cancelled))},window.RestartBackgroundAutoApply=async function(){ho.GetBroadcastChannelService().GetNewInstance().postMessage(new ft(p.RestartAutoApply,e.ps.Cancelled))},window.UpdateRewardsData=async function(t){try{const i=t[0],o=ja.Create(JSON.parse(i)),a=new rr(e.og.FromBackground,(0,r.S8)(),location.pathname,o);ho.GetBackgroundMessagingService().HandleMessage(a);const n="Promotions Data Updated",s=JSON.stringify({promotionsData:o}),c=new Ya.Z((0,r.S8)(),e.oN.AARewards,location.pathname,e.zy.PromotionsDataUpdated,s);ho.GetLogService().LogClientEventV2(e.in.Information,e.R.ShoppingRewards,n,c,sr)}catch(e){}},window[e.zS]=async function(e){const t=ho.GetLocalDataService().GetLocalData(Ne.Q.ApiResponse),i=So.Z.GetExpressCheckoutGMVSelector(t);if(i){const o=await So.Z.GetExpressCheckoutGMV(i,t,e);return o?.OrderTotal}return null},window.addEventListener("beforeunload",(t=>{window.overlayunloaded=!0,ho.GetEntryPointService().GetEntryPoint()===e.N9.Wallet&&ho.GetEdgeMessageService().SendRetailerPageRefreshMessage()}))}()}();

Anon7 - 2022
AnonSec Team