(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,294237,e=>{"use strict";var t=e.i(7284);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>l=>{var a;if((null==t?void 0:t.variants)==null)return n(e,null==l?void 0:l.class,null==l?void 0:l.className);let{variants:o,defaultVariants:u}=t,i=Object.keys(o).map(e=>{let t=null==l?void 0:l[e],n=null==u?void 0:u[e];if(null===t)return null;let a=r(t)||r(n);return o[e][a]}),s=l&&Object.entries(l).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,i,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:n,...l}=t;return Object.entries(l).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...u,...s}[t]):({...u,...s})[t]===r})?[...e,r,n]:e},[]),null==l?void 0:l.class,null==l?void 0:l.className)}])},546446,981030,e=>{"use strict";let t,r;var n=e.i(247865),l={get url(){return e.F("node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/jotai/esm/vanilla/internals.mjs")},env:{DEV:!1,PROD:!0,MODE:"production",BASE_URL:"/",SSR:!1}};function a(e){return!!e.write}function o(e){return"v"in e||"e"in e}function u(e){if("e"in e)throw e.e;return e.v}let i=new WeakMap;function s(e){var t;return d(e)&&!!(null==(t=i.get(e))?void 0:t[0])}function c(e,t){let r=i.get(e);if(!r){r=[!0,new Set],i.set(e,r);let t=()=>{r[0]=!1};e.then(t,t)}r[1].add(t)}function d(e){return"function"==typeof(null==e?void 0:e.then)}function f(e,t,r){if(!r.p.has(e)){r.p.add(e);let n=()=>r.p.delete(e);t.then(n,n)}}function g(e,t,r){var n;let l=new Set;for(let t of(null==(n=r.get(e))?void 0:n.t)||[])r.has(t)&&l.add(t);for(let e of t.p)l.add(e);return l}let p=(e,t,...r)=>t.read(...r),m=(e,t,...r)=>t.write(...r),v=(e,t)=>{var r;return null==(r=t.unstable_onInit)?void 0:r.call(t,e)},h=(e,t,r)=>{var n;return null==(n=t.onMount)?void 0:n.call(t,r)},y=(e,t)=>{var r;let n=R(e),l=n[0],a=n[6],o=n[9],u=l.get(t);return u||(u={d:new Map,p:new Set,n:0},l.set(t,u),null==(r=a.i)||r.call(a,t),null==o||o(e,t)),u},w=e=>{let t=R(e),r=t[1],n=t[3],l=t[4],a=t[5],o=t[6],u=t[13],i=[],s=e=>{try{e()}catch(e){i.push(e)}};do{o.f&&s(o.f);let t=new Set,i=t.add.bind(t);n.forEach(e=>{var t;return null==(t=r.get(e))?void 0:t.l.forEach(i)}),n.clear(),a.forEach(i),a.clear(),l.forEach(i),l.clear(),t.forEach(s),n.size&&u(e)}while(n.size||a.size||l.size)if(i.length)throw AggregateError(i)},S=e=>{let t=R(e),r=t[1],n=t[2],a=t[3],o=t[11],u=t[14],i=t[17],s=[],c=new WeakSet,d=new WeakSet,f=Array.from(a);for(;f.length;){let t=f[f.length-1],a=o(e,t);if(d.has(t)){f.pop();continue}if(c.has(t)){n.get(t)===a.n?s.push([t,a]):"production"!==l.env.MODE&&n.has(t),d.add(t),f.pop();continue}for(let e of(c.add(t),g(t,a,r)))c.has(e)||f.push(e)}for(let t=s.length-1;t>=0;--t){let[r,l]=s[t],o=!1;for(let e of l.d.keys())if(e!==r&&a.has(e)){o=!0;break}o&&(u(e,r),i(e,r)),n.delete(r)}},b=new WeakSet,O=(e,t)=>{var r,n;let i,g,p=R(e),m=p[1],v=p[2],h=p[3],y=p[6],w=p[7],S=p[11],O=p[12],E=p[13],A=p[14],_=p[16],k=p[17],M=S(e,t);if(o(M)&&(m.has(t)&&v.get(t)!==M.n||Array.from(M.d).every(([t,r])=>A(e,t).n===r)))return M;M.d.clear();let C=!0;function I(){m.has(t)&&(k(e,t),E(e),O(e))}let x=M.n;try{let n=w(e,t,function(r){var n;if(r===t){let t=S(e,r);if(!o(t))if("init"in r)P(e,r,r.init);else throw Error("no atom init");return u(t)}let l=A(e,r);try{return u(l)}finally{M.d.set(r,l.n),s(M.v)&&f(t,M.v,l),null==(n=m.get(r))||n.t.add(t),C||I()}},{get signal(){return i||(i=new AbortController),i.signal},get setSelf(){return"production"!==l.env.MODE&&!a(t),!g&&a(t)&&(g=(...r)=>{if(!C)try{return _(e,t,...r)}finally{E(e),O(e)}}),g}});return"production"!==l.env.MODE&&b.has(e),P(e,t,n),d(n)&&(c(n,()=>null==i?void 0:i.abort()),n.then(I,I)),null==(r=y.r)||r.call(y,t),M}catch(e){return delete M.v,M.e=e,++M.n,M}finally{C=!1,x!==M.n&&v.get(t)===x&&(v.set(t,M.n),h.add(t),null==(n=y.c)||n.call(y,t))}},E=(e,t)=>{let r=R(e),n=r[1],l=r[2],a=r[11],o=[t];for(;o.length;){let t=o.pop(),r=a(e,t);for(let u of g(t,r,n)){let t=a(e,u);l.set(u,t.n),o.push(u)}}},A=(e,t,...r)=>{let n=R(e),l=n[3],a=n[6],o=n[8],i=n[11],s=n[12],c=n[13],d=n[14],f=n[15],g=n[17],p=!0;try{return o(e,t,t=>u(d(e,t)),(r,...n)=>{var o;let u=i(e,r);try{if(r!==t)return A(e,r,...n);{if(!("init"in r))throw Error("atom not writable");let t=u.n,i=n[0];P(e,r,i),g(e,r),t!==u.n&&(l.add(r),null==(o=a.c)||o.call(a,r),f(e,r));return}}finally{p||(c(e),s(e))}},...r)}finally{p=!1}},_=(e,t)=>{var r;let n=R(e),l=n[1],a=n[3],o=n[6],u=n[11],i=n[15],c=n[18],d=n[19],f=u(e,t),g=l.get(t);if(g&&!s(f.v)){for(let[n,l]of f.d)if(!g.d.has(n)){let s=u(e,n);c(e,n).t.add(t),g.d.add(n),l!==s.n&&(a.add(n),null==(r=o.c)||r.call(o,n),i(e,n))}for(let r of g.d||[])if(!f.d.has(r)){g.d.delete(r);let n=d(e,r);null==n||n.t.delete(t)}}},k=(e,t)=>{var r;let n=R(e),l=n[1],o=n[4],u=n[6],i=n[10],s=n[11],c=n[12],d=n[13],f=n[14],g=n[16],p=s(e,t),m=l.get(t);if(!m){for(let r of(f(e,t),p.d.keys()))k(e,r).t.add(t);m={l:new Set,d:new Set(p.d.keys()),t:new Set},l.set(t,m),null==(r=u.m)||r.call(u,t),a(t)&&o.add(()=>{let r=!0;try{let n=i(e,t,(...n)=>{try{return g(e,t,...n)}finally{r||(d(e),c(e))}});n&&(m.u=()=>{r=!0;try{n()}finally{r=!1}})}finally{r=!1}})}return m},M=(e,t)=>{var r;let n=R(e),l=n[1],a=n[5],o=n[6],u=n[11],i=n[19],s=u(e,t),c=l.get(t);if(c&&!c.l.size&&!Array.from(c.t).some(e=>{var r;return null==(r=l.get(e))?void 0:r.d.has(t)})){for(let n of(c.u&&a.add(c.u),c=void 0,l.delete(t),null==(r=o.u)||r.call(o,t),s.d.keys())){let r=i(e,n);null==r||r.t.delete(t)}return}return c},P=(e,t,r)=>{let n=R(e)[11],l=n(e,t),a="v"in l,o=l.v;if(d(r))for(let a of l.d.keys())f(t,r,n(e,a));if(l.v=r,delete l.e,!a||!Object.is(o,l.v)){let e;++l.n,d(o)&&(null==(e=i.get(o))?void 0:e[0])&&(e[0]=!1,e[1].forEach(e=>e()))}},C=(e,t)=>u((0,R(e)[14])(e,t)),I=(e,t,...r)=>{let n=R(e),l=n[12],a=n[13],o=n[16];try{return o(e,t,...r)}finally{a(e),l(e)}},x=(e,t,r)=>{let n=R(e),l=n[12],a=n[18],o=n[19],u=a(e,t).l;return u.add(r),l(e),()=>{u.delete(r),o(e,t),l(e)}},j=new WeakMap,R=e=>j.get(e);var W={get url(){return e.F("node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/jotai/esm/vanilla.mjs")},env:{DEV:!1,PROD:!0,MODE:"production",BASE_URL:"/",SSR:!1}};let D=0;function L(e){return e(this)}function N(e,t,r){return t(this,"function"==typeof r?r(e(this)):r)}function T(){let e,r;return t?t():(e={get:t=>(0,R(e)[21])(e,t),set:(t,...r)=>(0,R(e)[22])(e,t,...r),sub:(t,r)=>(0,R(e)[23])(e,t,r)},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},p,m,v,h,y,w,S,O,E,A,_,k,M,P,C,I,x,void 0].map((e,t)=>[][t]||e),j.set(e,Object.freeze(r)),e)}function F(){return r||(r=T()),r}e.s(["atom",0,function(e,t){let r=`atom${++D}`,n={toString(){return"production"!==W.env.MODE&&this.debugLabel?"TURBOPACK unreachable":r}};return"function"==typeof e?n.read=e:(n.init=e,n.read=L,n.write=N),t&&(n.write=t),n},"createStore",0,T,"getDefaultStore",0,F],981030);let U=(0,n.createContext)(void 0);function J(e){let t=(0,n.useContext)(U);return(null==e?void 0:e.store)||t||F()}let z=e=>"function"==typeof(null==e?void 0:e.then),B=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},V=n.default.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw B(e),e}),K=new WeakMap,q=(e,t)=>{let r=K.get(e);return r||(r=new Promise((n,l)=>{let a=e,o=e=>t=>{a===e&&n(t)},u=e=>t=>{a===e&&l(t)},i=()=>{try{let e=t();z(e)?(K.set(e,r),a=e,e.then(o(e),u(e)),c(e,i)):n(e)}catch(e){l(e)}};e.then(o(e),u(e)),c(e,i)}),K.set(e,r)),r};function G(e,t){let{delay:r,unstable_promiseStatus:l=!n.default.use}=t||{},a=J(t),[[o,u,i],s]=(0,n.useReducer)(t=>{let r=a.get(e);return Object.is(t[0],r)&&t[1]===a&&t[2]===e?t:[r,a,e]},void 0,()=>[a.get(e),a,e]),c=o;if((u!==a||i!==e)&&(s(),c=a.get(e)),(0,n.useEffect)(()=>{let t=a.sub(e,()=>{if(l)try{let t=a.get(e);z(t)&&B(q(t,()=>a.get(e)))}catch(e){}"number"==typeof r?setTimeout(s,r):s()});return s(),t},[a,e,r,l]),(0,n.useDebugValue)(c),z(c)){let t=q(c,()=>a.get(e));return l&&B(t),V(t)}return c}function $(e,t){let r=J(t);return(0,n.useCallback)((...t)=>r.set(e,...t),[r,e])}e.s(["Provider",0,function({children:e,store:t}){let r=(0,n.useRef)(null);return t?(0,n.createElement)(U.Provider,{value:t},e):(null===r.current&&(r.current=T()),(0,n.createElement)(U.Provider,{value:r.current},e))},"useAtom",0,function(e,t){return[G(e,t),$(e,t)]},"useAtomValue",0,G,"useSetAtom",0,$,"useStore",0,J],546446)},284007,e=>{"use strict";var t=e.i(981030);let r=Symbol(""),n=e=>"function"==typeof(null==e?void 0:e.then);function l(e=()=>{try{return window.localStorage}catch(e){return}},t){var r;let a,o,u,i,s={getItem:(r,l)=>{var u,i;let s=e=>{if(a!==(e=e||"")){try{o=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return l}a=e}return o},c=null!=(i=null==(u=e())?void 0:u.getItem(r))?i:null;return n(c)?c.then(s):s(c)},setItem:(r,n)=>{var l;return null==(l=e())?void 0:l.setItem(r,JSON.stringify(n,null==t?void 0:t.replacer))},removeItem:t=>{var r;return null==(r=e())?void 0:r.removeItem(t)}};try{u=null==(r=e())?void 0:r.subscribe}catch(e){}return!u&&"u">typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(u=(t,r)=>{if(!(e()instanceof window.Storage))return()=>{};let n=n=>{n.storageArea===e()&&n.key===t&&r(n.newValue)};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}}),u&&(i=u,s.subscribe=(e,t,r)=>i(e,e=>{let n;try{n=JSON.parse(e||"")}catch(e){n=r}t(n)})),s}let a=l(),o=new WeakMap,u={state:"loading"};e.s(["RESET",0,r,"atomWithStorage",0,function(e,l,o=a,u){let i=null==u?void 0:u.getOnInit,s=(0,t.atom)(i?o.getItem(e,l):l);return s.onMount=t=>{let r;return t(o.getItem(e,l)),o.subscribe&&(r=o.subscribe(e,t,l)),r},(0,t.atom)(e=>e(s),(t,a,u)=>{let i="function"==typeof u?u(t(s)):u;return i===r?(a(s,l),o.removeItem(e)):n(i)?i.then(t=>(a(s,t),o.setItem(e,t))):(a(s,i),o.setItem(e,i))})},"createJSONStorage",0,l,"loadable",0,function(e){let r;return r=()=>{let r=new WeakMap,n=(0,t.atom)([()=>{},0]);n.unstable_onInit=e=>{e.set(n,([,t])=>[()=>e.set(n,([e,t])=>[e,t+1]),t])};let l=(0,t.atom)(t=>{let l,a,[o]=t(n);try{l=t(e)}catch(e){return{state:"hasError",error:e}}if("function"!=typeof(null==(a=l)?void 0:a.then))return{state:"hasData",data:l};let i=l,s=r.get(i);return s?s:(i.then(e=>{r.set(i,{state:"hasData",data:e}),o()},e=>{r.set(i,{state:"hasError",error:e}),o()}),r.get(i)||(r.set(i,u),u))});return(0,t.atom)(e=>e(l))},(o.has(e)?o:o.set(e,r())).get(e)}])},537989,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["pageIdAtom",0,t])},608201,236593,e=>{"use strict";var t=e.i(284007);let r={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function n(){try{return window.sessionStorage}catch{return r}}let l=(0,t.createJSONStorage)(n),a=(0,t.atomWithStorage)("wx-source-page",null,l,{getOnInit:!0});e.s(["sourcePageAtom",0,a],608201);let o=(0,t.createJSONStorage)(n),u=(0,t.atomWithStorage)("wx-source-module",null,o,{getOnInit:!0});e.s(["sourceModuleAtom",0,u],236593)},736677,220126,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),n=(0,t.atomWithStorage)("wx-ht-source-page",null,r);e.s(["sourcePageAtom",0,n],736677);let l=(0,t.createJSONStorage)(()=>sessionStorage),a=(0,t.atomWithStorage)("wx-ht-source-module",null,l);e.s(["sourceModuleAtom",0,a],220126)},678651,(e,t,r)=>{"use strict";function n(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))void 0!==n&&t.append(r,n);return t}Object.defineProperty(r,"__esModule",{value:!0}),r.queryStringToSearchParams=n,r.urlFrom=function({host:e,...t}){if(!e)throw Error("Host is missing");let r=new URL(`https://${e}`);return Object.assign(r,{...t,hostname:e}),t.query&&(r.search=n(t.query).toString()),r}},671525,e=>{"use strict";var t=e.i(725287),r=e.i(652517);let n=()=>{let e=(0,t.useRouter)();return{navigate:(t,r={})=>{let{mpa:n=!0,replace:l=!1}=r;n?l?window.location.replace(t):window.location.href=t:l?e.replace(t):e.push(t)},refresh:(t={})=>{let{mpa:n=!0}=t;n?(0,r.reloadPage)():e.refresh()},router:e}};e.s(["default",0,n,"usePageNavigation",0,n])},652517,e=>{"use strict";let t=null;e.s(["reloadPage",0,function(e=()=>window.location.reload()){t?t(e):e()},"setReloadHandler",0,function(e){return t=e,()=>{t===e&&(t=null)}}])},632137,e=>{"use strict";var t=e.i(7284);let r=(0,e.i(923191).extendTailwindMerge)({extend:{classGroups:{"font-size":[{text:["xxs"]}]},theme:{color:[{brand:["100","200","300","400","dark","light"]}]}}});e.s(["cn",0,function(...e){return r((0,t.clsx)(e))}])},776169,809991,e=>{"use strict";var t=e.i(546446),r=e.i(889753),n=e.i(301904),l=e.i(905059),a=e.i(901351),o=e.i(310847),u=e.i(528600),i=e.i(617874),s=e.i(540768),c=e.i(553329),d=e.i(247865),f=e.i(245943);let g=(0,e.i(695881).createLogger)("useMapSettings");e.s(["WEB_MAP_SETTINGS_PLATFORM",0,"twc","useMapSettings",0,function(e="twc"){let{user:{isUserLoggedIn:r}}=(0,u.useUser)(),n=(0,t.useSetAtom)(l.mapLayerOrderAtom),o=(0,d.useCallback)(async t=>{if(!r)return!1;let{error:n}=await (0,c.tryCatch)(a.upsxClient.preference.updateMapSettings(e,t));if(!n)return!0;if(n instanceof f.APIError&&404===n.code){let{error:r}=await (0,c.tryCatch)(a.upsxClient.preference.createMapSettings(e,t));return!r||(g.warn("Failed to create map settings",r),!1)}return g.warn("Failed to update map settings",n),!1},[r,e]),i=(0,d.useCallback)((e,t)=>{n(e?.layerOrder??t)},[n]),s=(0,d.useCallback)(async t=>{if(!r||0===t.length)return!1;n(t);let{data:l,error:o}=await (0,c.tryCatch)(a.upsxClient.preference.reorderMapSettingsLayers(e,{order:t}));if(!o)return i(l,t),!0;if(o instanceof f.APIError&&404===o.code){let{data:r,error:n}=await (0,c.tryCatch)(a.upsxClient.preference.createMapSettings(e,{layerOrder:t}));if(!n)return i(r,t),!0;if(n instanceof f.APIError&&409===n.code){let{data:r,error:n}=await (0,c.tryCatch)(a.upsxClient.preference.reorderMapSettingsLayers(e,{order:t}));return n?(g.warn("Failed to reorder map layers after create",n),!1):(i(r,t),!0)}return g.warn("Failed to create map settings layer order",n),!1}return g.warn("Failed to reorder map layers",o),!1},[r,e,i,n]),p=(0,d.useCallback)(async(t,l,o)=>{if(!r)return!1;n(o);let{data:u,error:d}=await (0,c.tryCatch)(a.upsxClient.preference.moveMapSettingsLayer(e,t,{placement:l}));return d?d instanceof f.APIError&&(404===d.code||400===d.code)?s(o):(g.warn("Failed to move map layer",d),!1):(i(u,o),!0)},[r,e,i,s,n]);return{saveMapSettings:o,saveLayerOrder:s,moveLayer:p}}],809991),e.s(["usePreferences",0,function(){let{user:{isUserLoggedIn:e}}=(0,u.useUser)(),[d,f]=(0,t.useAtom)(r.userPreferencesAtom),[g,p]=(0,t.useAtom)(o.wxuUserPreferenceAtom),m=(0,t.useSetAtom)(l.mapLayerOrderAtom),v=async()=>{let{data:e,error:t}=await (0,c.tryCatch)(a.upsxClient.preference.getMapSettings("twc"));if(t)return{ok:!1,mapSettings:null,layerOrder:null};if(!e)return{ok:!0,mapSettings:null,layerOrder:null};let{animationSpeed:r,autoplay:n,opacity:l,roadOverlay:o,style:u}=e,i={...void 0!==r&&{animationSpeed:r},...void 0!==n&&{autoplay:n},...void 0!==l&&{opacity:l},...void 0!==o&&{roadOverlay:o},...void 0!==u&&{style:u}};return{ok:!0,mapSettings:Object.keys(i).length>0?i:null,layerOrder:e.layerOrder?.length?e.layerOrder:null}},h=async e=>{try{await a.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,l=(n={...d,...t},f(n),p({...g,...t,locations:n.locations}),n);if(t?.unit){let e=(0,i.unitsSystemByName)(t.unit),r=e?.code||"e";(0,s.setCookie)(i.UNITS_COOKIE_KEY,r,{domain:"weather.com"})}return r&&e&&await h(l),{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([a.upsxClient.preference.getPreference(),v()]);if(!e?.userID)return null;let{mapSettings:r,layerOrder:l,ok:o}=t;o&&m(l);let{mapSettings:u,...i}=e,s={...i,mapSettings:{...n.DEFAULT_MAP_SETTINGS,...r}};return y(s,!1),s}catch{return null}},updatePreferences:y}}],776169)},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])}]);