(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,45776,(e,l,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getPollenRiskLevel=function(e){return null==e||""===e?null:t[Number(e)]??null},r.getPollenObservationByType=function(e,l){return e?.pollenobservation.find(e=>e.pollen_type===l)};let t={1:"low",2:"moderate",3:"high",4:"veryHigh"}},533694,e=>{"use strict";let l=new Set(["AK","HI"]);e.s(["f",0,e=>e?.countryCode==="US"&&!l.has(e.adminDistrictCode??"")])},564599,e=>{"use strict";var l=e.i(458201),r=e.i(289818),t=e.i(64412),a=e.i(860082),n=e.i(282446),i=e.i(580547),s=e.i(789422),o=e.i(16838),d=e.i(5397),c=e.i(731947),u=e.i(923931),h=e.i(794120),m=e.i(674885),f=e.i(617874),y=e.i(738634),p=e.i(349262);let g=e=>e?.slice(0,10)??"";var x=e.i(380993),v=e.i(316078),j=e.i(632137),b=e.i(385636),w=e.i(175424);let k="grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_8.5rem] items-center gap-x-4 @xl/card:grid-cols-[1.2fr_1.3fr_1fr_1fr_0.8fr_0.8fr]",_="order-3 justify-self-end @xl/card:order-none",N="order-2 justify-self-start @xl/card:order-none @xl/card:justify-self-center",C="hidden @xl/card:flex",P=({rows:e,speedUnit:r,isLoading:t=!1})=>{let a=(0,s.r)("AllergyForecast");return(0,l.jsxs)(x.N,{"data-testid":"AllergyForecastModule","aria-label":a("daily"),"aria-busy":t||void 0,children:[(0,l.jsx)(x.Y,{text:a("daily")}),(0,l.jsx)(x.O,{children:(0,l.jsxs)("div",{role:"table",className:"text-base",children:[(0,l.jsxs)("div",{role:"row",className:(0,j.f)(k,"sr-only border-b border-gray-200 pb-3 text-xs text-gray-600 @xl/card:not-sr-only"),children:[(0,l.jsx)("span",{role:"columnheader",children:a("day")}),(0,l.jsx)("span",{role:"columnheader",className:_,children:a("pollenLevel")}),(0,l.jsx)("span",{role:"columnheader",className:N,children:a("pollenCount")}),(0,l.jsx)("span",{role:"columnheader",className:C,children:a("conditions")}),(0,l.jsx)("span",{role:"columnheader",className:(0,j.f)(C,"justify-end"),children:a("humidity")}),(0,l.jsx)("span",{role:"columnheader",className:(0,j.f)(C,"justify-end"),children:a("wind")})]}),t&&Array.from({length:6},(e,r)=>(0,l.jsx)("div",{className:"border-b border-gray-200 py-5",children:(0,l.jsx)("div",{className:"h-5 w-full animate-pulse rounded bg-gray-200"})},r)),!t&&e.map(e=>(0,l.jsxs)("div",{role:"row",className:(0,j.f)(k,"min-h-16 border-b border-gray-200 py-3",e.isYesterday?"text-gray-500":"text-gray-900"),children:[(0,l.jsx)("span",{role:"cell",children:e.label}),(0,l.jsx)("span",{role:"cell",className:_,children:e.risk?(0,l.jsx)(b.f,{level:e.risk,reserveSpace:!0}):"–"}),(0,l.jsx)("span",{role:"cell",className:N,children:null!==e.count?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"font-bold",children:e.count}),(0,l.jsx)("span",{className:"text-xs",children:w.h})]}):"–"}),(0,l.jsxs)("span",{role:"cell",className:(0,j.f)(C,"items-center gap-1.5"),children:[e.weather?.iconCode!==void 0&&(0,l.jsx)(v.WxIcon,{iconCode:e.weather.iconCode,size:"md"}),(0,l.jsx)("span",{className:(0,j.f)("text-sm",(e.weather?.precipChance??0)>=w.e&&!e.isYesterday?"text-[#1866e1]":"text-gray-500"),children:e.weather?.precipChance!==void 0?`${e.weather.precipChance}%`:"–"})]}),(0,l.jsx)("span",{role:"cell",className:(0,j.f)(C,"justify-end"),children:e.weather?.humidity!==void 0?`${e.weather.humidity}%`:"–"}),(0,l.jsx)("span",{role:"cell",className:(0,j.f)(C,"justify-end"),children:e.weather?.windSpeed!==void 0?`${e.weather.windSpeed} ${r}`:"–"})]},e.key))]})})]})},F=({location:e})=>{var r,t;let a,x=(0,s.r)("AllergyForecast"),v=(0,i.X)(),{data:j,error:b,isPending:w}=(0,c.f)(e),{weatherByDate:k,speedUnit:_}=function(e){let l=(0,i.X)(),r=(0,n.y)(m.N),t=(0,f.H)(r),a=t?.code??"e",{data:s,error:o}=(0,h.U)(e?.geocode?["get-daily-forecast",e.geocode,p.ForecastDuration.FIVE_DAY,a,l]:null,([,e,l,r,t])=>(0,y.getDailyForecast)({geocode:e,duration:l,units:r,language:t}),{revalidateOnFocus:!1,dedupingInterval:6e4});return{weatherByDate:s?function(e){let l={};for(let r of e){let e=g(r.validTimeLocal);if(!e)continue;let t=r.daypart[0]??r.daypart[1];l[e]={iconCode:t?.iconCode,precipChance:t?.precipChance,humidity:t?.relativeHumidity,windSpeed:t?.windSpeed}}return l}(s):void 0,speedUnit:t?.speed??"mph",error:o}}(e),N=(0,n.y)(d.f);if(b||!w&&!j)return null;let C=j?(r={yesterday:x("yesterday"),today:x("today")},t=e?.ianaTimeZone,a=[],j.yesterday&&a.push({key:"yesterday",label:r.yesterday,isYesterday:!0,risk:j.yesterday.risk,count:j.yesterday.count}),j.days.forEach((e,l)=>{a.push({key:e.validTimeLocal,label:0===l?r.today:(0,u.P)(e.validTimeLocal,v,t),risk:e.risk,count:e.count,weather:k?.[g(e.validTimeLocal)]})}),a):[];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.f,{componentName:"AllergyForecast",data:{props:{location:e},state:{rows:C,error:b,componentState:w?"loading":"ready"}},enabled:N}),(0,l.jsx)(P,{rows:C,speedUnit:_,isLoading:w})]})},T=(0,r.default)(()=>e.A(178135),{loadableGenerated:{modules:[515900]}}),A=({globalPageProps:e})=>{let{location:r}=(0,t.f)();return(0,a.f)(r,e)?(0,l.jsx)(F,{location:r}):(0,l.jsx)(T,{location:r})};e.s(["AllergyForecastBlockClient",0,A,"default",0,A],564599)},513722,function(e){e.n(e.i(564599))},178135,e=>{e.v(l=>Promise.all(["static/immutable/chunks/0_2kfbukgjz8u.js"].map(l=>e.l(l))).then(()=>l(515900)))},385636,e=>{"use strict";var l=e.i(458201),r=e.i(789422),t=e.i(632137),a=e.i(175424);let n=({level:e,reserveSpace:r=!1,className:n})=>{let i=a.g[e];return(0,l.jsx)("span",{"aria-hidden":"true",className:(0,t.f)("inline-flex h-3 shrink-0 items-end gap-0.5",n),children:Array.from({length:r?4:i},(r,t)=>(0,l.jsx)("span",{className:"h-full w-1 rounded-xs",style:t{let u=(0,r.r)("Pollen"),h=(0,l.jsx)(n,{level:e,reserveSpace:o});return(0,l.jsxs)("span",{className:(0,t.f)("inline-flex items-center","badge"===i?"h-6 gap-1 rounded bg-[#f2f2f2] px-2 text-xs font-bold":"gap-2",d),children:[s&&h,(0,l.jsx)("span",{className:c,children:u(a.G[e])}),!s&&h]})}])},923931,e=>{"use strict";var l=e.i(873598);e.s(["P",0,function(e,r,t){let a,n=new Date(e);if(Number.isNaN(n.getTime()))return"";let i=new Intl.DateTimeFormat(r,(a={weekday:"short",day:"numeric"},t?{...a,timeZone:(0,l.f)(t)}:a));if(!r.startsWith("en"))return i.format(n);let s=i.formatToParts(n),o=s.find(e=>"weekday"===e.type)?.value??"",d=s.find(e=>"day"===e.type)?.value??"";return`${o} ${d}`.trim()},"x",0,function(e,l,r="long"){return e12?"":new Intl.DateTimeFormat(l,{month:r,timeZone:"UTC"}).format(new Date(Date.UTC(2e3,e-1,15,12)))}])},860082,e=>{"use strict";var l=e.i(533694),r=e.i(181462);e.s(["f",0,(e,t,a=!0)=>e?(0,l.f)(e):(0,r.h)(t)??a])},175424,e=>{"use strict";e.s(["h",0,"/m³","g",0,{low:1,moderate:2,high:3,veryHigh:4},"m",0,{low:"#4ed07b",moderate:"#ffb900",high:"#ff4c00",veryHigh:"#ba0d00"},"G",0,{low:"riskLow",moderate:"riskModerate",high:"riskHigh",veryHigh:"riskVeryHigh"},"J",0,["low","moderate","high","veryHigh"],"_",0,["tree","grass","ragweed"],"e",0,30])},731947,e=>{"use strict";var l=e.i(794120),r=e.i(580547),t=e.i(550008),a=e.i(45776),n=e.i(533694),i=e.i(175424);let s={tree:"tree",grass:"grass",ragweed:"weed"},o=(e,l)=>e?.[l]??null;e.s(["f",0,function(e){let d=(0,r.X)(),c=!!e&&!(0,n.f)(e),u=c?void 0:e?.geocode,{data:h,error:m}=(0,l.U)(u?["pollenForecastDaily",u,d]:null,([,e,l])=>(0,t.getPollenForecastDaily)({geocode:e,language:l}),{revalidateOnFocus:!1,dedupingInterval:6e4}),{data:f,error:y}=(0,l.U)(u?["pollenObservations",u,d]:null,([,e,l])=>(0,t.getPollenObservations)({geocode:e,language:l}),{revalidateOnFocus:!1,dedupingInterval:6e4}),p=!!(f||y);return{data:h&&p?function(e,l){let r=(e.validTimeLocal??[]).map((l,r)=>{let t={};for(let l of i._){let n=s[l];t[l]={count:o(e[`${n}PollenCountMean`],r),risk:(0,a.getPollenRiskLevel)(o(e[`${n}PollenIndexMean`],r))}}return{validTimeLocal:l,count:o(e.totalPollenCountMean,r),peak:o(e.totalPollenCountMax,r),risk:(0,a.getPollenRiskLevel)(o(e.totalPollenIndexMean,r)),species:t}});if(!r.length)return null;let t=function(e){if(!e)return null;let l=(0,a.getPollenRiskLevel)(e.total_pollen_idx);return null!==e.total_pollen_cnt||l?{count:e.total_pollen_cnt,risk:l}:null}(l?.pollenobservations?.[0]),n=r[0]?.count??null,d=null!==n&&t?.count!=null?n-t.count:null;return{days:r,yesterday:t,changeFromYesterday:d}}(h,f):null,observations:f??null,error:m,isPending:!c&&!m&&(!h||!p)}}])}]);