(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,499239,e=>{"use strict";var t=e.i(981030),i=e.i(284007);(0,t.atom)("auth");let r=(0,t.atom)(null);(0,t.atom)(null);let o=(0,t.atom)(!1),a=(0,t.atom)(null),n=(0,i.atomWithStorage)("wxu-web/keyval:cart","",void 0,{getOnInit:!0}),s=(0,i.atomWithStorage)("wxu-web/keyval:cartIds",null,void 0,{getOnInit:!0}),l=(0,t.atom)(""),u=(0,t.atom)(null),c=(0,i.atomWithStorage)("wxu-web/keyval:eventChainId","",void 0,{getOnInit:!0}),d=(0,t.atom)("idle");e.s(["addressDataAtom",0,r,"billingPreviewDataAtom",0,u,"cartIdsAtom",0,s,"cartProductIdAtom",0,n,"checkoutValidationAtom",0,d,"eventChainIdAtom",0,c,"promoCodeAtom",0,a,"showSuccessDialogAtom",0,o,"tpccAtom",0,l])},145473,e=>{"use strict";var t=e.i(902875),i=e.i(247865),r=e.i(533760),o=e.i(546446),a=e.i(581014),n=e.i(901351),s=e.i(422825),l=e.i(837879),u=e.i(725296),c=e.i(394481),d=e.i(576816),p=e.i(539353),g=e.i(553329),m=e.i(695881),f=e.i(143851),b=e.i(703123),y=e.i(61284);let h=(0,m.createLogger)("useGoogleLogin");var w=e.i(404893),A=e.i(62544),S=e.i(792461);e.s(["GoogleAuthScriptClient",0,function({onLoad:e,prompt:m=!0,isUserLoggedIn:v,redirectToCheckoutOnSignup:C,oneTapOnly:P=!1}){let I=(0,a.useTranslations)("GoogleLogin"),E=(0,o.useSetAtom)(w.googleLoginInitilizedAtom),{loginWithGoogle:k,error:O,clearError:_}=function(e=!1){let t=(0,a.useTranslations)("GoogleLogin"),[r,m]=(0,i.useState)(null),w=(0,o.useAtomValue)(b.gsiEmailStatesAtom),{updateEmailSubscriptions:A}=(0,s.useEmailPreferences)({skipStatus:!0}),{authSuccess:S,authRedirect:v}=(0,f.useUserLogin)(),C=(0,l.useSubscriptionsEnabled)(),P=(0,o.useAtomValue)(c.privacyRegimeAtom)??u.default.EXEMPT,I=C&&u.US_REGIMES.includes(P)&&P!==u.default.USA_CCPA,{newsletter:E,weekly:k}=w,O=I||w.onYourRadar,_=I||w.marketing,R=(0,d.useSignupComplete)({formVariant:"account page google",sensitiveDataAuthorization:!0,deviceTimeZone:"u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0}),T=(0,p.useSignupComplete)({formVariant:"account page google",loginMethod:"Google",marketingOptedIn:!0===_}),U=(0,i.useCallback)(async t=>{let i=await n.upsxClient.auth.loginWithGoogle({google_id_token:t}),r=!!i.isFirstLogin;if(await S({email:i.email,userID:i.userID,type:r?"signup":"login"},!1,{skipSignupCompleteEvent:r}),!r)return v(),!0;let{error:o}=await (0,g.tryCatch)(R());return o&&h.warn("Failed to track signup-complete for Google signup",o),T(),await A({newsletter:E,weekly:k,onYourRadar:O,marketing:_}).catch(e=>{h.error("Failed to update email subscriptions",e)}),e&&C?v(y.PROMO_CHECKOUT_URL):v(),!0},[S,v,R,T,A,E,k,O,_,e,C]);return{loginWithGoogle:(0,i.useCallback)(async({credential:e})=>{m(null);let{data:i,error:r}=await (0,g.tryCatch)(U(e));if(i)return!0;h.error("Failed to login with Google",r);let{messageCode:o}=r?.data??{};switch(o){case 1e3:case 1026:case 1033:m({header:t("emailAlreadyUsedGoogleHeader"),body:t.raw("emailAlreadyUsedGoogleBody")});break;case 1027:case 1030:m({header:t("emailAlreadyRegisteredGoogleHeader"),body:t("emailAlreadyRegisteredGoogleBody")});break;default:m({header:t("somethingWentWrong")})}return!1},[U,t]),error:r,clearError:(0,i.useCallback)(()=>m(null),[])}}(C),R=(0,S.useRefMemo)(k),T=(0,i.useRef)(null);O&&(T.current=O);let U=T.current;return(0,t.jsxs)(t.Fragment,{children:[!(P&&v)&&(0,t.jsx)(r.default,{src:"https://accounts.google.com/gsi/client",onLoad:()=>{let t=window.google?.accounts?.id;t&&(t.initialize({client_id:"797231885346-rai9vgnvf4u38enai8bhginnnrh5uvch.apps.googleusercontent.com",context:"signin",ux_mode:"popup",use_fedcm_for_prompt:!0,callback:e=>{R.current?.(e)}}),E(!0)),e?.(),!v&&m&&t?.prompt()},id:"google-gsi-script",strategy:P?"lazyOnload":"afterInteractive"}),U&&(0,t.jsx)(A.Dialog,{open:!!O,onOpenChange:e=>!e&&_(),children:(0,t.jsx)(A.BasicDialog,{showCloseButton:!1,title:U.header||"",description:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:U.body||""}}),primaryAction:{label:I("cancel"),onClick:_}})})]})}],145473)},642588,e=>{"use strict";e.i(138276);let t="stripeCart",i=/^[a-z0-9-]{1,64}$/;function r(e){return"string"==typeof e&&i.test(e)}let o=/^[A-Za-z0-9-]{1,64}$/;function a(e,t,i){"u">typeof document&&(document.cookie=`${e}=${t}; domain=.weather.com; path=/; samesite=lax; secure; max-age=${i}`)}let n="zuoraCart",s=/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/;function l(e){return"string"==typeof e&&s.test(e)}e.s(["clearStripeCartCookie",0,function(){a(t,"",0)},"clearZuoraCartCookie",0,function(){a(n,"",0)},"isPromotionCode",0,function(e){return"string"==typeof e&&o.test(e)},"isStripePlan",0,r,"isZuoraProductId",0,l,"setStripeCartCookie",0,function(e){let i=e.trim();r(i)&&a(t,i,1800)},"setZuoraCartCookie",0,function(e){let t=e.trim();l(t)&&a(n,t,1800)}])},138276,e=>{"use strict";let t={"f42d0603-2f6f-454f-aa1f-8a293b8a82a2":{plan:"twc-premium-monthly"},"e251f39b-afd7-4ad9-9c87-5e2a8ed63fbb":{plan:"twc-premium-annual"},"f42d0603-2f6f-454f-aa1f-8a293b8a86ma":{plan:"twc-premium-annual",offer:"ep2qejazaqea"},"ab383695-a1b9-4d39-86e0-90e63b0cb9fb":{plan:"twc-premium-annual",offer:"56e9u62z6c92"},"f7e53b80-9d8c-4733-a31e-d0f97aa917c8":{plan:"twc-premium-annual-100"},"9c2d8ad5-51a4-464e-9d8a-12c0f248ceea":{plan:"twc-premium-6month"},"7218a4c4-1a0a-4e31-b047-b05a4c7a1a7d":{plan:"twc-standard-monthly"},"44b324df-0b83-4b95-b4ab-77803026ee07":{plan:"twc-standard-annual"},"43ea0710-b055-4ab5-ba39-bbfd0bc5d5ce":{plan:"wu-adfree-annual"},"15730354-c91f-4343-a792-a83b16dd183b":{plan:"wu-adfree-monthly"},"55883fb6-c39b-440b-b964-0b96155851e5":{plan:"wu-premium-annual"},"7a808b48-a174-417b-aa4d-c8561cf430ea":{plan:"wu-premium-monthly"}};function i(e){let i;return(!(i=e?.trim().toLowerCase())||!Object.hasOwn(t,i)?null:t[i]??null)?.plan??null}let r=new Map(Object.entries(t).filter(([,e])=>!e.offer).map(([e,{plan:t}])=>[t,e]));e.s(["getStripePlanForZuoraProduct",0,i,"getZuoraProductForStripePlan",0,function(e){let t=e?.trim().toLowerCase();return t&&r.get(t)||null},"isWuZuoraProduct",0,function(e){return i(e)?.startsWith("wu-")??!1}])},238430,e=>{"use strict";var t=e.i(902875),i=e.i(247865);e.s(["default",0,function({candidate:e,failedMessage:r="Authentication failed. Please try again.",protectMessage:o="Remove your adblocker.",fetch:a,refresh:n,getCustomAccountInfo:s}){let[l,u]=(0,i.useState)(""),[c,d]=(0,i.useState)(!1),[p,g]=(0,i.useState)(!1),[m,f]=(0,i.useState)(!1),b=(0,i.useRef)([]);(0,i.useEffect)(()=>{e.id!==b.current[0]&&(b.current=[e.id],e.transactIDs&&b.current.push(...e.transactIDs))},[e.id,e.transactIDs]);let y=(0,i.useCallback)(()=>{try{a("/?adm_get_token=1").then(e=>{e.ok&&n()}).catch(()=>{u(r)})}catch{u(r)}},[a,r,n]),h=(0,i.useMemo)(()=>"u">typeof window?window:{admiral:{}},[]);return(0,i.useEffect)(()=>{typeof window>"u"||(h.admiral=h.admiral||function(...e){(h.admiral.q=h.admiral.q||[]).push(e)},h.admiral("after","measure.detected",function(t){if("abr"==e.requirement)t.adblocking?(u(o),d(!0)):f(!0);else if("account"==e.requirement||"benefits"==e.requirement){let t=!!s;h.admiral("after","visitor.latest",function(i){var r;if("account"===e.requirement)(t?s().registered:i.status.registered)||p||(u(o),d(!0));else if("benefits"===e.requirement){let i=[];if(t)i=s().benefits;else{let e=document.cookie.split(";");e&&(i=(null==(r=e.find(e=>e.startsWith("admbenefits=")))?void 0:r.split(","))??[])}if(i){let t=e.benefits??[];if(0==t.length)return void f(!0);let r=!1;for(let e of t)i.includes(e)&&(r=!0);r?f(!0):(u(o),d(!0))}else u(o),d(!0)}})}}))},[]),(0,i.useEffect)(()=>{m&&(f(!1),y())},[m,y]),(0,i.useEffect)(()=>{p||!c||(g(!0),h.admiral("targeting","force",{candidateIDs:b.current}))},[p,c,b,h]),(0,t.jsxs)("div",{children:[l||null," "]})}])},899507,e=>{"use strict";e.s(["isNil",0,function(e){return null==e}])},449928,760430,355200,e=>{"use strict";e.s(["isPrimitive",0,function(e){return null==e||"object"!=typeof e&&"function"!=typeof e}],449928),e.s(["isTypedArray",0,function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}],760430),e.s(["isUnsafeProperty",0,function(e){return"__proto__"===e}],355200)},590238,e=>{"use strict";var t=e.i(725287),i=e.i(537989);e.i(609717);var r=e.i(950771),o=e.i(695203),a=e.i(604323),n=e.i(797770),s=e.i(236433),l=e.i(513539),u=e.i(991511);e.s(["AnalyticsBoundary",0,e=>{let c=(0,t.usePathname)();return(0,u.useRehydrateAtoms)([[i.pageIdAtom,e.pageId],[r.pageLocaleAtom,e.pageLocale],[o.deviceClassAtom,e.deviceClass],[a.metricsArticleDataAtom,e.metricsArticleData],[n.adsMetricsUnitAndZoneAtom,e.adsMetricsUnitAndZone??"non_monetized"],[l.layoutStateAtom,e.layoutState??null],[l.activeEventAtom,e.activeEvent??null],[s.pageAtomsPathnameAtom,c]]),null}])},539353,e=>{"use strict";e.i(288906);var t=e.i(247865),i=e.i(546446),r=e.i(540768),o=e.i(682142),a=e.i(782937),n=e.i(695881),s=e.i(333350),l=e.i(64412),u=e.i(950771),c=e.i(537989),d=e.i(695203),p=e.i(158662),g=e.i(358273),m=e.i(777638),f=e.i(727365),b=e.i(896363),y=e.i(924776),h=e.i(605781);let w=(0,n.createLogger)("useSignupComplete"),A=["SUN","MON","TUE","WED","THU","FRI","SAT"],S=new Set(["city","locality","neighborhood","airport","postal","poi","ski","geocode","locid"]),v=new Set(["mapbox","twc-poi","twc-v3-loc-search","twc-v3-loc-point"]),C=["appVersion","cookiesEnabled","dayOfWeek","deviceClass","formVariant","functionalTechnologies","genderFilled","geographicallyRelevantAds","gpcSignalOptOut","hourOfDay","locale","loginMethod","marketingOptedIn","newsletterOptedIn","pageId","partner","physicalCountry","physicalState","priv","regime","sessionId","sessionStartTime","url","wlocCity","wlocCountry","wlocDMA","wlocState"];e.s(["useSignupComplete",0,(e={})=>{let n=(0,i.useAtomValue)(c.pageIdAtom),P=(0,i.useAtomValue)(u.pageLocaleAtom),I=(0,i.useAtomValue)(d.deviceClassAtom),{location:E}=(0,l.useLocation)(),k=(0,i.useAtomValue)(p.experimentJoinListAtom),O=(0,y.useIsHightouchReady)(),_=(0,t.useRef)(!1),{formVariant:R,url:T,loginMethod:U,newsletterOptedIn:D,marketingOptedIn:G,sourcePage:L,sourceModule:M,sourceElement:N,sourcePosition:x}=e,j=(0,t.useMemo)(()=>{if(!s.default)return null;let e=(0,o.getCICookie)(),t=e?.["TWC-GeoIP-Country"]??(0,r.getCookie)("twc-location-country"),i=e?.["TWC-GeoIP-Region"]??(0,r.getCookie)("twc-location-region"),l=e?.["TWC-Privacy"]??(0,r.getCookie)("twc-privacy"),u=window.DprSdk?.getGdprConsentOptInsString()??"",c=window.DprSdk?.getCcpaSaleOptInString()??"",d=window.navigator?.globalPrivacyControl??!1,p=u?.includes("functional-technology")??!1,y=window.DprSdk?.getUserConsent("geographically-relevant-advertising")!==!1,h=navigator?.cookieEnabled??!1,w=(0,r.getCookie)("partner")||"",C=(0,a.getPartnerByPattern)(w)??w,O=(0,g.getMetricsSession)(),_=O?.sessionId||"",j=O?.sessionStartTime||0,F=new Date,V=F.getHours(),W=A[F.getDay()]??"",z=-F.getTimezoneOffset()/60,B=document.referrer,Z=(0,f.normalizeWlocType)(E?.type),H=E?.featureSource??null;return{formVariant:R??"",url:T??"",loginMethod:U??"Regular",newsletterOptedIn:D??!1,marketingOptedIn:G??!1,genderFilled:!1,sourcePage:L??null,sourceModule:M??null,sourceElement:N??null,sourcePosition:x??null,pageId:n??"",locale:P,deviceClass:I,sessionId:_,sessionStartTime:j,partner:C,wlocCity:E?.city??null,wlocCountry:E?.countryCode??null,wlocState:E?.adminDistrictCode??null,wlocDMA:E?.dmaCd??null,wlocId:E?.placeId??null,wlocFeatureSource:null!=H&&v.has(H)?H:void 0,wlocTags:E?.tags?.length?(0,b.parseArrayToString)(E.tags):null,wlocType:null!==Z&&S.has(Z)?Z:void 0,wlocFeatureId:E?.featureId??null,dayOfWeek:W,regime:l??"",cookiesEnabled:h,gpcSignalOptOut:d,functionalTechnologies:p,geographicallyRelevantAds:y,priv:u,privProducts:c,referrer:B,deviceTimeZone:z,hourOfDay:V,physicalCountry:t??"",physicalState:i??"",interestBasedAds:window.DprSdk?.getUserConsent("interest-based-ads")!==!1,campaign:(0,m.getCampaign)()??void 0,tpcc:(0,m.getTpcc)(),linkReferral:(0,m.getLinkReferral)(),experimentJoinList:k,weatherMode:"normal",samsungVersion:(0,m.getSamsungVersion)(),appVersion:"df9905d9a7a026ac68fd6a79cf50e9e3300aff2b".slice(0,10)}},[R,T,U,D,G,L,M,N,x,n,P,I,E,k]),F=O&&null!==j&&C.every(e=>void 0!==j[e]);return(0,t.useCallback)(()=>{if(j&&F&&!_.current)try{(0,h.trackSignupComplete)(j),_.current=!0,w.info('Hightouch: Event "signup-complete" tracked')}catch(e){w.error('Hightouch: Event "signup-complete" failed',{error:e})}},[j,F])}])},592188,e=>{"use strict";e.i(288906);var t=e.i(247865),i=e.i(546446),r=e.i(540768),o=e.i(682142),a=e.i(782937),n=e.i(695881),s=e.i(333350),l=e.i(64412),u=e.i(950771),c=e.i(537989),d=e.i(695203),p=e.i(358273),g=e.i(158662),m=e.i(777638),f=e.i(924776),b=e.i(409628),y=e.i(605781);let h=(0,n.createLogger)("useUserLoggedIn");e.s(["useUserLoggedIn",0,(e={})=>{let n=(0,i.useAtomValue)(c.pageIdAtom),w=(0,i.useAtomValue)(u.pageLocaleAtom),A=(0,i.useAtomValue)(d.deviceClassAtom),S=(0,i.useAtomValue)(g.experimentJoinListAtom),{location:v}=(0,l.useLocation)(),C=(0,f.useIsHightouchReady)(),{url:P}=e;return(0,t.useCallback)(()=>{if(!s.default||!C)return;let e=(0,o.getCICookie)(),t=e?.["TWC-GeoIP-Country"]??(0,r.getCookie)("twc-location-country"),i=e?.["TWC-GeoIP-Region"]??(0,r.getCookie)("twc-location-region"),l=e?.["TWC-Privacy"]??(0,r.getCookie)("twc-privacy"),u=window.DprSdk?.getGdprConsentOptInsString()??"",c=window.DprSdk?.getCcpaSaleOptInString()??"",d=window.navigator?.globalPrivacyControl??!1,g=u?.includes("functional-technology")??!1,f=window.DprSdk?.getUserConsent("geographically-relevant-advertising")!==!1,I=navigator?.cookieEnabled??!1,E=(0,r.getCookie)("partner")||"",k=(0,a.getPartnerByPattern)(E)??E,O=(0,p.getMetricsSession)(),_=O?.sessionId||"",R=O?.sessionStartTime||0,T=new Date,U=T.getHours(),D=b.WEEK_DAYS[T.getDay()]??"",G=-T.getTimezoneOffset()/60,L=document.referrer,M={url:P??window.location.pathname,referrer:L,privProducts:c,deviceTimeZone:G,pageId:n??"",locale:w,deviceClass:A,sessionId:_,sessionStartTime:R,partner:k,wlocCity:v?.city??null,wlocCountry:v?.countryCode??null,wlocState:v?.adminDistrictCode??null,wlocDMA:v?.dmaCd??null,dayOfWeek:D,regime:l??"",cookiesEnabled:I,gpcSignalOptOut:d,functionalTechnologies:g,geographicallyRelevantAds:f,priv:u,hourOfDay:U,physicalCountry:t??"",physicalState:i??"",campaign:(0,m.getCampaign)()??void 0,tpcc:(0,m.getTpcc)(),linkReferral:(0,m.getLinkReferral)(),experimentJoinList:S,weatherMode:"normal",samsungVersion:(0,m.getSamsungVersion)(),appVersion:"df9905d9a7a026ac68fd6a79cf50e9e3300aff2b".slice(0,10)};try{(0,y.trackUserLoggedin)(M),h.info('Hightouch: Event "user-loggedin" tracked')}catch(e){h.error('Hightouch: Event "user-loggedin" failed',{error:e})}},[P,n,w,A,S,v,C])}])},576816,703123,e=>{"use strict";var t=e.i(247865),i=e.i(293163),r=e.i(947118),o=e.i(737801);e.s(["useSignupComplete",0,(e={})=>{let a=(0,r.useIsInitialized)(),n=(0,o.useEventAttributes)(),[s,l]=(0,t.useState)(!1),u=(0,t.useRef)(!1),c=(0,t.useMemo)(()=>{let t={...n,formVariant:e.formVariant,sensitiveDataAuthorization:e.sensitiveDataAuthorization,deviceTimeZone:e.deviceTimeZone,sourcePage:e.sourcePage,sourceModule:e.sourceModule,sourceElement:e.sourceElement,sourcePosition:e.sourcePosition,mParticleGranted:e.mParticleGranted??!0};return void 0!==e.url&&(t.url=e.url),void 0===t.formVariant&&delete t.formVariant,void 0===t.sensitiveDataAuthorization&&delete t.sensitiveDataAuthorization,void 0===t.deviceTimeZone&&delete t.deviceTimeZone,void 0===t.sourcePage&&delete t.sourcePage,void 0===t.sourceModule&&delete t.sourceModule,void 0===t.sourceElement&&delete t.sourceElement,void 0===t.sourcePosition&&delete t.sourcePosition,t},[n,e.formVariant,e.url,e.sensitiveDataAuthorization,e.deviceTimeZone,e.sourcePage,e.sourceModule,e.sourceElement,e.sourcePosition,e.mParticleGranted]);return(0,t.useEffect)(()=>{(0,i.areObjectValuesDefined)(c)&&!s&&l(!0)},[c,s]),(0,t.useCallback)(async()=>{if((a||window.mParticle?.isInitialized?.())&&s&&!u.current)try{window.mParticle?.logEvent?.("signup-complete",window.mParticle?.EventType?.Other,c),u.current=!0,console.debug(`MParticle: Event "signup-complete" tracked - ${c.pageId}`)}catch(e){console.error('MParticle: Event "signup-complete" failed',e)}},[a,c,s])}],576816);let a=(0,e.i(981030).atom)({});e.s(["gsiEmailStatesAtom",0,a],703123)},952582,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_SUBSCRIPTIONS=i.ON_YOUR_RADAR_GROUP=i.MARKETING_EMAILS_GROUP=i.WEEKLY_BRIEF_GROUP=i.DAILY_NEWSLETTERS_GROUP=void 0,i.DAILY_NEWSLETTERS_GROUP="daily-newsletters-1",i.WEEKLY_BRIEF_GROUP="weekly-brief",i.MARKETING_EMAILS_GROUP="marketing-emails-1",i.ON_YOUR_RADAR_GROUP="on-your-radar",i.DEFAULT_SUBSCRIPTIONS=[{subscriptionGroupName:i.DAILY_NEWSLETTERS_GROUP,subscriptionGroupId:"",isSubscribed:!1,attributes:{location:""}},{subscriptionGroupName:i.WEEKLY_BRIEF_GROUP,subscriptionGroupId:"",isSubscribed:!1},{subscriptionGroupName:i.MARKETING_EMAILS_GROUP,subscriptionGroupId:"",isSubscribed:!1},{subscriptionGroupName:i.ON_YOUR_RADAR_GROUP,subscriptionGroupId:"",isSubscribed:!1}]},370220,(e,t,i)=>{"use strict";e.i(288906),Object.defineProperty(i,"__esModule",{value:!0}),i.getEmailPreferencesStatusUrlConfig=function(){return{host:r,protocol:"https",pathname:"/api/v1/email-preferences/status"}},i.getEmailPreferencesSetUrlConfig=function(){return{host:r,protocol:"https",pathname:"/api/v1/email-preferences/set"}},i.getEmailPreferencesChangeEmailUrlConfig=function(){return{host:r,protocol:"https",pathname:"/api/v1/email-preferences/change-email"}};let r="weather.com"},454307,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.setEmailPreferences=n,i.updateSubscription=s;let r=e.r(678651),o=e.r(414655),a=e.r(370220);async function n(e){let t=(0,a.getEmailPreferencesSetUrlConfig)(),i=(0,r.urlFrom)(t),n=JSON.stringify(function(e){let{subscriptions:t,email:i,mParticleId:r}=e,o={};return t&&(o.subscriptions=t),i&&(o.email=i),r&&(o.mParticleId=r),o}(e)),s=await fetch(i,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:n});return 200===s.status||400===s.status?await s.json():(0,o.handleFetchResponse)(s)}async function s(e,t,i){return n({subscriptions:[{subscriptionGroupName:e,isSubscribed:t,...i&&{attributes:i}}]})}},451086,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getEmailPreferencesStatus=n;let r=e.r(678651),o=e.r(414655),a=e.r(370220);async function n(){let e=(0,a.getEmailPreferencesStatusUrlConfig)(),t=(0,r.urlFrom)(e),i=await fetch(t,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json"},next:{revalidate:60}});return(0,o.handleFetchResponse)(i)}},383216,(e,t,i)=>{"use strict";var r=e.i(288906);Object.defineProperty(i,"__esModule",{value:!0}),i.getSubscriptionHost=function(){return(0,o.resolveWxHost)(r.default.env.NEXT_PUBLIC_SUBSCRIPTION_WX_HOST||"weather.com")};let o=e.r(336410)},404893,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["googleLoginInitilizedAtom",0,t])},143851,e=>{"use strict";var t=e.i(546446),i=e.i(245943),r=e.i(45846),o=e.i(310847),a=e.i(776169),n=e.i(671525),s=e.i(652517),l=e.i(658547),u=e.i(18358),c=e.i(592188),d=e.i(539353),p=e.i(521350),g=e.i(529603),m=e.i(543512),f=e.i(160317),b=e.i(756227),y=e.i(553329),h=e.i(358273),w=e.i(459598),A=e.i(695881),S=e.i(735526);let v=(0,A.createLogger)("useUserLogin"),C=/^(?:\/[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,4})?)?\/subscribe\/checkout\/?$/;e.s(["useUserLogin",0,function(){let e=(0,t.useSetAtom)(o.userHasLoggedInBeforeAtom),A=(0,b.useResetAuthState)(),P=(0,t.useAtomValue)(o.wxuLoginRedirectPageAtom),I=(0,t.useAtomValue)(o.wxuUserAnonymousIdAtom),{syncPreferencesFromUpsx:E,updatePreferences:k}=(0,a.usePreferences)(),{navigate:O}=(0,n.default)(),{login:_}=(0,l.useUserIdentity)(),R=(0,u.useTrackEvent)(),T=(0,c.useUserLoggedIn)(),U=(0,d.useSignupComplete)({url:window.location.pathname}),D=e=>{(0,h.regenerateMetricsSession)(),(0,w.suppressNextPurchaseAbandon)(),(0,w.suppressNextHightouchPurchaseAbandon)();let t=new URLSearchParams(window.location.search).get("ref"),i=C.test(window.location.pathname)?`${window.location.pathname}${window.location.search}`:null,r=e??i??(t&&`https://${t}`)??P;r===i?(0,s.reloadPage)(()=>O(r)):O(r)},G=async(t,i=!0,o={})=>{A(),t?.type==="signup"&&(0,S.markAccountCreated)(),(0,p.isLocalStorageAvailable)()&&localStorage.setItem("PARTNERS_SYNC","true"),e(!0),await E()||await k({});let a=null;try{a=await r.upsxClient.purchase.getPurchaseToken()}catch(e){console.error("Failed to get UPSX token:",e)}if(t?.userID){let{error:e}=await (0,y.tryCatch)(_({email:t.email,customerid:t.userID,other:I}));e&&v.error("Failed to establish mParticle identity:",e);let i=a?.premium&&m.UserSubscriptionTiersMap[a.product]||m.UserSubscriptionTiers.standard;(0,g.setSignInTraits)({isLoggedIn:!0,isRegisteredUser:!0,upsxId:t.userID,registeredEmail:t.email,premium:m.UserSubscriptionPremiumTiers.includes(i),premiumProductTier:(0,f.getSubscriptionTierKey)(i)});let r="signup"===t.type,n=r&&o.skipSignupCompleteEvent;n||R(r?"signup-complete":"user-loggedin",{url:window.location.pathname}),r&&!n&&U(),r||T()}i&&D()};return{login:async(e,t)=>{try{let i=await r.upsxClient.auth.login({email:e,password:t});if(!i)return{success:!1,error:{}};return await G({email:i.email,userID:i.userID,type:"login"}),{success:!0}}catch(e){if(console.error("Failed to login",e),e instanceof i.APIError){let t=e.data;return{success:!1,error:{code:e.code,...t}}}return{success:!1,error:{}}}},authSuccess:G,authRedirect:D}}])},61284,e=>{"use strict";e.s(["PROMO_CHECKOUT_URL",0,"/subscribe/checkout?products=e251f39b-afd7-4ad9-9c87-5e2a8ed63fbb&promoCode=5OFF&tpcc=mktg-5OFF-reg"])},422825,e=>{"use strict";var t=e.i(546446),i=e.i(381477),r=e.i(899507),o=e.i(449928),a=e.i(760430);function n(e){if((0,o.isPrimitive)(e))return e;if(Array.isArray(e)||(0,a.isTypedArray)(e)||e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e),i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){let t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){let t=new i(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}return"u">typeof File&&e instanceof File?new i([e],e.name,{type:e.type,lastModified:e.lastModified}):"object"==typeof e?Object.assign(Object.create(t),e):e}var s=e.i(355200);function l(e){if(!e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function u(e,t,i){let r=Object.keys(t);for(let o=0;o"boolean"==typeof e?{isSubscribed:e}:e;e.s(["useEmailPreferences",0,({forceSubs:e,skipStatus:o}={})=>{let[a,s]=(0,t.useAtom)(p.emailPreferencesAtom),{user:h}=(0,g.useUser)(),w=(0,b.useSubscriptionsEnabled)()||e,A=h?.userID||null,S=(0,f.useCallback)(e=>{if(A){var t;let i,r;s({userId:A,expiry:Date.now()+9e5,subscriptions:(t=a?.subscriptions,i=t?.length?t:m.DEFAULT_SUBSCRIPTIONS,r={},e?(i?.forEach(e=>{r[e.subscriptionGroupName]=e}),e.forEach(e=>{let t=r[e.subscriptionGroupName]||{};r[e.subscriptionGroupName]=u(n(t),e,function e(t,i){if(Array.isArray(i))if(Array.isArray(t))return u(n(t),i,e);else return u([],i,e);if(l(i))if(l(t))return u(n(t),i,e);else return u({},i,e)})}),Object.values(r)):i)})}},[A,s,a?.subscriptions]),v=a&&a.userId===A&&a.expiry&&a.expiry>Date.now(),C=w&&A&&!v,{isLoading:P}=(0,i.default)(!o&&C?`getEmailPreferencesStatus/${A}`:void 0,d.getEmailPreferencesStatus,{shouldRetryOnError:e=>!(e instanceof Error&&/\(status 40[14]\)/.test(e.message)),revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,errorRetryCount:2,onSuccess:e=>{A&&e&&S(e.subscriptions)}}),I=(0,f.useCallback)(async e=>{if(!w)return{status:"error",error:"Subscription is not enabled!"};let t=await (0,c.setEmailPreferences)({subscriptions:e});return"success"===t.status&&S(e),t},[S,w,a?.subscriptions]),E=(0,f.useCallback)(async({newsletter:e,weekly:t,onYourRadar:i,marketing:o})=>{let a=[!(0,r.isNil)(e)&&{subscriptionGroupName:"daily-newsletters-1",...y(e)},!(0,r.isNil)(t)&&{subscriptionGroupName:"weekly-brief",...y(t)},!(0,r.isNil)(i)&&{subscriptionGroupName:"on-your-radar",...y(i)},!(0,r.isNil)(o)&&{subscriptionGroupName:"marketing-emails-1",...y(o)}].filter(Boolean);return await I(a)},[I]);return{emailSubscriptions:v?a.subscriptions:null,updateEmailSubscriptions:E,updateEmailPreference:I,isLoadingPreferences:P}}],422825)}]);