(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,553329,e=>{"use strict";async function t(e){try{return{data:await e,error:null}}catch(e){return{data:null,error:e}}}e.s(["tryCatch",0,t])},776169,809991,e=>{"use strict";var t=e.i(546446),r=e.i(889753),n=e.i(301904),i=e.i(901351),a=e.i(310847),s=e.i(528600),o=e.i(617874),u=e.i(858040),l=e.i(553329),c=e.i(592121),d=e.i(245943);let f=(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:n}=await (0,l.tryCatch)(i.upsxClient.preference.updateMapSettings(e,r));if(!n)return!0;if(n instanceof d.APIError&&404===n.code){let{error:t}=await (0,l.tryCatch)(i.upsxClient.preference.createMapSettings(e,r));return!t||(f.warn("Failed to create map settings",t),!1)}return f.warn("Failed to update map settings",n),!1},[t,e])}}],809991),e.s(["usePreferences",0,function(){let{user:{isUserLoggedIn:e}}=(0,s.useUser)(),[c,d]=(0,t.useAtom)(r.userPreferencesAtom),[f,p]=(0,t.useAtom)(a.wxuUserPreferenceAtom),m=async()=>{let{data:e,error:t}=await (0,l.tryCatch)(i.upsxClient.preference.getMapSettings("twc"));if(t||!e)return null;let{animationSpeed:r,autoplay:n,opacity:a,roadOverlay:s,style:o}=e,u={...void 0!==r&&{animationSpeed:r},...void 0!==n&&{autoplay:n},...void 0!==a&&{opacity:a},...void 0!==s&&{roadOverlay:s},...void 0!==o&&{style:o}};return Object.keys(u).length>0?u:null},g=async e=>{try{await i.upsxClient.preference.updatePreference(e)}catch(e){return console.error("Failed to sync preferences with server:",e),null}},y=async(t,r=!0)=>{try{let n,i=(n={...c,...t},d(n),p({...f,...t,locations:n.locations}),n);if(t?.unit){let e=(0,o.unitsSystemByName)(t.unit),r=e?.code||"e";(0,u.setCookie)(o.UNITS_COOKIE_KEY,r,{domain:"weather.com"})}return r&&e&&await g(i),{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([i.upsxClient.preference.getPreference(),m()]);if(!e?.userID)return null;let{mapSettings:r,...a}=e,s={...a,mapSettings:{...n.DEFAULT_MAP_SETTINGS,...t}};return y(s,!1),s}catch{return null}},updatePreferences:y}}],776169)},491045,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),n=(0,t.atomWithStorage)("wx-purchase-source-attribution",null,r);e.s(["purchaseSourceAttributionAtom",0,n])},418982,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={cancelIdleCallback:function(){return s},requestIdleCallback:function(){return a}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a="u">typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},s="u">typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},238163,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ESCAPE_REGEX:function(){return s},htmlEscapeAttributeString:function(){return c},htmlEscapeJsonString:function(){return l}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a={"&":"\\u0026",">":"\\u003e","":">"},u=/[&"']/g;function l(e){return e.replace(s,e=>a[e])}function c(e){return e.replace(u,e=>o[e])}},16129,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return E},handleClientScriptLoad:function(){return x},initScriptLoader:function(){return v}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(481258),s=e.r(744066),o=e.r(699173),u=a._(e.r(798973)),l=s._(e.r(592121)),c=e.r(205751),d=e.r(505171),f=e.r(418982),p=e.r(238163),m=new Map,g=new Set,y=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:i=null,dangerouslySetInnerHTML:a,children:s="",strategy:o="afterInteractive",onError:l,stylesheets:c}=e,f=r||t;if(f&&g.has(f))return;if(m.has(t)){g.add(f),m.get(t).then(n,l);return}let p=()=>{i&&i(),g.add(f)},y=document.createElement("script"),x=new Promise((e,t)=>{y.addEventListener("load",function(t){e(),n&&n.call(this,t),p()}),y.addEventListener("error",function(e){t(e)})}).catch(function(e){l&&l(e)});a?(y.innerHTML=a.__html||"",p()):s?(y.textContent="string"==typeof s?s:Array.isArray(s)?s.join(""):"",p()):t&&(y.src=t,m.set(t,x)),(0,d.setAttributesFromProps)(y,e),"worker"===o&&y.setAttribute("type","text/partytown"),y.setAttribute("data-nscript",o),c&&(e=>{if(u.default.preinit)return e.forEach(e=>{u.default.preinit(e,{as:"style"})});if("u">typeof window){let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(c),document.body.appendChild(y)};function x(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,f.requestIdleCallback)(()=>y(e))}):y(e)}function v(e){e.forEach(x),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");g.add(t)})}function h(e){let{id:t,src:r="",onLoad:n=()=>{},onReady:i=null,strategy:a="afterInteractive",onError:s,stylesheets:d,...m}=e,{updateScripts:x,scripts:v,getIsSsr:h,appDir:E,nonce:w}=(0,l.useContext)(c.HeadManagerContext);w=m.nonce||w;let S=(0,l.useRef)(!1);(0,l.useEffect)(()=>{let e=t||r;S.current||(i&&e&&g.has(e)&&i(),S.current=!0)},[i,t,r]);let _=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!_.current){if("afterInteractive"===a)y(e);else"lazyOnload"===a&&("complete"===document.readyState?(0,f.requestIdleCallback)(()=>y(e)):window.addEventListener("load",()=>{(0,f.requestIdleCallback)(()=>y(e))}));_.current=!0}},[e,a]),("beforeInteractive"===a||"worker"===a)&&(x?(v[a]=(v[a]||[]).concat([{id:t,src:r,onLoad:n,onReady:i,onError:s,...m,nonce:w}]),x(v)):h&&h()?g.add(t||r):h&&!h()&&y({...e,nonce:w})),E){if(d&&d.forEach(e=>{u.default.preinit(e,{as:"style"})}),"beforeInteractive"===a)if(!r)return m.dangerouslySetInnerHTML&&(m.children=m.dangerouslySetInnerHTML.__html,delete m.dangerouslySetInnerHTML),(0,o.jsx)("script",{nonce:w,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([0,{...m,id:t}]))})`}});else return u.default.preload(r,m.integrity?{as:"script",integrity:m.integrity,nonce:w,crossOrigin:m.crossOrigin}:{as:"script",nonce:w,crossOrigin:m.crossOrigin}),(0,o.jsx)("script",{nonce:w,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([r,{...m,id:t}]))})`}});"afterInteractive"===a&&r&&u.default.preload(r,m.integrity?{as:"script",integrity:m.integrity,nonce:w,crossOrigin:m.crossOrigin}:{as:"script",nonce:w,crossOrigin:m.crossOrigin})}return null}Object.defineProperty(h,"__nextScript",{value:!0});let E=h;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},185312,(e,t,r)=>{t.exports=e.r(16129)},318849,e=>{"use strict";let t=!1,r="upsx-recent-purchase-at";e.s(["SWR_CACHE_LEGACY_STORAGE_KEY",0,"app-cache","SWR_CACHE_STORAGE_KEY",0,"wxu-swr-cache-v1","disableSwrPersist",0,()=>{t=!0},"hasRecentPurchase",0,e=>{try{let t=localStorage.getItem(r);if(!t)return!1;let n=Number(t);if(!Number.isFinite(n))return!1;return Date.now()-nt,"markRecentPurchase",0,()=>{try{localStorage.setItem(r,String(Date.now()))}catch{}}])},45846,e=>{"use strict";let t=new(e.i(245943)).UPSXClient({baseUrl:"https://upsx.weather.com"});e.s(["upsxClient",0,t])},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])},806262,e=>{"use strict";e.i(592121);var t=e.i(546446);e.i(284007),e.i(981030);let r=new WeakMap;e.s(["useHydrateAtoms",0,function(e,n){var i;let a,s=(0,t.useStore)(n),o=(i=s,(a=r.get(i))||(a=new WeakSet,r.set(i,a)),a);for(let[t,...r]of e)(!o.has(t)||(null==n?void 0:n.dangerouslyForceHydrate))&&(o.add(t),s.set(t,...r))}])},604323,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["metricsArticleDataAtom",0,t])},513539,e=>{"use strict";var t=e.i(981030);let r=(0,t.atom)(null),n=(0,t.atom)(null);e.s(["activeEventAtom",0,n,"layoutStateAtom",0,r])},797770,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["adsMetricsUnitAndZoneAtom",0,t])},991511,e=>{"use strict";var t=e.i(592121),r=e.i(806262),n=e.i(546446);e.s(["useRehydrateAtoms",0,e=>{(0,r.useHydrateAtoms)(e);let i=(0,n.useStore)(),a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{for(let[e,t]of a.current)i.get(e)!==t&&i.set(e,t)})}])},688070,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["isWebViewOnlyAtom",0,t])},328343,562209,e=>{"use strict";var t=e.i(592121),r=e.i(546446),n=e.i(737801),i=e.i(688070);e.s(["useEnrolledInExperimentEvent",0,()=>{let e=(0,n.useEventAttributes)(),a=(0,r.useAtomValue)(i.isWebViewOnlyAtom);return(0,t.useCallback)((t,r={})=>{if(a)return void console.debug("Skipping enrolled-in-experiment in webview mode");if(!window.mParticle?.isInitialized?.())return void console.warn("MParticle is not initialized");if(!t)return void console.warn("No exposure data provided to trackEnrolledInExperiment");if(!t.experiment_key)return void console.debug(`[Experiment] Skipping exposure tracking for ${t.flag_key} - no experiment_key (feature flag only)`);try{let n={...e,newVariant:t.variant||"",newExperiment:t.flag_key,newExperimentKey:t.experiment_key,newExperimentReceivedAt:Date.now()};window.mParticle?.logEvent?.("enrolled-in-experiment",window.mParticle?.EventType?.Other,n,r),console.debug(`MParticle: Event tracked - enrolled-in-experiment for ${t.flag_key||"unknown"}:${t.variant}`)}catch(e){console.error("MParticle: Failed to track event",e)}},[e,a])}],328343);var a=e.i(546584),s=e.i(553329);let o="production"!==a.default.env.VERCEL_TARGET_ENV,u=new Set;e.s(["resetTrackedExposures",0,function(){u.clear()},"trackAmplitudeExposure",0,function({exposure:e,userId:t,deviceId:r}){if(!e.experiment_key){o&&console.debug(`[Experiment] Skipping Amplitude HTTP exposure for ${e.flag_key} — no experiment_key (feature flag only)`);return}if(!t&&!r){o&&console.debug("[Experiment] Skipping Amplitude HTTP exposure — no user identity");return}let n=`${e.flag_key}::${e.variant??""}`;if(u.has(n)){o&&console.debug(`[Experiment] Skipping duplicate Amplitude HTTP exposure: ${n}`);return}u.add(n);let i={api_key:"bb1117981ed2a95dc4fa64b75661d681",events:[{event_type:"$exposure",user_id:t,device_id:r,ip:"$remote",event_properties:{flag_key:e.flag_key,variant:e.variant,experiment_key:e.experiment_key,platform:"web",app_name:"wx-next-web",environment:o?"dev":"prod",experimentation_platform:"amplitude_experiment"}}]};(async()=>{let{data:t,error:r}=await (0,s.tryCatch)(fetch("https://api2.amplitude.com/2/httpapi",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),keepalive:!0}));return r?console.error("[Experiment] Failed to send exposure to Amplitude HTTP API:",r):t&&!t.ok?console.error(`[Experiment] Amplitude HTTP API returned ${t.status}`):o&&console.debug("[Experiment] Amplitude HTTP exposure sent:",{flag_key:e.flag_key,variant:e.variant})})()}],562209)},283366,e=>{"use strict";e.s(["getExposureVariantOverride",()=>g,"resetExposures",()=>y,"useExposure",()=>x]);var t=e.i(592121),r=e.i(695881),n=e.i(333350),i=e.i(358273),a=e.i(742436);let s=(0,r.createLogger)("useExposure"),o="wxu-exp-exposed:",u=new Set,l=()=>{try{return(0,i.getMetricsSession)()?.sessionId||null}catch{return null}},c=e=>{try{let t=localStorage.getItem(o+e);return new Set(t?JSON.parse(t):[])}catch{return new Set}},d=(e,t)=>{try{for(let t=localStorage.length-1;t>=0;t--){let r=localStorage.key(t);r?.startsWith(o)&&r!==o+e&&localStorage.removeItem(r)}localStorage.setItem(o+e,JSON.stringify([...t]))}catch{}},f=e=>{if(0===u.size)return;let t=c(e);for(let e of u)t.add(e);d(e,t),u.clear()},p=e=>{let t=l();return t?(f(t),c(t).has(e)):u.has(e)},m=new Map;function g(e){return m.get(e)}function y(){u.clear(),m.clear();let e=l();if(e)try{localStorage.removeItem(o+e)}catch{}}function x(e,r){let i=void 0!==r,o=r?.variant,g=(0,t.useContext)(a.ExperimentContext);(0,t.useEffect)(()=>{if(!n.default||!g||p(e)||i&&void 0===o)return;let{client:t}=g;if(!t)return;let r=()=>{if(!p(e)){(e=>{let t=l();if(!t)return u.add(e);f(t);let r=c(t);r.add(e),d(t,r)})(e),void 0!==o&&m.set(e,o);try{t.exposure(e)}catch(e){s.error("Failed to track exposure:",e)}}};window.mParticle?.isInitialized?.()?r():window.mParticle?.ready?.(r)},[g,e,i,o])}},742436,e=>{"use strict";e.s(["ExperimentContext",()=>m,"ExperimentProvider",()=>g,"default",()=>x,"useExperimentContext",()=>y],742436);var t=e.i(546584),r=e.i(699173),n=e.i(592121),i=e.i(185312),a=e.i(333350),s=e.i(546446),o=e.i(328343),u=e.i(158662),l=e.i(528600),c=e.i(562209),d=e.i(283366);let f="client-a74nh7wdmymfO9eOcl5awe1cgB30BDRV",p="production"!==t.default.env.VERCEL_TARGET_ENV,m=(0,n.createContext)(null),g=({children:e,scriptSrc:t})=>{let g=(0,o.useEnrolledInExperimentEvent)(),y=(0,s.useSetAtom)(u.experimentJoinListAtom),{user:x}=(0,l.useUser)(),[v,h]=(0,n.useState)(!1),[E,w]=(0,n.useState)(!1),[,S]=(0,n.useState)(0),_=(0,n.useRef)(void 0),b=(0,n.useRef)(void 0);_.current=x.userID||void 0,b.current=x.anonId||void 0;let A=(0,n.useRef)(new Set),k=(0,n.useRef)({}),I=function(e,t){let r=(0,n.useRef)(null),[i,s]=(0,n.useState)(!1),o=(0,n.useRef)(e);return o.current=e,(0,n.useEffect)(()=>{if(!i&&a.default&&f&&t){if(!window.Experiment)return void console.error("Amplitude Experiment SDK not loaded. Script may still be loading.");try{r.current=window.Experiment.initialize(f,{debug:p,fetchTimeoutMillis:5e3,retryFetchOnFailure:!0,fetchOnStart:!1,automaticExposureTracking:!1,exposureTrackingProvider:{track:e=>{try{o.current(e),p&&console.debug("[Experiment] Exposure tracked:",e)}catch(e){console.error("[Experiment] Failed to track exposure:",e)}}},source:"localStorage"}),s(!0),p&&console.debug("[Experiment] SDK initialized (will fetch from API)")}catch(e){console.error("Failed to initialize Amplitude Experiment SDK:",e)}}},[i,t]),r.current}((0,n.useCallback)(e=>{let t=(0,d.getExposureVariantOverride)(e.flag_key),r=void 0!==t?{...e,variant:t}:e,n=`${r.flag_key}::${r.variant??""}`;if(A.current.has(n))return;A.current.add(n);let[i]=JSON.parse(JSON.stringify(Object.entries({[r.flag_key]:{key:r.variant}}).filter(([,e])=>!!e?.key).map(([e,t])=>{let r=t.key??"",n=Math.floor(Date.now()/1e3);return`${e},${r},${n}`})));i&&(k.current={...k.current,[r.flag_key]:i},y(JSON.stringify(Object.values(k.current)))),g(r),(0,c.trackAmplitudeExposure)({exposure:r,userId:_.current,deviceId:b.current})},[g,y]),v);return(0,n.useEffect)(()=>{(async()=>{if(!I)return;let e=x.anonId;if(!e&&!x.userID){p&&console.debug("[Experiment] No user identifier available"),w(!0);return}let t={device_id:e,...x.userID?{user_id:x.userID}:{},user_properties:{}};p&&console.debug("[Experiment] Fetching experiments from API for user:",t);try{await I.fetch(t)}catch(e){console.error("[Experiment] Failed to fetch experiments:",e)}finally{w(!0)}})()},[I,x.anonId,x.userID]),(0,n.useEffect)(()=>{A.current.clear(),(0,c.resetTrackedExposures)(),(0,d.resetExposures)(),k.current={},y(null),S(e=>e+1)},[x.userID,y]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{src:t,strategy:"afterInteractive",onLoad:()=>{h(!0),p&&console.debug("Amplitude Experiment script loaded")},onError:e=>{console.error("Failed to load Amplitude Experiment script:",e)}}),(0,r.jsx)(m.Provider,{value:{client:I,variant:(e,t)=>{if(!I)return t;let r=I.variant(e,t);return p&&console.debug("[Experiment] Current Variant:",r),r},fetch:e=>{if(!I)return Promise.resolve();if(!e){let e=x.anonId;if(e||x.userID){let t={device_id:e,...x.userID?{user_id:x.userID}:{},user_properties:{}};return I.fetch(t)}}return I.fetch(e)},isFetchComplete:E},children:e})]})},y=()=>{let e=(0,n.useContext)(m);if(!e)throw Error("useExperimentContext must be used within an AmplitudeExperimentProvider");return e},x=g},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")}])},647292,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["webViewPlatformAtom",0,t])},630986,e=>{"use strict";var t=e.i(546446),r=e.i(604323);e.s(["useCMSAttributes",0,()=>(0,t.useAtomValue)(r.metricsArticleDataAtom)])},5397,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["showAdminHeaderAtom",0,t])},37423,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["dprSdkIsInitializedAtom",0,t])},436028,e=>{"use strict";e.s(["hasLength",0,e=>Array.isArray(e)&&e.length>0])}]);