(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,185945,e=>{"use strict";var t=e.i(288906),r=e.i(247865),i=e.i(725287);function n(){return false}function a(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function s(e){(0,r.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.si)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);let i=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(i.current)e.route&&i.current(e.route);else{let r=function(e={}){var t;if(!("u">typeof window)||null===e.route)return null;window.si||(window.si=function(...e){(window.siq=window.siq||[]).push(e)});let r=e.scriptSrc?e.scriptSrc:n()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?`${e.basePath}/speed-insights/script.js`:"/_vercel/speed-insights/script.js";if(document.head.querySelector(`script[src*="${r}"]`))return null;e.beforeSend&&(null==(t=window.si)||t.call(window,"beforeSend",e.beforeSend));let i=document.createElement("script");return i.src=r,i.defer=!0,i.dataset.sdkn="@vercel/speed-insights"+(e.framework?`/${e.framework}`:""),i.dataset.sdkv="1.3.1",e.sampleRate&&(i.dataset.sampleRate=e.sampleRate.toString()),e.route&&(i.dataset.route=e.route),e.endpoint?i.dataset.endpoint=e.endpoint:e.basePath&&(i.dataset.endpoint=`${e.basePath}/speed-insights/vitals`),e.dsn&&(i.dataset.dsn=e.dsn),n()&&!1===e.debug&&(i.dataset.debug="false"),i.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(i),{setRoute:e=>{i.dataset.route=e??void 0}}}({framework:e.framework??"react",basePath:e.basePath??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...e});r&&(i.current=r.setRoute)}},[e.route]),null}function o(e){let n=(()=>{let e=(0,i.useParams)(),t=(0,i.useSearchParams)()||new URLSearchParams,r=(0,i.usePathname)();if(!e)return null;let n=Object.keys(e).length?e:Object.fromEntries(t.entries());if(!r||!n)return r;let s=r;try{let e=Object.entries(n);for(let[t,r]of e)if(!Array.isArray(r)){let e=a(r);e.test(s)&&(s=s.replace(e,`/[${t}]`))}for(let[t,r]of e)if(Array.isArray(r)){let e=a(r.join("/"));e.test(s)&&(s=s.replace(e,`/[...${t}]`))}return s}catch(e){return r}})();return r.default.createElement(s,{route:n,...e,framework:"next",basePath:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}()})}e.s(["SpeedInsights",0,function(e){return r.default.createElement(r.Suspense,{fallback:null},r.default.createElement(o,{...e}))}])},538946,e=>{"use strict";var t,r=e.i(288906),i={scriptHostname:("u">typeof r.default?r.default.env.NEXT_PUBLIC_VERCEL_TOOLBAR_HOST:void 0)??"https://vercel.live",ownerId:"u">typeof r.default?r.default.env.NEXT_PUBLIC_VERCEL_TOOLBAR_OWNER_ID:void 0,projectId:"u">typeof r.default?r.default.env.NEXT_PUBLIC_VERCEL_TOOLBAR_PROJECT_ID:void 0,branch:"u">typeof r.default?r.default.env.NEXT_PUBLIC_VERCEL_TOOLBAR_BRANCH:void 0,deploymentId:"u">typeof r.default?"dpl_BRKj4RXio2sKpS2NFka5yvErTCBz":void 0},n=e.i(247865),a=!1;e.s(["UnmountController",0,function({shouldMount:e,nonce:r}){return(0,n.useEffect)(()=>(e&&a&&function(e={}){if(typeof window>"u"||null===document.querySelector("vercel-live-feedback")){Object.assign(i,e);let r=document.createElement("script");for(let[n,a]of(r.src=`${i.scriptHostname}/_next-live/feedback/feedback.js`,r.setAttribute("data-explicit-opt-in","true"),e.nonce&&r.setAttribute("nonce",e.nonce),Object.entries((i.ownerId&&i.projectId?{"data-owner-id":i.ownerId,"data-project-id":i.projectId,"data-branch":t??i.branch}:i.deploymentId?{"data-deployment-id":i.deploymentId}:void 0)??{})))a&&r.setAttribute(n,a);(document.head||document.documentElement).appendChild(r)}}({nonce:r}),a=!0,()=>{(typeof window>"u"?void 0:window.__vercel_toolbar)?.unmount()}),[]),null}],538946)},147732,e=>{"use strict";e.s(["debounce",0,function(e,t,{signal:r,edges:i}={}){let n,a=null,s=null!=i&&i.includes("leading"),o=null==i||i.includes("trailing"),l=()=>{null!==a&&(e.apply(n,a),n=void 0,a=null)},u=null,c=()=>{null!=u&&clearTimeout(u),u=setTimeout(()=>{u=null,o&&l(),d()},t)},d=()=>{null!==u&&(clearTimeout(u),u=null),n=void 0,a=null},p=function(...e){if(r?.aborted)return;n=this,a=e;let t=null==u;c(),s&&t&&l()};return p.schedule=c,p.cancel=d,p.flush=()=>{l()},r?.addEventListener("abort",d,{once:!0}),p}])},232598,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i={callServer:function(){return a.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var n in i)Object.defineProperty(r,n,{enumerable:!0,get:i[n]});let a=e.r(276247),s=e.r(788443),o=e.r(955011)},866137,723469,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["adBlockAtom",0,t],866137);var r=e.i(247865),i=e.i(725287),n=e.i(546446),a=e.i(540768),s=e.i(682142),o=e.i(782937),l=e.i(695881),u=e.i(333350),c=e.i(64412),d=e.i(950771),p=e.i(537989),f=e.i(695203),m=e.i(158662),g=e.i(358273),A=e.i(122124),S=e.i(777638),w=e.i(924776),C=e.i(409628),h=e.i(605781);let v=(0,l.createLogger)("useTrackString");e.s(["useTrackString",0,()=>{let e=(0,n.useAtomValue)(p.pageIdAtom),t=(0,n.useAtomValue)(d.pageLocaleAtom),l=(0,n.useAtomValue)(f.deviceClassAtom),E=(0,n.useAtomValue)(m.experimentJoinListAtom),b=(0,i.usePathname)(),{location:y}=(0,c.useLocation)(),_=(0,w.useIsHightouchReady)(),I=(0,r.useCallback)(r=>{let i=(0,s.getCICookie)(),n=i?.["TWC-GeoIP-Country"]??(0,a.getCookie)("twc-location-country"),u=i?.["TWC-GeoIP-Region"]??(0,a.getCookie)("twc-location-region"),c=i?.["TWC-Privacy"]??(0,a.getCookie)("twc-privacy"),d=window.DprSdk?.getGdprConsentOptInsString()??"",p=window.DprSdk?.getCcpaSaleOptInString()??"",f=window.navigator?.globalPrivacyControl??!1,m=d?.includes("functional-technology")??!1,w=window.DprSdk?.getUserConsent("geographically-relevant-advertising")!==!1,h=window.DprSdk?.getUserConsent("interest-based-ads")!==!1,v=String(window.DprSdk?.getUserConsent("sale-of-data")!==!1),_=String(window.DprSdk?.getUserConsent("sensitive-data")!==!1),I=navigator?.cookieEnabled??!1,P=(0,a.getCookie)("partner")||"",k=(0,o.getPartnerByPattern)(P)??P,T=(0,g.getMetricsSession)(),R=T?.sessionId||"",O=new Date(T?.sessionStartTime||0).toISOString(),L=new Date,U=L.getHours(),D=C.WEEK_DAYS[L.getDay()]??"",N="article"===e||"video"===e?(0,A.stripLastPartOfSlug)(b??""):(0,A.getAnonymizedPath)(b??"");return{trackString:r,pageId:e??"",schemaVersion:"nextgen",url:N,referrer:document.referrer,locale:t,deviceClass:l,partner:k,sessionId:R,sessionStartTime:O,siteMode:"normal",dayOfWeek:D,hourOfDay:U,regime:c??"",cookiesEnabled:I,gpcSignalOptOut:f,functionalTechnologies:m,geographicallyRelevantAds:w,interestBasedAds:h,priv:d,privProducts:p,saleOfData:v,saleOfDataAuthorization:v,sensitiveDataAuthorization:_,campaign:(0,S.getCampaign)(),experimentJoinList:E,weatherMode:"normal",physicalCountry:n??"",physicalState:u??"",wlocCity:y?.city??null,wlocCountry:y?.countryCode??null,wlocState:y?.adminDistrictCode??null,wlocDMA:y?.dmaCd??null,samsungVersion:(0,S.getSamsungVersion)(),appVersion:"b1f2a8b9d69b0e3e05fe6d294ee6a35cce1a3921".slice(0,10)}},[e,t,l,E,b,y]);return(0,r.useCallback)(e=>{if(u.default&&e){if(!_)return void v.warn('Hightouch: Event "track-string" skipped - SDK not ready');try{(0,h.trackTrackString)(I(e)),v.info('Hightouch: Event "track-string" tracked',{trackString:e})}catch(e){v.error('Hightouch: Event "track-string" failed',{error:e})}}},[_,I])}],723469)},800462,50727,e=>{"use strict";var t=e.i(284007);let r=(0,t.atomWithStorage)("wx-from-search-result",null);e.s(["fromSearchResultAtom",0,r],800462);let i=(0,t.atomWithStorage)("wx-ht-from-search-result",null);e.s(["fromSearchResultAtom",0,i],50727)},128541,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),i=(0,t.atomWithStorage)("wx-purchase-source-attribution",null,r);e.s(["purchaseSourceAttributionAtom",0,i])},647292,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["webViewPlatformAtom",0,t])},320209,e=>{"use strict";e.i(288906);var t=e.i(247865),r=e.i(725287),i=e.i(546446),n=e.i(540768),a=e.i(682142),s=e.i(782937),o=e.i(695881),l=e.i(333350),u=e.i(64412),c=e.i(950771),d=e.i(537989),p=e.i(695203),f=e.i(158662),m=e.i(358273),g=e.i(122124),A=e.i(777638),S=e.i(924776),w=e.i(409628),C=e.i(605781);let h=(0,o.createLogger)("useTrackAssetViewed"),v=[],E=null;function b(e){try{(0,C.trackAssetViewed)(e),h.info(`Hightouch: Event "asset-viewed" tracked - ${e.contentId}`)}catch(e){h.error('Hightouch: Event "asset-viewed" failed',e)}}e.s(["trackHightouchAssetViewed",0,function(e){try{E?.(e)}catch(e){h.error('Hightouch: Event "asset-viewed" failed',e)}},"useRegisterAssetViewedTracker",0,()=>{let e=(()=>{let e=(0,r.usePathname)(),o=(0,i.useAtomValue)(d.pageIdAtom),C=(0,i.useAtomValue)(c.pageLocaleAtom),h=(0,i.useAtomValue)(p.deviceClassAtom),E=(0,i.useAtomValue)(f.experimentJoinListAtom),{location:y}=(0,u.useLocation)(),_=(0,S.useIsHightouchReady)(),I=(0,t.useCallback)(({moduleId:t,contentId:r,assetMediaType:i,title:l,pos:u,tagsKeyword:c})=>{let d=(0,a.getCICookie)(),p=d?.["TWC-GeoIP-Country"]??(0,n.getCookie)("twc-location-country"),f=d?.["TWC-GeoIP-Region"]??(0,n.getCookie)("twc-location-region"),S=d?.["TWC-Privacy"]??(0,n.getCookie)("twc-privacy"),v=window.DprSdk?.getGdprConsentOptInsString()??"",b=window.DprSdk?.getCcpaSaleOptInString()??"",_=window.navigator?.globalPrivacyControl??!1,I=v?.includes("functional-technology")??!1,P=window.DprSdk?.getUserConsent("geographically-relevant-advertising")!==!1,k=window.DprSdk?.getUserConsent("interest-based-ads")!==!1,T=navigator?.cookieEnabled??!1,R=(0,n.getCookie)("partner")||"",O=(0,s.getPartnerByPattern)(R)??R,L=(0,m.getMetricsSession)(),U=L?.sessionId||"",D=new Date(L?.sessionStartTime||0).toISOString(),N=new Date,M=N.getHours(),V=w.WEEK_DAYS[N.getDay()]??"",x="article"===o||"video"===o?(0,g.stripLastPartOfSlug)(e??""):(0,g.getAnonymizedPath)(e??"");return{moduleId:t,contentId:r,assetMediaType:i,title:l,pos:String(u),tagsKeyword:c??null,pageId:o??"",url:x,referrer:document.referrer,locale:C,deviceClass:h,partner:O,sessionId:U,sessionStartTime:D,siteMode:"normal",dayOfWeek:V,hourOfDay:M,regime:S??"",cookiesEnabled:T,gpcSignalOptOut:_,functionalTechnologies:I,geographicallyRelevantAds:P,interestBasedAds:k,priv:v,privProducts:b,campaign:(0,A.getCampaign)(),experimentJoinList:E,weatherMode:"normal",physicalCountry:p??"",physicalState:f??"",wlocCity:y?.city??null,wlocCountry:y?.countryCode??null,wlocState:y?.adminDistrictCode??null,wlocDMA:y?.dmaCd??null,samsungVersion:(0,A.getSamsungVersion)(),appVersion:"b1f2a8b9d69b0e3e05fe6d294ee6a35cce1a3921".slice(0,10)}},[e,o,C,h,E,y]);return(0,t.useEffect)(()=>{if(!_||0===v.length)return;let e=v;v=[],e.forEach(b)},[_]),(0,t.useCallback)(e=>{if(!l.default)return;let t=I(e);_?b(t):v.push(t)},[_,I])})();(0,t.useEffect)(()=>(E=e,()=>{E===e&&(E=null)}),[e])}])},915044,e=>{"use strict";e.i(288906);var t=e.i(247865),r=e.i(947118),i=e.i(546446),n=e.i(293163),a=e.i(160317),s=e.i(382602),o=e.i(540768),l=e.i(310847),u=e.i(333350),c=e.i(528600);e.s(["useUserAttributes",0,()=>{let e=(0,r.useIsInitialized)(),{user:{isUserLoggedIn:d,isUserPremium:p,subscriptionTier:f}}=(0,c.useUser)(),[m,g]=(0,t.useState)(!1),[A,S]=(0,t.useState)(!1),w=p??!1,C=(0,a.getSubscriptionTierKey)(f),h=(0,i.useAtomValue)(s.userFirstNameAtom),v=(0,i.useAtomValue)(s.userGenderAtom),E=(0,i.useAtomValue)(l.wxuUserAnonymousIdAtom),b=(0,i.useAtomValue)(l.userHasLoggedInBeforeAtom),y=u.default?window?.DprSdk?.getUserConsent("sale-of-data")!==!1:void 0,_=u.default?window?.DprSdk?.getUserConsent("sensitive-data")!==!1:void 0,I=(0,o.getCookie)("subscription")??"",{productID:P=null,expirationDateTime:k=null,transactionDateTime:T=null,firstTransactionDateTime:R=null,autoRenew:O=null,price:L=null,productName:U=null}=(0,n.jwtDecoder)(I)||{},D=(0,t.useMemo)(()=>({premium:w,premiumProductTier:C,premiumExpiration:k,premiumStart:T,premiumFirstTransactionDate:R,premiumProductId:P,premiumProductAutoRenew:O,premiumPrice:L,premiumProductName:U,isRegisteredUser:d||b||!1,isLoggedIn:d,"Amplitude.device_id":E,$Gender:v,$FirstName:h,saleOfDataAuthorization:y,sensitiveDataAuthorization:_,devUser:!1}),[w,C,k,T,R,P,O,L,U,E,d,b,h,v,y,_]);(0,t.useEffect)(()=>{(0,n.areObjectValuesDefined)(D)&&!m&&g(!0)},[D,m]);let N=(0,t.useCallback)(()=>{for(let e in D)void 0===D[e]&&delete D[e];if(e&&m&&!A){let e=window.mParticle?.Identity?.getCurrentUser?.();if(!e)return void console.warn("MParticle: No current user");e.setUserAttributes(D),S(!0),console.debug("MParticle: User attributes set - ",D)}},[e,D,m,A]);return{userAttributes:D,setUserAttribute:(0,t.useCallback)((t,r)=>{if(!e)return void console.warn("MParticle is not initialized");let i=window.mParticle?.Identity?.getCurrentUser?.();i?(i.setUserAttribute(t,r),console.debug(`MParticle: User attribute set - ${t}`)):console.warn("MParticle: No current user")},[e]),setUserAttributes:N,removeUserAttribute:(0,t.useCallback)(t=>{if(!e)return void console.warn("MParticle is not initialized");let r=window.mParticle?.Identity?.getCurrentUser?.();r?(r.removeUserAttribute(t),console.debug(`MParticle: User attribute removed - ${t}`)):console.warn("MParticle: No current user")},[e])}}])},491240,e=>{"use strict";let t=(0,e.i(695881).createLogger)("MParticleIdentity");e.s(["truncateIdentityValue",0,e=>"string"==typeof e&&e.length>256?(t.warn(`identity value exceeded 256 chars (${e.length}); truncating`),e.slice(0,256)):e])},456215,e=>{"use strict";e.s(["isSnowCastWebView",0,function(e){return"snowcast"===e||e.startsWith("snowcast-")},"isWebViewIos",0,function(e){return"ios"===e||e.endsWith("-ios")}])},313983,e=>{"use strict";var t,r=((t={}).ESSENTIAL_TECHNOLOGY="essential-technology",t.FUNCTIONAL_TECHNOLOGY="functional-technology",t.GEOGRAPHICALLY_RELEVANT_ADVERTISING="geographically-relevant-advertising",t.INTERNATIONAL_TRANSFER="international-transfer",t.SALE_OF_DATA="sale-of-data",t.SENSITIVE_DATA="sensitive-data",t.SELECT_PERSONALISED_CONTENT="Select personalised content",t.SELECT_PERSONALISED_ADS="Select personalised ads",t.SELECT_BASIC_ADS="Select basic ads",t.CREATE_A_PERSONALISED_ADS_PROFILE="Create a personalised ads profile",t.CREATE_A_PERSONALISED_CONTENT_PROFILE="Create a personalised content profile",t.MEASURE_AD_PERFORMANCE="Measure ad performance",t.APPLY_MARKET_RESEARCH_TO_GENERATE_AUDIENCE_INSIGHTS="Apply market research to generate audience insights",t.DEVELOP_AND_IMPROVE_PRODUCTS="Develop and improve products",t.STORE_AND_OR_ACCESS_INFORMATION_ON_A_DEVICE="Store and/or access information on a device",t.MEASURE_CONTENT_PERFORMANCE="Measure content performance",t);e.s(["Purpose",()=>r])},725296,e=>{"use strict";var t,r=e.i(965586),i=((t={}).CA="ca",t.CA_QC="ca-qc",t.EXEMPT="exempt",t.GDPR="gdpr",t.JP="jp",t.KR="kr",t.LATAM_CO="latam-co",t.LATAM_DO="latam-do",t.LATAM_PE="latam-pe",t.LGPD="lgpd",t.PIPL="pipl",t.TR_KVKK="tr-kvkk",t.USA="usa",t.USA_CCPA="usa-ccpa",t.USA_CO="usa-co",t.USA_CT="usa-ct",t.USA_VA="usa-va",t);Object.values(i);let n={"usa-ut":"usa"},a=e=>e?n[e]??e:void 0;e.s(["RESTRICTIVE_REGIMES",0,["ca-qc","gdpr","latam-co","latam-do","latam-pe","lgpd","pipl","tr-kvkk"],"Regime",()=>i,"US_REGIMES",0,["usa","usa-ccpa","usa-co","usa-ct","usa-va"],"default",0,i,"getRegime",0,()=>(()=>{let e=(0,r.getCookie)("ci")?.toString();if(e)for(let t of e.split("&")){let e=t.indexOf("=");if(e>-1&&"TWC-Privacy"===t.slice(0,e))return a(t.slice(e+1))}})()??a((0,r.getCookie)("twc-privacy")?.toString())??"exempt"])},7150,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["pushlyPromptSuppressedAtom",0,t])},45846,e=>{"use strict";e.i(288906);let t=new(e.i(245943)).UPSXClient({baseUrl:"https://upsx.weather.com"});e.s(["upsxClient",0,t])},378869,e=>{"use strict";let t=(0,e.i(284007).atomWithStorage)("wxu-web/keyval:emailSubscriptions",null,void 0,{getOnInit:!0});e.s(["emailPreferencesAtom",0,t])},382602,e=>{"use strict";var t=e.i(981030),r=e.i(889753);let i=(0,t.atom)(e=>e(r.userProfileAtom)?.email),n=(0,t.atom)(e=>e(r.userProfileAtom)?.firstName),a=(0,t.atom)(e=>e(r.userProfileAtom)?.gender);(0,t.atom)(e=>e(r.userProfileAtom)?.emailVerified),e.s(["userEmailAtom",0,i,"userFirstNameAtom",0,n,"userGenderAtom",0,a])},249725,e=>{"use strict";var t=e.i(546446),r=e.i(247865),i=e.i(726249),n=e.i(310847);let a=Object.freeze({});function s(){let e=(0,t.useSetAtom)(n.wxuUserLocationFeatureIdsAtom);return(0,r.useCallback)((t,r)=>{let n=[];t.placeId&&n.push(t.placeId),t.geocode&&!r?.startsWith("address.")&&n.push((0,i.formatGeocode)(t.geocode)),0!==n.length&&e(e=>{let t=e??{};if(!n.some(e=>!(e in t)||t[e]!==r))return t;let i={...t};for(let e of n)i[e]=r;return i})},[e])}e.s(["useLocationFeatureIds",0,function(){let e=(0,t.useAtomValue)(n.wxuUserLocationFeatureIdsAtom)??a,o=(0,r.useCallback)(t=>{if(t.placeId){let r=e[t.placeId];if(r)return r}if(t.geocode){let r=e[(0,i.formatGeocode)(t.geocode)];if(r)return r}},[e]),l=(0,r.useCallback)(t=>t in e,[e]);return{featureIds:e,resolveFeatureId:o,hasResolvedPlaceId:l,recordFeatureId:s()}},"useRecordFeatureId",0,s])},776169,809991,e=>{"use strict";var t=e.i(546446),r=e.i(889753),i=e.i(301904),n=e.i(901351),a=e.i(310847),s=e.i(528600),o=e.i(617874),l=e.i(540768),u=e.i(553329),c=e.i(247865),d=e.i(245943);let p=(0,e.i(695881).createLogger)("useMapSettings");e.s(["WEB_MAP_SETTINGS_PLATFORM",0,"twc","useMapSettings",0,function(e="twc"){let{user:{isUserLoggedIn:t}}=(0,s.useUser)();return{saveMapSettings:(0,c.useCallback)(async r=>{if(!t)return!1;let{error:i}=await (0,u.tryCatch)(n.upsxClient.preference.updateMapSettings(e,r));if(!i)return!0;if(i instanceof d.APIError&&404===i.code){let{error:t}=await (0,u.tryCatch)(n.upsxClient.preference.createMapSettings(e,r));return!t||(p.warn("Failed to create map settings",t),!1)}return p.warn("Failed to update map settings",i),!1},[t,e])}}],809991),e.s(["usePreferences",0,function(){let{user:{isUserLoggedIn:e}}=(0,s.useUser)(),[c,d]=(0,t.useAtom)(r.userPreferencesAtom),[p,f]=(0,t.useAtom)(a.wxuUserPreferenceAtom),m=async()=>{let{data:e,error:t}=await (0,u.tryCatch)(n.upsxClient.preference.getMapSettings("twc"));if(t||!e)return null;let{animationSpeed:r,autoplay:i,opacity:a,roadOverlay:s,style:o}=e,l={...void 0!==r&&{animationSpeed:r},...void 0!==i&&{autoplay:i},...void 0!==a&&{opacity:a},...void 0!==s&&{roadOverlay:s},...void 0!==o&&{style:o}};return Object.keys(l).length>0?l:null},g=async e=>{try{await n.upsxClient.preference.updatePreference(e)}catch(e){return console.error("Failed to sync preferences with server:",e),null}},A=async(t,r=!0)=>{try{let i,n=(i={...c,...t},d(i),f({...p,...t,locations:i.locations}),i);if(t?.unit){let e=(0,o.unitsSystemByName)(t.unit),r=e?.code||"e";(0,l.setCookie)(o.UNITS_COOKIE_KEY,r,{domain:"weather.com"})}return r&&e&&await g(n),{success:!0}}catch(e){return console.error("Failed to update preferences:",e),{success:!1,error:e instanceof Error?e.message:"Failed to update preferences"}}};return{syncPreferencesFromUpsx:async()=>{try{let[e,t]=await Promise.all([n.upsxClient.preference.getPreference(),m()]);if(!e?.userID)return null;let{mapSettings:r,...a}=e,s={...a,mapSettings:{...i.DEFAULT_MAP_SETTINGS,...t}};return A(s,!1),s}catch{return null}},updatePreferences:A}}],776169)},145651,579310,e=>{"use strict";var t=e.i(546446),r=e.i(776169),i=e.i(981030),n=e.i(889753);let a=(0,e.i(174960).focusAtom)(n.userPreferencesAtom,e=>e.prop("locations")),s=(0,i.atom)(e=>e(n.userPreferencesAtom)?.locations||[]);(0,i.atom)(e=>{let t=e(s);return t?.find(e=>0===e.position)||t?.[0]||null}),(0,i.atom)(e=>(e(s)?.length||0)>0),e.s(["userLocationsAtom",0,a,"userLocationsGetAtom",0,s],579310);var o=e.i(310847),l=e.i(247865);let u=Object.freeze([]),c=Object.freeze([]);e.s(["default",0,()=>{let{updatePreferences:e}=(0,r.usePreferences)(),i=(0,t.useAtomValue)(a),n=(0,l.useMemo)(()=>i?[...i].sort((e,t)=>e.position-t.position):u,[i]),[s,d]=(0,t.useAtom)(o.wxuUserRecentLocationsAtom),[,p]=(0,t.useAtom)(o.wxuUserRecentAddressesAtom),f=(0,l.useCallback)(t=>{let r={...t,position:Math.max(...n.map(e=>e.position),0)+1};e({locations:[...n,r]})},[n,e]),m=(0,l.useCallback)(t=>{e({locations:n.filter(e=>e.placeID!==t)})},[n,e]),g=(0,l.useCallback)(e=>{d(t=>[e,...(t||[]).filter(t=>t!==e)].slice(0,5))},[d]),A=(0,l.useCallback)(e=>{d(t=>(t||[]).filter(t=>t!==e))},[d]),S=(0,l.useCallback)(()=>{d([])},[d]),w=(0,l.useCallback)(e=>{p(t=>(t||[]).filter(t=>t.placeId!==e))},[p]),C=(0,l.useCallback)(e=>{m(e),A(e),w(e)},[m,A,w]);return{addFavoriteLocation:f,removeFavoriteLocation:m,addRecentLocation:g,removeRecentLocation:A,removeRecentAddress:w,clearRecentLocations:S,deleteLocation:C,recentLocations:s||c,favoriteLocations:n}}],145651)},160317,e=>{"use strict";var t=e.i(543512);e.s(["getSubscriptionTierKey",0,function(e){return t.UserSubscriptionTierKeysMap[e]??t.UserSubscriptionTierKeysMap[t.UserSubscriptionTiers.none]}])},892504,e=>{"use strict";let t="upsx-purchase-checked-at";e.s(["clearPurchaseChecked",0,()=>{try{localStorage.removeItem(t)}catch{}},"markPurchaseChecked",0,()=>{try{localStorage.setItem(t,String(Date.now()))}catch{}},"purchaseCheckedRecently",0,()=>{try{let e=localStorage.getItem(t);if(!e)return!1;let r=Number(e);if(!Number.isFinite(r))return!1;return Date.now()-r{"use strict";e.s(["hasLength",0,e=>Array.isArray(e)&&e.length>0])}]);