2 lines
121 KiB
JavaScript
2 lines
121 KiB
JavaScript
(()=>{"use strict";var e={"./server/scripts/index.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/fetch.mjs"),n=s("./server/scripts/modules/utils/nosleep.mjs"),a=s("./server/scripts/modules/navigation.mjs");document.addEventListener("DOMContentLoaded",(()=>{c()}));const i={};let o=!1,l=!1;const u=["Land Features","Bay","Channel","Cove","Dam","Delta","Gulf","Lagoon","Lake","Ocean","Reef","Reservoir","Sea","Sound","Strait","Waterfall","Wharf","Amusement Park","Historical Monument","Landmark","Tourist Attraction","Zoo","College","Beach","Campground","Golf Course","Harbor","Nature Reserve","Other Parks and Outdoors","Park","Racetrack","Scenic Overlook","Ski Resort","Sports Center","Sports Field","Wildlife Reserve","Airport","Ferry","Marina","Pier","Port","Resort","Postal","Populated Place"].join(","),c=()=>{document.getElementById("txtAddress").addEventListener("focus",(e=>{e.target.select()})),(0,a.registerRefreshData)(y),document.getElementById("NavigateMenu").addEventListener("click",p),document.getElementById("NavigateRefresh").addEventListener("click",w),document.getElementById("NavigateNext").addEventListener("click",S),document.getElementById("NavigatePrevious").addEventListener("click",T),document.getElementById("NavigatePlay").addEventListener("click",D),document.getElementById("ToggleFullScreen").addEventListener("click",h),document.getElementById("btnGetGps").addEventListener("click",x),document.getElementById("divTwc").addEventListener("click",(()=>{document.fullscreenElement&&C()})),document.addEventListener("keydown",I),document.addEventListener("touchmove",(e=>{l&&e.preventDefault()})),$("#frmGetLatLng #txtAddress").devbridgeAutocomplete({serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest",deferRequestBy:300,paramName:"text",params:{f:"json",countryCode:"USA",category:u,maxSuggestions:10},dataType:"json",transformResult:t=>(o&&(o=!1,window.setTimeout((()=>{$(e.suggestionsContainer.children[0]).click()}),1)),{suggestions:$.map(t.suggestions,(e=>({value:e.text,data:e.magicKey})))}),minChars:3,showNoSuggestionNotice:!0,noSuggestionNotice:"No results found. Please try a different search string.",onSelect(e){d(e,this)},width:490});const e=$("#frmGetLatLng #txtAddress").devbridgeAutocomplete();$("#frmGetLatLng").on("submit",(()=>(e.suggestions[0]&&$(e.suggestionsContainer.children[0]).click(),!1)));const t=localStorage.getItem("TwcQuery");if(t){o=!0;const e=document.getElementById("txtAddress");e.value=t,e.blur(),e.focus()}const s=localStorage.getItem("TwcPlay");null!==s&&"true"!==s||M("navButton","play"),document.getElementById("btnClearQuery").addEventListener("click",(()=>{document.getElementById("spanCity").innerHTML="",document.getElementById("spanState").innerHTML="",document.getElementById("spanStationId").innerHTML="",document.getElementById("spanRadarId").innerHTML="",document.getElementById("spanZoneId").innerHTML="",localStorage.removeItem("TwcScrollText"),localStorage.removeItem("TwcScrollTextChecked"),document.getElementById("chkAutoRefresh").checked=!0,localStorage.removeItem("TwcAutoRefresh"),document.getElementById("radEnglish").checked=!0,localStorage.removeItem("TwcPlay"),M("navButton","play"),localStorage.removeItem("TwcQuery")})),document.getElementById("container").addEventListener("swiped-left",(()=>v("left"))),document.getElementById("container").addEventListener("swiped-right",(()=>v("right")))},d=async(e,t)=>{if(t.previousSuggestionValue!==e.value)if(i[e.value])m(i[e.value]);else{const t=(await(0,r.json)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",{data:{text:e.value,magicKey:e.data,f:"json"}})).locations[0];t?m(t.feature.geometry):console.error("An unexpected error occurred. Please try a different search string.")}},m=e=>{const t={lat:Math.round2(e.y,4),lon:Math.round2(e.x,4)};y(t),localStorage.setItem("TwcQuery",document.getElementById("txtAddress").value)},h=()=>(document.fullscreenElement?g():f(),(0,a.isPlaying)()?(0,n.default)(!0):(0,n.default)(!1),C(),!1),f=()=>{const e=document.getElementById("divTwc"),t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t?t.call(e,{navigationUI:"hide"}):(window.scrollTo(0,0),l=!0),(0,a.resize)(),C(),document.getElementById("ToggleFullScreen").title="Exit fullscreen"},g=()=>{l&&(l=!1),document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),(0,a.resize)(),document.getElementById("ToggleFullScreen").title="Enter fullscreen"},p=()=>(M("navButton","menu"),C(),!1),y=e=>{e&&(y.latLon=e);const{latLon:t}=y;t&&(document.getElementById("txtAddress").blur(),(0,a.stopAutoRefreshTimer)(),(0,a.latLonReceived)(t))},v=e=>{if("left"===e)S();else T()},w=()=>((0,a.resetStatuses)(),y(),C(),!1),S=()=>(M("navButton","next"),C(),!1),T=()=>(M("navButton","previous"),C(),!1);let b=null;const C=()=>{document.activeElement.blur(),document.getElementById("divTwcBottom").classList.remove("hidden"),document.getElementById("divTwcBottom").classList.add("visible"),b&&(clearTimeout(b),b=null),b=setTimeout((()=>{document.fullscreenElement&&(document.getElementById("divTwcBottom").classList.remove("visible"),document.getElementById("divTwcBottom").classList.add("hidden"))}),2e3)},I=e=>{const t=e.keyCode||e.which;if((Date.now()-I.lastButton??0)<200)return!1;if(I.lastButton=Date.now(),document.fullscreenElement||document.activeElement===document.body)switch(t){case 32:return D(),!1;case 39:case 34:return S(),!1;case 37:case 33:return T(),!1;case 36:return p(),!1;case 48:return w(),!1;case 70:return h(),!1}return!1};Math.round2=(e,t)=>Number(`${Math.round(`${e}e${t}`)}e-${t}`);const D=()=>(M("navButton","playToggle"),C(),!1),M=(e,t={})=>{(0,a.message)({type:e,message:t})},x=async()=>{if(!navigator.geolocation)return;const e=await new Promise((e=>{navigator.geolocation.getCurrentPosition(e)})),{latitude:t,longitude:s}=e.coords;let n;try{n=await(0,r.json)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode",{data:{location:`${s},${t}`,distance:1e3,f:"json"}})}catch(e){console.error("Unable to fetch reverse geocode"),console.error(e.status,e.responseJSONe)}const a=n.address.Postal,{City:i}=n.address,o=`${a}, ${i}, ${states.getTwoDigitCode(n.address.Region)}, ${n.address.CountryCode}`,l=document.getElementById("txtAddress");l.value=o,l.blur(),l.focus(),localStorage.setItem("TwcQuery",o)}},"./server/scripts/modules/almanac.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var r=s("./server/scripts/modules/utils/image.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/status.mjs"),i=s("./server/scripts/modules/weatherdisplay.mjs"),o=s("./server/scripts/modules/navigation.mjs");class l extends i.default{constructor(e,t){super(e,t,"Almanac",!0),this.backgroundImage0=(0,r.loadImg)("images/BackGround3_1.png"),(0,r.preloadImg)("images/2/Full-Moon.gif"),(0,r.preloadImg)("images/2/Last-Quarter.gif"),(0,r.preloadImg)("images/2/New-Moon.gif"),(0,r.preloadImg)("images/2/First-Quarter.gif"),this.timing.totalScreens=1}async getData(e){super.getData(e);const t=e??this.weatherParameters,{sun:s,moon:r}=this.calcSunMoonData(t);this.data={sun:s,moon:r},this.setStatus(a.default.loaded),this.getDataCallback()}calcSunMoonData(e){const t=[SunCalc.getTimes(new Date,e.latitude,e.longitude),SunCalc.getTimes(n.DateTime.local().plus({days:1}).toJSDate(),e.latitude,e.longitude)],s=[];let r=n.DateTime.local().minus({days:1}),{phase:a}=SunCalc.getMoonIllumination(r.toJSDate()),i=0;do{const e=a;r=r.plus({days:1}),a=SunCalc.getMoonIllumination(r.toJSDate()).phase,e<.25&&a>=.25&&s.push(this.getMoonTransition(.25,"First",r)),e<.5&&a>=.5&&s.push(this.getMoonTransition(.5,"Full",r)),e<.75&&a>=.75&&s.push(this.getMoonTransition(.75,"Last",r)),e>a&&s.push(this.getMoonTransition(0,"New",r)),i+=1}while(i<=30&&s.length<4);return{sun:t,moon:s}}getMoonTransition(e,t,s,r=0){let n=s,{phase:a}=SunCalc.getMoonIllumination(n.toJSDate()),i=0;const o={hours:0===r?-1:0,minutes:1===r?1:0,seconds:2===r?-1:0,milliseconds:3===r?1:0};let l=(t,s)=>t<e&&s>=e;r%2==0&&(l=(t,s)=>t>e&&s<=e);do{const s=a;if(n=n.plus(o),a=SunCalc.getMoonIllumination(n.toJSDate()).phase,a>.9&&(a-=1),l(s,a)){if(r>=3)break;return this.getMoonTransition(e,t,n,r+1)}i+=1}while(i<1e3);return{phase:t,date:n}}async drawCanvas(){super.drawCanvas();const e=this.data,t=n.DateTime.local(),s=t.plus({days:1});this.elem.querySelector(".day-1").innerHTML=t.toLocaleString({weekday:"long"}),this.elem.querySelector(".day-2").innerHTML=s.toLocaleString({weekday:"long"}),this.elem.querySelector(".rise-1").innerHTML=n.DateTime.fromJSDate(e.sun[0].sunrise).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".rise-2").innerHTML=n.DateTime.fromJSDate(e.sun[1].sunrise).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-1").innerHTML=n.DateTime.fromJSDate(e.sun[0].sunset).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-2").innerHTML=n.DateTime.fromJSDate(e.sun[1].sunset).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase();const r=e.moon.map((e=>{const t={},s=e.date.toLocaleString({month:"short",day:"numeric"});return t.date=s,t.type=e.phase,t.icon={type:"img",src:l.imageName(e.Phase)},this.fillTemplate("day",t)})),a=this.elem.querySelector(".moon .days");a.innerHTML="",a.append(...r),this.finishDraw()}static imageName(e){switch(e){case"Full":return"images/2/Full-Moon.gif";case"Last":return"images/2/Last-Quarter.gif";case"New":return"images/2/New-Moon.gif";default:return"images/2/First-Quarter.gif"}}async getSun(){return new Promise((e=>{this.data&&e(this.data),this.getDataCallbacks.push(e)}))}}const u=new l(7,"almanac");(0,o.registerDisplay)(u);const c=u.getSun.bind(u)},"./server/scripts/modules/currentweather.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>f});var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/image.mjs"),a=s("./server/scripts/modules/utils/fetch.mjs"),i=s("./server/scripts/modules/utils/calc.mjs"),o=s("./server/scripts/modules/utils/string.mjs"),l=s("./server/scripts/modules/icons.mjs"),u=s("./server/scripts/modules/weatherdisplay.mjs"),c=s("./server/scripts/modules/navigation.mjs"),d=s("./server/scripts/modules/utils/units.mjs");class m extends u.default{constructor(e,t){super(e,t,"Current Conditions",!0),this.backgroundImage=(0,n.loadImg)("images/BackGround1_1.png")}async getData(e){super.getData(e);const t=e??this.weatherParameters;let s,i,o=0;for(;!s&&o<t.stations.length;){i=t.stations[o],o+=1;try{if(s=await(0,a.json)(`${i.id}/observations`,{cors:!0,data:{limit:2}}),null===s.features[0].properties.temperature.value||null===s.features[0].properties.windSpeed.value||null===s.features[0].properties.textDescription)throw s=void 0,new Error(`Unable to get observations: ${i.properties.stationIdentifier}, trying next station`)}catch(e){console.error(e)}}if(!s)return console.error("All current weather stations exhausted"),void this.setStatus(r.default.failed);(0,n.preloadImg)((0,l.getWeatherIconFromIconLink)(s.features[0].properties.icon)),this.data={...s,station:i},this.setStatus(r.default.loaded),this.getDataCallback()}parseData(){if(!this.data)return!1;const e={},t=this.data.features[0].properties;e.observations=t,e.Temperature=Math.round(t.temperature.value),e.TemperatureUnit="C",e.DewPoint=Math.round(t.dewpoint.value),e.Ceiling=Math.round(t.cloudLayers[0]?.base?.value??0),e.CeilingUnit="m.",e.Visibility=Math.round(t.visibility.value/1e3),e.VisibilityUnit=" km.",e.WindSpeed=Math.round(t.windSpeed.value),e.WindDirection=(0,i.directionToNSEW)(t.windDirection.value),e.Pressure=Math.round(t.barometricPressure.value),e.HeatIndex=Math.round(t.heatIndex.value),e.WindChill=Math.round(t.windChill.value),e.WindGust=Math.round(t.windGust.value),e.WindUnit="KPH",e.Humidity=Math.round(t.relativeHumidity.value),e.Icon=(0,l.getWeatherIconFromIconLink)(t.icon),e.PressureDirection="",e.TextConditions=t.textDescription,e.station=this.data.station;const s=t.barometricPressure.value-this.data.features[1].properties.barometricPressure.value;return s>150&&(e.PressureDirection="R"),s<-150&&(e.PressureDirection="F"),e.Temperature=(0,d.celsiusToFahrenheit)(e.Temperature),e.TemperatureUnit="F",e.DewPoint=(0,d.celsiusToFahrenheit)(e.DewPoint),e.Ceiling=100*Math.round((0,d.metersToFeet)(e.Ceiling)/100),e.CeilingUnit="ft.",e.Visibility=(0,d.kilometersToMiles)(t.visibility.value/1e3),e.VisibilityUnit=" mi.",e.WindSpeed=(0,d.kphToMph)(e.WindSpeed),e.WindUnit="MPH",e.Pressure=(0,d.pascalToInHg)(e.Pressure).toFixed(2),e.HeatIndex=(0,d.celsiusToFahrenheit)(e.HeatIndex),e.WindChill=(0,d.celsiusToFahrenheit)(e.WindChill),e.WindGust=(0,d.kphToMph)(e.WindGust),e}async drawCanvas(){super.drawCanvas();const e={},t=this.parseData();e.temp=t.Temperature+String.fromCharCode(176);let s=t.observations.textDescription;s.length>15&&(s=this.shortConditions(s)),e.condition=s,e.wind=t.WindDirection.padEnd(3,"")+t.WindSpeed.toString().padStart(3," "),t.WindGust&&(e["wind-gusts"]=`Gusts to ${t.WindGust}`),e.location=(0,o.locationCleanup)(this.data.station.properties.name).substr(0,20),e.humidity=`${t.Humidity}%`,e.dewpoint=t.DewPoint+String.fromCharCode(176),e.ceiling=0===t.Ceiling?"Unlimited":t.Ceiling+t.CeilingUnit,e.visibility=t.Visibility+t.VisibilityUnit,e.pressure=`${t.Pressure} ${t.PressureDirection}`,t.observations.heatIndex.value&&t.HeatIndex!==t.Temperature?(e["heat-index-label"]="Heat Index:",e["heat-index"]=t.HeatIndex+String.fromCharCode(176)):t.observations.windChill.value&&""!==t.WindChill&&t.WindChill<t.Temperature&&(e["heat-index-label"]="Wind Chill:",e["heat-index"]=t.WindChill+String.fromCharCode(176)),e.icon={type:"img",src:t.Icon};const r=this.elem.querySelector(".main");r.innerHTML="",r.append(this.fillTemplate("weather",e)),this.finishDraw()}async getCurrentWeather(){return new Promise((e=>{this.data&&e(this.parseData()),this.getDataCallbacks.push((()=>e(this.parseData())))}))}static shortConditions(e){let t=e;return t=t.replace(/Light/g,"L"),t=t.replace(/Heavy/g,"H"),t=t.replace(/Partly/g,"P"),t=t.replace(/Mostly/g,"M"),t=t.replace(/Few/g,"F"),t=t.replace(/Thunderstorm/g,"T'storm"),t=t.replace(/ in /g,""),t=t.replace(/Vicinity/g,""),t=t.replace(/ and /g," "),t=t.replace(/Freezing Rain/g,"Frz Rn"),t=t.replace(/Freezing/g,"Frz"),t=t.replace(/Unknown Precip/g,""),t=t.replace(/L Snow Fog/g,"L Snw/Fog"),t=t.replace(/ with /g,"/"),t}}const h=new m(0,"current-weather");(0,c.registerDisplay)(h);const f=h.getCurrentWeather.bind(h)},"./server/scripts/modules/currentweatherscroll.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/string.mjs"),n=s("./server/scripts/modules/utils/elem.mjs"),a=s("./server/scripts/modules/currentweather.mjs"),i=s("./server/scripts/modules/navigation.mjs");const o=String.fromCharCode(176);let l,u=0;const c=()=>{const e=(0,i.currentDisplay)();e?.okToDrawCurrentConditions?(u=(u+1)%m.length,d()):"progress"===e?.elemId&&(u=0)},d=async()=>{const e=await(0,a.default)();e&&h(m[u](e))},m=[e=>`Conditions at ${(0,r.locationCleanup)(e.station.properties.name).substr(0,20)}`,e=>{let t=`Temp: ${e.Temperature}${o} ${e.TemperatureUnit}`;return e.observations.heatIndex.value?t+=` Heat Index: ${e.HeatIndex}${o} ${e.TemperatureUnit}`:e.observations.windChill.value&&(t+=` Wind Chill: ${e.WindChill}${o} ${e.TemperatureUnit}`),t},e=>`Humidity: ${e.Humidity}${o} ${e.TemperatureUnit} Dewpoint: ${e.DewPoint}${o} ${e.TemperatureUnit}`,e=>`Barometric Pressure: ${e.Pressure} ${e.PressureDirection}`,e=>{let t="";return t=e.WindSpeed>0?`Wind: ${e.WindDirection} ${e.WindSpeed} ${e.WindUnit}`:"Wind: Calm",e.WindGust>0&&(t+=` Gusts to ${e.WindGust}`),t},e=>`Visib: ${e.Visibility} ${e.VisibilityUnit} Ceiling: ${0===e.Ceiling?"Unlimited":`${e.Ceiling} ${e.CeilingUnit}`}`],h=e=>{(0,n.elemForEach)(".weather-display .scroll .fixed",(t=>{t.innerHTML=e}))};document.addEventListener("DOMContentLoaded",(()=>{l||(l=setInterval(c,4e3)),d()}))},"./server/scripts/modules/extendedforecast.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/vendor/auto/luxon.mjs"),i=s("./server/scripts/modules/icons.mjs"),o=s("./server/scripts/modules/utils/image.mjs"),l=s("./server/scripts/modules/weatherdisplay.mjs"),u=s("./server/scripts/modules/navigation.mjs");class c extends l.default{constructor(e,t){super(e,t,"Extended Forecast",!0),this.timing.totalScreens=2}async getData(e){super.getData(e);const t=e??this.weatherParameters;let s;try{s=await(0,n.json)(t.forecast,{data:{units:"us"}})}catch(e){return console.error("Unable to get extended forecast"),console.error(e.status,e.responseJSON),void this.setStatus(r.default.failed)}this.data=c.parse(s.properties.periods),this.screenIndex=0,this.setStatus(r.default.loaded)}static parse(e){const t=[0,1,2,3,4,5,6].map((e=>a.DateTime.local().startOf("day").plus({days:e}).toLocaleString({weekday:"short"})));let s=0;const r=[];return e.forEach((e=>{r[s]||r.push({dayName:"",low:void 0,high:void 0,text:void 0,icon:void 0});const n=r[s];n.icon=(0,i.getWeatherIconFromIconLink)(e.icon),n.text=c.shortenExtendedForecastText(e.shortForecast),n.dayName=t[s],(0,o.preloadImg)(n.icon),e.isDaytime?(n.high=e.temperature,s+=1):n.low=e.temperature})),r}static shortenExtendedForecastText(e){const t=[[/ and /gi," "],[/Slight /gi,""],[/Chance /gi,""],[/Very /gi,""],[/Patchy /gi,""],[/Areas /gi,""],[/Dense /gi,""],[/Thunderstorm/g,"T'Storm"]].reduce(((e,[t,s])=>e.replace(t,s)),e);let s=t.split(" ");-1!==t.indexOf("then")&&(s=t.split(" then "),s=s[1].split(" "));let r=s[0].substr(0,10),n="";s[1]&&(r.endsWith(".")?r=r.replace(/\./,""):n=s[1].substr(0,10),"Blowing"===n&&(n=""));let a=r;return""!==n&&(a+=` ${n}`),a}async drawCanvas(){super.drawCanvas();const e=this.data.slice(0+3*this.screenIndex,3+3*this.screenIndex).map((e=>{const t={};t.date=e.dayName;const{low:s}=e;void 0!==s&&(t["value-lo"]=Math.round(s));const{high:r}=e;return t["value-hi"]=Math.round(r),t.condition=e.text,t.icon={type:"img",src:e.icon},this.fillTemplate("day",t)})),t=this.elem.querySelector(".day-container");t.innerHTML="",t.append(...e),this.finishDraw()}}(0,u.registerDisplay)(new c(6,"extended-forecast"))},"./server/scripts/modules/hourly.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/utils/fetch.mjs"),i=s("./server/scripts/modules/utils/units.mjs"),o=s("./server/scripts/modules/icons.mjs"),l=s("./server/scripts/modules/utils/calc.mjs"),u=s("./server/scripts/modules/weatherdisplay.mjs"),c=s("./server/scripts/modules/navigation.mjs"),d=s("./server/scripts/modules/almanac.mjs");class m extends u.default{constructor(e,t,s){super(e,t,"Hourly Forecast",s),this.timing.baseDelay=20;this.timing.delay=[450];for(let e=0;e<4;e+=1)this.timing.delay.push(300);this.timing.delay.push(150)}async getData(e){if(!super.getData(e))return;let t;try{t=await(0,a.json)(e.forecastGridData)}catch(e){return console.error("Get hourly forecast failed"),console.error(e.status,e.responseJSON),void this.setStatus(r.default.failed)}this.data=await m.parseForecast(t.properties),this.setStatus(r.default.loaded),this.drawLongCanvas()}static async parseForecast(e){const t=m.expand(e.temperature.values),s=m.expand(e.apparentTemperature.values),r=m.expand(e.windSpeed.values),n=m.expand(e.windDirection.values),a=m.expand(e.skyCover.values),o=m.expand(e.weather.values),u=m.expand(e.iceAccumulation.values),c=m.expand(e.probabilityOfPrecipitation.values),d=m.expand(e.snowfallAmount.values),h=await m.determineIcon(a,o,u,c,d,r);return t.map(((e,a)=>({temperature:(0,i.celsiusToFahrenheit)(t[a]),apparentTemperature:(0,i.celsiusToFahrenheit)(s[a]),windSpeed:(0,i.kilometersToMiles)(r[a]),windDirection:(0,l.directionToNSEW)(n[a]),icon:h[a]})))}static async determineIcon(e,t,s,r,a,i){const l=n.DateTime.local().startOf("hour"),u=(await(0,d.default)()).sun,c=n.Interval.fromDateTimes(n.DateTime.fromJSDate(u[0].sunset),n.DateTime.fromJSDate(u[1].sunrise)),m=n.DateTime.fromJSDate(u[1].sunset);return e.map(((n,u)=>{const d=l.plus({hours:u}),h=c.contains(d)||d>m;return(0,o.getHourlyIcon)(e[u],t[u],s[u],r[u],a[u],i[u],h)}))}static expand(e){const t=n.DateTime.utc().startOf("hour").toMillis(),s=[];return e.forEach((e=>{let r=Date.parse(e.validTime.substr(0,e.validTime.indexOf("/")));const a=r+n.Duration.fromISO(e.validTime.substr(e.validTime.indexOf("/")+1)).shiftTo("milliseconds").values.milliseconds;do{r>=t&&s.length<24&&s.push(e.value),r+=36e5}while(r<a&&s.length<24)})),s}async drawLongCanvas(){const e=this.elem.querySelector(".hourly-lines");e.innerHTML="";const t=n.DateTime.local(),s=this.data.map(((e,s)=>{const r={},n=t.plus({hours:s}).toLocaleString({weekday:"short",hour:"numeric"});r.hour=n;const a=Math.round(e.temperature).toString().padStart(3),i=Math.round(e.apparentTemperature).toString().padStart(3);r.temp=a,a!==i&&(r.like=i);let o="Calm";if(e.windSpeed>0){const t=Math.round(e.windSpeed).toString();o=e.windDirection+Array(6-e.windDirection.length-t.length).join(" ")+t}return r.wind=o,r.icon={type:"img",src:e.icon},this.fillTemplate("hourly-row",r)}));e.append(...s)}drawCanvas(){super.drawCanvas(),this.finishDraw()}showCanvas(){this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".hourly-lines").getBoundingClientRect().height-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}static getTravelCitiesDayName(e){return e.reduce(((e,t)=>{if(t&&""===e){return n.DateTime.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"")}}(0,c.registerDisplay)(new m(2,"hourly"))},"./server/scripts/modules/icons.mjs":(e,t,s)=>{s.r(t),s.d(t,{getHourlyIcon:()=>a,getWeatherIconFromIconLink:()=>n,getWeatherRegionalIconFromIconLink:()=>r});const r=(e,t)=>{const s=t??e.indexOf("/night/")>=0,r=e=>`images/r/${e}`;let n=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[,?&.]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===n){const t=e.match(/&j=(.*)&/);[,n]=t}switch(n+(s?"-n":"")){case"skc":case"hot":case"haze":return r("Sunny.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return r("Clear-1992.gif");case"bkn":return r("Mostly-Cloudy-1994-2.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":return r("Partly-Clear-1994-2.gif");case"sct":case"few":return r("Partly-Cloudy.gif");case"sct-n":case"nsct":case"nsct-n":return r("Mostly-Clear.gif");case"ovc":case"ovc-n":return r("Cloudy.gif");case"fog":case"fog-n":return r("Fog.gif");case"rain_sleet":case"sleet":case"sleet-n":return r("Sleet.gif");case"rain_showers":case"rain_showers_high":return r("Scattered-Showers-1994-2.gif");case"rain_showers-n":case"rain_showers_high-n":return r("Scattered-Showers-Night-1994-2.gif");case"rain":case"rain-n":return r("Rain-1992.gif");case"snow":case"snow-n":return r(a>50?"Heavy-Snow-1994-2.gif":"Light-Snow.gif");case"rain_snow":return r("Rain-Snow-1992.gif");case"snow_fzra":case"snow_fzra-n":return r("Freezing-Rain-Snow-1992.gif");case"fzra":case"fzra-n":return r("Freezing-Rain-1992.gif");case"snow_sleet":case"snow_sleet-n":return r("Snow and Sleet.gif");case"tsra_sct":case"tsra":return r("Scattered-Tstorms-1994-2.gif");case"tsra_sct-n":case"tsra-n":return r("Scattered-Tstorms-Night-1994-2.gif");case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":return r("Thunderstorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":return r("Wind.gif");case"wind_skc":return r("Sunny-Wind-1994.gif");case"wind_skc-n":case"wind_sct-n":return r("Clear-Wind-1994.gif");case"blizzard":return r("Blowing Snow.gif");case"cold":return r("cold.gif");default:return console.log(`Unable to locate regional icon for ${n} ${e} ${s}`),!1}},n=(e,t)=>{if(!e)return!1;const s=e=>`images/${e}`,r=t??e.indexOf("/night/")>=0;let n=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[,?&.]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===n){const t=e.match(/&j=(.*)&/);[,n]=t}switch(n+(r?"-n":"")){case"skc":case"hot":case"haze":case"cold":return s("CC_Clear1.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return s("CC_Clear0.gif");case"sct":case"few":case"bkn":return s("CC_PartlyCloudy1.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":case"sct-n":case"nsct":case"nsct-n":return s("CC_PartlyCloudy0.gif");case"ovc":case"novc":case"ovc-n":return s("CC_Cloudy.gif");case"fog":case"fog-n":return s("CC_Fog.gif");case"rain_sleet":return s("Sleet.gif");case"rain_showers":case"rain_showers_high":case"rain_showers-n":case"rain_showers_high-n":return s("CC_Showers.gif");case"rain":case"rain-n":return s("CC_Rain.gif");case"snow":case"snow-n":return s(a>50?"CC_Snow.gif":"CC_SnowShowers.gif");case"rain_snow":return s("CC_RainSnow.gif");case"snow_fzra":case"snow_fzra-n":case"fzra":case"fzra-n":return s("CC_FreezingRain.gif");case"snow_sleet":return s("Snow-Sleet.gif");case"tsra_sct":case"tsra":return s("EF_ScatTstorms.gif");case"tsra_sct-n":case"tsra-n":case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":return s("CC_TStorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":case"wind_skc":case"wind_skc-n":case"wind_sct-n":return s("CC_Windy.gif");case"blizzard":return s("Blowing-Snow.gif");default:return console.log(`Unable to locate icon for ${n} ${e} ${r}`),!1}},a=(e,t,s,r,n,a,i=!1)=>{const o=e=>`images/r/${e}`;let l=!1,u=!1,c=!1,d=!1,m=!1;return t.forEach((e=>{e.weather&&(e.weather.toLowerCase().includes("thunder")&&(l=!0),e.weather.toLowerCase().includes("snow")&&(u=!0),e.weather.toLowerCase().includes("ice")&&(c=!0),e.weather.toLowerCase().includes("fog")&&(d=!0),e.weather.toLowerCase().includes("wind")&&(m=!0))})),o(s>0||c?"Freezing-Rain-1992.gif":n>10?a>30||m?"Blowing Snow.gif":"Heavy-Snow-1994.gif":(n>0||u)&&l?"ThunderSnow.gif":n>0||u?"Light-Snow.gif":l?"Thunderstorm.gif":r>70?"Rain-1992.gif":r>50?"Shower.gif":r>30?i?"Scattered-Showers-Night.gif":"Scattered-Showers-1994.gif":d?"Fog.gif":e>70?"Cloudy.gif":e>50?i?"Partly-Clear-1994.gif":"Mostly-Cloudy-1994.gif":e>30?i?"Mostly-Clear.gif":"Partly-Cloudy.gif":i?"Clear-1992.gif":"Sunny.gif")}},"./server/scripts/modules/latestobservations.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/calc.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/modules/status.mjs"),i=s("./server/scripts/modules/utils/string.mjs"),o=s("./server/scripts/modules/utils/units.mjs"),l=s("./server/scripts/modules/weatherdisplay.mjs"),u=s("./server/scripts/modules/navigation.mjs");class c extends l.default{constructor(e,t){super(e,t,"Latest Observations",!0),this.MaximumRegionalStations=7}async getData(e){super.getData(e);const t=e??this.weatherParameters,s=Object.keys(StationInfo).map((e=>{const s=StationInfo[e],n=(0,r.distance)(s.lat,s.lon,t.latitude,t.longitude);return{...s,distance:n}})).sort(((e,t)=>e.distance-t.distance)).slice(0,30),i=(await Promise.all(s.map((async e=>{try{const t=await(0,n.json)(`https://api.weather.gov/stations/${e.id}/observations/latest`);return null!==t.properties.temperature.value&&""!==t.properties.textDescription&&null!==t.properties.windSpeed.value&&{...t.properties,StationId:e.id,city:e.city}}catch(t){return console.log(`Unable to get latest observations for ${e.id}`),!1}})))).filter((e=>e));this.data=i.slice(0,this.MaximumRegionalStations),this.data.length<1?this.setStatus(a.default.noData):this.setStatus(a.default.loaded)}async drawCanvas(){super.drawCanvas();const e=this.data.sort(((e,t)=>e.Name<t.Name?-1:1));this.elem.querySelector(".column-headers .temp.english").classList.add("show"),this.elem.querySelector(".column-headers .temp.metric").classList.remove("show");const t=e.map((e=>{const t=(0,r.directionToNSEW)(e.windDirection.value),s=Math.round((0,o.celsiusToFahrenheit)(e.temperature.value)),n=Math.round((0,o.kphToMph)(e.windSpeed.value)),a={};return a.location=(0,i.locationCleanup)(e.city).substr(0,14),a.temp=s,a.weather=c.shortenCurrentConditions(e.textDescription).substr(0,9),a.wind=n>0?t+Array(6-t.length-n.toString().length).join(" ")+n.toString():"NA"===n?"NA":"Calm",this.fillTemplate("observation-row",a)})),s=this.elem.querySelector(".observation-lines");s.innerHTML="",s.append(...t),this.finishDraw()}static shortenCurrentConditions(e){let t=e;return t=t.replace(/Light/,"L"),t=t.replace(/Heavy/,"H"),t=t.replace(/Partly/,"P"),t=t.replace(/Mostly/,"M"),t=t.replace(/Few/,"F"),t=t.replace(/Thunderstorm/,"T'storm"),t=t.replace(/ in /,""),t=t.replace(/Vicinity/,""),t=t.replace(/ and /," "),t=t.replace(/Freezing Rain/,"Frz Rn"),t=t.replace(/Freezing/,"Frz"),t=t.replace(/Unknown Precip/,""),t=t.replace(/L Snow Fog/,"L Snw/Fog"),t=t.replace(/ with /,"/"),t}}(0,u.registerDisplay)(new c(1,"latest-observations"))},"./server/scripts/modules/localforecast.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/modules/weatherdisplay.mjs"),i=s("./server/scripts/modules/navigation.mjs");class o extends a.default{constructor(e,t){super(e,t,"Local Forecast",!0),this.timing.baseDelay=5e3}async getData(e){super.getData(e);const t=e??this.weatherParameters,s=await this.getRawData(t);if(!s)return void this.setStatus(r.default.failed);const n=o.parse(s);this.screenTexts=n.map((e=>{let t=`${e.DayName.toUpperCase()}...`;return t+=e.Text.toUpperCase().replace("..."," "),t}));const a=this.screenTexts.map((e=>this.fillTemplate("forecast",{text:e}))),i=this.elem.querySelector(".forecasts");i.innerHTML="",i.append(...a),this.pageHeight=i.parentNode.getBoundingClientRect().height,a.forEach((e=>{const t=Math.ceil(e.scrollHeight/this.pageHeight)*this.pageHeight;e.style.height=`${t}px`})),this.timing.totalScreens=i.scrollHeight/this.pageHeight,this.calcNavTiming(),this.setStatus(r.default.loaded)}async getRawData(e){try{return await(0,n.json)(e.forecast,{data:{units:"us"}})}catch(t){return console.error(`GetWeatherForecast failed: ${e.forecast}`),console.error(t.status,t.responseJSON),this.setStatus(r.default.failed),!1}}async drawCanvas(){super.drawCanvas();const e=-this.screenIndex*this.pageHeight;this.elem.querySelector(".forecasts").style.top=`${e}px`,this.finishDraw()}static parse(e){return e.properties.periods.slice(0,6).map((e=>({DayName:e.name.toUpperCase(),Text:e.detailedForecast})))}}(0,i.registerDisplay)(new o(5,"local-forecast"))},"./server/scripts/modules/navigation.mjs":(e,t,s)=>{s.r(t),s.d(t,{currentDisplay:()=>M,displayNavMessage:()=>b,getDisplay:()=>k,isPlaying:()=>S,latLonReceived:()=>_,message:()=>p,msg:()=>T,registerDisplay:()=>O,registerProgress:()=>j,registerRefreshData:()=>B,resetStatuses:()=>N,resize:()=>E,stopAutoRefreshTimer:()=>P,updateStatus:()=>y});var r=s("./server/scripts/modules/utils/nosleep.mjs"),n=s("./server/scripts/modules/status.mjs"),a=s("./server/scripts/modules/utils/calc.mjs"),i=s("./server/scripts/modules/utils/fetch.mjs"),o=s("./server/scripts/modules/utils/weather.mjs");document.addEventListener("DOMContentLoaded",(()=>{g()}));const l=[];let u,c=!1;const d={},m=6e5;let h=null,f=0;const g=async()=>{window.addEventListener("resize",E);const e=localStorage.getItem("TwcAutoRefresh");document.getElementById("chkAutoRefresh").checked=!e||"true"===e,document.getElementById("chkAutoRefresh").addEventListener("change",V),F()},p=e=>{if(e.type)if("navButton"===e.type)L(e.message);else console.error(`Unknown event ${e.type}`)},y=e=>{e.id<0||u&&(u.drawCanvas(l,v()),S()&&0===e.id&&e.status===n.default.loaded&&C(T.command.firstFrame),v()<l.length||H(new Date))},v=()=>l.reduce(((e,t)=>t.status!==n.default.loading?e+1:e),0),w=()=>{l.forEach((e=>e.hideCanvas()))},S=()=>c,T={response:{previous:Symbol("previous"),inProgress:Symbol("inProgress"),next:Symbol("next")},command:{firstFrame:Symbol("firstFrame"),previousFrame:Symbol("previousFrame"),nextFrame:Symbol("nextFrame"),lastFrame:Symbol("lastFrame")}},b=e=>{e.type===T.response.previous&&I(-1),e.type===T.response.next&&I(1)},C=e=>{const t=M();if(u.hideCanvas(),t)e===T.command.nextFrame&&M().navNext(),e===T.command.previousFrame&&M().navPrev();else{let e,t=0;do{l[t].status===n.default.loaded&&(e=l[t]),t+=1}while(!e&&t<l.length);if(!e)return;e.navNext(T.command.firstFrame)}},I=e=>{const t=l.length,s=D();let r;for(let i=0;i<t&&(r=(0,a.wrap)(s+(i+1)*e,t),l[r].status!==n.default.loaded);i+=1);if(r<=s&&R())return;const i=l[r];w(),e<0&&i.showCanvas(T.command.lastFrame),e>0&&i.showCanvas(T.command.firstFrame)},D=()=>l.findIndex((e=>e.isActive())),M=()=>l[D()],x=e=>{c=e;const t=document.getElementById("NavigatePlay");localStorage.setItem("TwcPlay",c),c?((0,r.default)(!0),t.title="Pause",t.src="images/nav/ic_pause_white_24dp_1x.png"):((0,r.default)(!1),t.title="Play",t.src="images/nav/ic_play_arrow_white_24dp_1x.png"),u&&c&&!M()&&C(T.command.firstFrame)},L=e=>{switch(e){case"play":x(!0);break;case"playToggle":x(!c);break;case"stop":x(!1);break;case"next":x(!1),C(T.command.nextFrame);break;case"previous":x(!1),C(T.command.previousFrame);break;case"menu":x(!1),u.showCanvas(),w();break;default:console.error(`Unknown navButton ${e}`)}},k=e=>l[e],E=()=>{const e=window.innerWidth/640,t=window.innerHeight/480,s=Math.min(e,t);s<1||document.fullscreenElement?document.getElementById("container").style.zoom=s:document.getElementById("container").style.zoom=1},N=()=>{l.forEach((e=>{e.status=n.default.loading}))},O=e=>{l[e.navId]=e,F()},F=()=>{const e=document.getElementById("enabledDisplays");if(!e)return;const t=l.map((e=>e.generateCheckbox())).filter((e=>e));e.innerHTML="",e.append(...t)},j=e=>{u=e},$=e=>{document.getElementById("spanCity").innerHTML=`${e.city}, `,document.getElementById("spanState").innerHTML=e.state,document.getElementById("spanStationId").innerHTML=e.stationId,document.getElementById("spanRadarId").innerHTML=e.radarId,document.getElementById("spanZoneId").innerHTML=e.zoneId},V=e=>{const{checked:t}=e.target;t?A():P(),localStorage.setItem("TwcAutoRefresh",t)},H=e=>{e?(document.getElementById("spanLastRefresh").innerHTML=e.toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}),document.getElementById("chkAutoRefresh").checked&&A()):document.getElementById("spanLastRefresh").innerHTML="(none)"},_=e=>{(async e=>{const t=await(0,o.getPoint)(e.lat,e.lon),s=await(0,i.json)(t.properties.observationStations),r=s.features[0].properties.stationIdentifier;let{city:n}=t.properties.relativeLocation.properties;r in StationInfo&&(n=StationInfo[r].city,[n]=n.split("/")),d.latitude=e.lat,d.longitude=e.lon,d.zoneId=t.properties.forecastZone.substr(-6),d.radarId=t.properties.radarStation.substr(-3),d.stationId=r,d.weatherOffice=t.properties.cwa,d.city=n,d.state=t.properties.relativeLocation.properties.state,d.timeZone=t.properties.relativeLocation.properties.timeZone,d.forecast=t.properties.forecast,d.forecastGridData=t.properties.forecastGridData,d.stations=s.features,$(d),w(),document.getElementById("loading").style.display="none",u&&(await u.drawCanvas(),u.showCanvas()),l.forEach((e=>e.getData(d)))})(e),H(null)},A=()=>{if(h)return;f=0;const e=()=>{f+=500;let e=m-f;e<0&&(e=0);const t=new Date(e);document.getElementById("spanRefreshCountDown").innerHTML=`${t.getMinutes()<10?`0${t.getMinutes()}`:t.getMinutes()}:${t.getSeconds()<10?`0${t.getSeconds()}`:t.getSeconds()}`,f>=m&&!S()&&z()};h=window.setInterval(e,500),e()},P=()=>{h&&(window.clearInterval(h),document.getElementById("spanRefreshCountDown").innerHTML="--:--",h=null)},R=()=>f>=m&&(z(),!0),z=()=>{z.callback&&z.callback()},B=e=>{z.callback=e}},"./server/scripts/modules/progress.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/image.mjs"),n=s("./server/scripts/modules/status.mjs"),a=s("./server/scripts/modules/weatherdisplay.mjs"),i=s("./server/scripts/modules/navigation.mjs");class o extends a.default{constructor(e,t){super(e,t,"",!1),this.backgroundImage=(0,r.loadImg)("images/BackGround1_1.png"),this.timing=!1,document.addEventListener("DOMContentLoaded",(()=>{this.version=document.getElementById("version").innerHTML,this.elem.querySelector(".container").addEventListener("click",this.lineClick.bind(this))})),this.okToDrawCurrentConditions=!1}async drawCanvas(e,t){if(super.drawCanvas(),this.progressCover||(this.progressCover=this.elem.querySelector(".scroll .cover")),!e)return;const s=e.map(((e,t)=>{const s={};let r;switch(s.name=e.name,e.status){case n.default.loading:r="loading";break;case n.default.loaded:r="press-here";break;case n.default.failed:r="failed";break;case n.default.noData:r="no-data";break;case n.default.disabled:r="disabled"}const a=this.fillTemplate("item",s);if(!a)return!1;const i=a.querySelector(".links");return i.classList.remove("loading"),i.classList.add(r),i.dataset.index=t,a})).filter((e=>e)),r=this.elem.querySelector(".container");r.innerHTML="",r.append(...s),this.finishDraw();const a=t/e.length;this.progressCover.style.width=100*(1-a)+"%",a<1?this.progressCover.parentNode.classList.add("show"):setTimeout((()=>this.progressCover.parentNode.classList.remove("show")),1e3)}lineClick(e){const t=e.target?.parentNode?.dataset?.index;if(void 0===t)return;const s=+t;(0,i.message)("navButton");const r=(0,i.getDisplay)(s);r&&r.status===n.default.loaded&&(r.showCanvas(i.msg.command.firstFrame),this.elem.classList.remove("show"))}}const l=new o(-1,"progress");(0,i.registerProgress)(l)},"./server/scripts/modules/radar.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/utils/image.mjs"),i=s("./server/scripts/modules/utils/fetch.mjs"),o=s("./server/scripts/modules/utils/cors.mjs"),l=s("./server/scripts/modules/weatherdisplay.mjs"),u=s("./server/scripts/modules/navigation.mjs");class c extends l.default{constructor(e,t){super(e,t,"Local Radar",!0),this.okToDrawCurrentConditions=!1,this.okToDrawCurrentDateTime=!1,this.dopplerRadarImageMax=6,this.timing.baseDelay=350,this.timing.delay=[{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:12,si:5}]}async getData(e){super.getData(e);const t=e??this.weatherParameters;if("AK"===t.state||"HI"===t.state)return void this.setStatus(r.default.noData);let s="images/4000RadarMap2.jpg";"HI"===t.State&&(s="images/HawaiiRadarMap2.png"),this.baseMap=await(0,a.loadImg)(s);const l=[];let u=n.DateTime.utc().minus({days:1}).startOf("day");for(;u<=n.DateTime.utc().startOf("day");)l.push(`https://mesonet.agron.iastate.edu/archive/data/${u.toFormat("yyyy/LL/dd")}/GIS/uscomp/`),u=u.plus({days:1});const d=(await Promise.all(l.map((async e=>{try{return await(0,i.text)(e,{cors:!0})}catch(e){return console.log("Unable to get list of radars"),console.error(e),this.setStatus(r.default.failed),!1}})))).filter((e=>e)).map(((e,t)=>{const s=(new DOMParser).parseFromString(e,"text/html"),r=s.createElement("base");r.href=l[t],s.head.append(r);const n=s.getElementsByTagName("a"),a=[];return Array.from(n).forEach((e=>{e.innerHTML?.includes(".png")&&e.innerHTML?.includes("n0r_")&&a.push(e.href)})),a})).flat(),m=d.sort(((e,t)=>Date(e)<Date(t)?-1:1)).slice(-this.dopplerRadarImageMax);let h=120,f=69;const g=2550;h*=2,f*=2;const p=c.getXYFromLatitudeLongitudeMap(t,240,138),y=document.createElement("canvas");y.width=g,y.height=1600;const v=y.getContext("2d");v.imageSmoothingEnabled=!1;const w=c.getXYFromLatitudeLongitudeDoppler(t,240,138),S=w.x/2,T=w.y/2,b=await Promise.all(m.map((async e=>{const t=document.createElement("canvas");t.width=640,t.height=367;const s=t.getContext("2d");s.imageSmoothingEnabled=!1;const r=await fetch((0,o.rewriteUrl)(e));if(!r.ok)throw new Error(`Unable to fetch radar error ${r.status} ${r.statusText} from ${r.url}`);const i=await r.blob(),l=e.match(/_(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)\./);let u;if(l){const[,e,t,s,r,a]=l;u=n.DateTime.fromObject({year:e,month:t,day:s,hour:r,minute:a},{zone:"UTC"}).setZone()}else u=n.DateTime.fromHTTP(r.headers.get("last-modified")).setZone();const d=await(0,a.loadImg)(i);v.clearRect(0,0,g,1600),v.drawImage(d,0,0,g,1600),s.drawImage(await this.baseMap,p.x,p.y,480,276,0,0,640,367);const m=document.createElement("canvas");m.width=640,m.height=367;const h=m.getContext("2d",{willReadFrequently:!0});h.imageSmoothingEnabled=!1,h.drawImage(y,S,T,240,163.1,0,0,640,367),c.removeDopplerRadarImageNoise(h),c.mergeDopplerRadarImage(s,h);const f=this.fillTemplate("frame",{map:{type:"img",src:t.toDataURL()}});return{canvas:t,time:u,elem:f}}))),C=this.elem.querySelector(".scroll-area");C.innerHTML="",C.append(...b.map((e=>e.elem))),this.timing.totalScreens=b.length,this.data=b.map((e=>e.canvas)),this.times=b.map((e=>e.time)),this.setStatus(r.default.loaded)}async drawCanvas(){super.drawCanvas();const e=this.times[this.screenIndex].toLocaleString(n.DateTime.TIME_SIMPLE),t=e.length>=8?e:` ${e}`;this.elem.querySelector(".header .right .time").innerHTML=t,this.elem.querySelector(".scroll-area").style.top=371*-this.screenIndex+"px",this.finishDraw()}static getXYFromLatitudeLongitudeMap(e,t,s){let r=0,n=0;return r=55.2*(51.75-e.latitude),r-=s,r>3200-2*s?r=3200-2*s:r<0&&(r=0),n=41.775*(-130.37-e.longitude)*-1,n-=t,n>5100-2*t?n=5100-2*t:n<0&&(n=0),{x:2*n,y:2*r}}static getXYFromLatitudeLongitudeDoppler(e,t,s){let r=0,n=0;return r=61.4481*(51-e.latitude),r-=s,r>6e3-2*s?r=6e3-2*s:r<0&&(r=0),n=42.1768*(-129.138-e.longitude)*-1,n-=t,n>2800-2*t?n=2800-2*t:n<0&&(n=0),{x:2*n,y:2*r}}static removeDopplerRadarImageNoise(e){const t=e.getImageData(0,0,e.canvas.width,e.canvas.height);for(let e=0;e<t.data.length;e+=4){let s=t.data[e],r=t.data[e+1],n=t.data[e+2],a=t.data[e+3];0===s&&0===r&&0===n||0===s&&236===r&&236===n||1===s&&160===r&&246===n||0===s&&0===r&&246===n?(s=0,r=0,n=0,a=0):0===s&&255===r&&0===n?(s=49,r=210,n=22,a=255):0===s&&200===r&&0===n?(s=0,r=142,n=0,a=255):0===s&&144===r&&0===n?(s=20,r=90,n=15,a=255):255===s&&255===r&&0===n?(s=10,r=40,n=10,a=255):231===s&&192===r&&0===n?(s=196,r=179,n=70,a=255):255===s&&144===r&&0===n?(s=190,r=72,n=19,a=255):214===s&&0===r&&0===n||255===s&&0===r&&0===n?(s=171,r=14,n=14,a=255):(192===s&&0===r&&0===n||255===s&&0===r&&255===n)&&(s=115,r=31,n=4,a=255),t.data[e]=s,t.data[e+1]=r,t.data[e+2]=n,t.data[e+3]=a}e.putImageData(t,0,0)}static mergeDopplerRadarImage(e,t){const s=e.getImageData(0,0,e.canvas.width,e.canvas.height),r=t.getImageData(0,0,t.canvas.width,t.canvas.height);for(let e=0;e<r.data.length;e+=4)s.data[e]<116&&s.data[e+1]<116&&s.data[e+2]<116&&(r.data[e]=0,r.data[e+1]=0,r.data[e+2]=0,r.data[e+3]=0);t.putImageData(r,0,0),e.drawImage(t.canvas,0,0)}}(0,u.registerDisplay)(new c(8,"radar"))},"./server/scripts/modules/regionalforecast.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/calc.mjs"),a=s("./server/scripts/modules/utils/fetch.mjs"),i=s("./server/scripts/modules/utils/units.mjs"),o=s("./server/scripts/modules/icons.mjs"),l=s("./server/scripts/modules/utils/image.mjs"),u=s("./server/scripts/vendor/auto/luxon.mjs"),c=s("./server/scripts/modules/weatherdisplay.mjs"),d=s("./server/scripts/modules/navigation.mjs");class m extends c.default{constructor(e,t){super(e,t,"Regional Forecast",!0),this.timing.totalScreens=3}async getData(e){super.getData(e);const t=e??this.weatherParameters;let s="images/Basemap2.png";"HI"===t.state?s="images/HawaiiRadarMap4.png":"AK"===t.state&&(s="images/AlaskaRadarMap6.png"),this.elem.querySelector(".map img").src=s;const u={x:240,y:117},c=m.getXYFromLatitudeLongitude(t.latitude,t.longitude,u.x,u.y,t.state),d=m.getMinMaxLatitudeLongitude(c.x,c.y,u.x,u.y,t.state);let h=2.5;"HI"===t.state&&(h=1);const f=Object.values(StationInfo).map((e=>({...e,targetDistance:h}))),g=[...RegionalCities,...f],p=[];g.forEach((e=>{if(e.lat>d.minLat&&e.lat<d.maxLat&&e.lon>d.minLon&&e.lon<d.maxLon-1){const t=e.targetDistance||1;p.reduce(((s,r)=>{const a=(0,n.distance)(e.lon,e.lat,r.lon,r.lat);return s&&a>=t}),!0)&&p.push(e)}}));const y=(await Promise.all(p.map((async e=>{try{if(!e.point)throw new Error("No pre-loaded point");const s=m.getRegionalObservation(e.point,e),r=await(0,a.json)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`),n=m.getXYForCity(e,d.maxLat,d.minLon,t.state),u=await s,c={daytime:!!u.icon.match(/\/day\//),temperature:(0,i.celsiusToFahrenheit)(u.temperature.value),name:m.formatCity(e.city),icon:u.icon,x:n.x,y:n.y};return(0,l.preloadImg)((0,o.getWeatherRegionalIconFromIconLink)(c.icon,!c.daytime)),[c,m.buildForecast(r.properties.periods[1],e,n),m.buildForecast(r.properties.periods[2],e,n)]}catch(t){return console.log(`No regional forecast data for '${e.name??e.city}'`),console.log(t),!1}})))).filter((e=>e));0!==y.length?(this.data={regionalData:y,offsetXY:u,sourceXY:c},this.setStatus(r.default.loaded)):this.setStatus(r.default.noData)}static buildForecast(e,t,s){return{daytime:e.isDaytime,temperature:e.temperature||0,name:m.formatCity(t.city),icon:e.icon,x:s.x,y:s.y,time:e.startTime}}static async getRegionalObservation(e,t){try{const e=(await(0,a.json)(`https://api.weather.gov/gridpoints/${t.point.wfo}/${t.point.x},${t.point.y}/stations`)).features[0].id,s=await(0,a.json)(`${e}/observations/latest`);return!!s.properties.icon&&((0,l.preloadImg)((0,o.getWeatherRegionalIconFromIconLink)(s.properties.icon,!s.properties.daytime)),s.properties)}catch(e){return console.log(`Unable to get regional observations for ${t.Name??t.city}`),console.error(e.status,e.responseJSON),!1}}static getXYFromLatitudeLongitude(e,t,s,r,n){if("AK"===n)return m.getXYFromLatitudeLongitudeAK(e,t,s,r);if("HI"===n)return m.getXYFromLatitudeLongitudeHI(e,t,s,r);let a=0,i=0;return a=55.2*(50.5-e),a-=r,a>1600-2*r?a=1600-2*r:a<0&&(a=0),i=41.775*(-127.5-t)*-1,i-=s,i>2550-2*s?i=2550-2*s:i<0&&(i=0),{x:i,y:a}}static getXYFromLatitudeLongitudeAK(e,t,s,r){let n=0,a=0;return n=56*(73-e),n-=r,n>1142-2*r?n=1142-2*r:n<0&&(n=0),a=25*(-175-t)*-1,a-=s,a>1200-2*s?a=1200-2*s:a<0&&(a=0),{x:a,y:n}}static getXYFromLatitudeLongitudeHI(e,t,s,r){let n=0,a=0;return n=55.2*(25-e),n-=r,n>571-2*r?n=571-2*r:n<0&&(n=0),a=41.775*(-164.5-t)*-1,a-=s,a>600-2*s?a=600-2*s:a<0&&(a=0),{x:a,y:n}}static getMinMaxLatitudeLongitude(e,t,s,r,n){if("AK"===n)return m.getMinMaxLatitudeLongitudeAK(e,t,s,r);if("HI"===n)return m.getMinMaxLatitudeLongitudeHI(e,t,s,r);return{minLat:-1*((t+2*r)/55.2-50.5),maxLat:-1*(t/55.2-50.5),minLon:-1*(-1*e/41.775+127.5),maxLon:-1*(-1*(e+2*s)/41.775+127.5)}}static getMinMaxLatitudeLongitudeAK(e,t,s,r){return{minLat:-1*((t+2*r)/56-73),maxLat:-1*(t/56-73),minLon:-1*(-1*e/25+175),maxLon:-1*(-1*(e+2*s)/25+175)}}static getMinMaxLatitudeLongitudeHI(e,t,s,r){return{minLat:-1*((t+2*r)/55.2-25),maxLat:-1*(t/55.2-25),minLon:-1*(-1*e/41.775+164.5),maxLon:-1*(-1*(e+2*s)/41.775+164.5)}}static getXYForCity(e,t,s,r){"AK"===r&&m.getXYForCityAK(e,t,s),"HI"===r&&m.getXYForCityHI(e,t,s);let n=57*(e.lon-s),a=70*(t-e.lat);return a<30&&(a=30),a>282&&(a=282),n<40&&(n=40),n>580&&(n=580),{x:n,y:a}}static getXYForCityAK(e,t,s){let r=37*(e.lon-s),n=70*(t-e.lat);return n<30&&(n=30),n>282&&(n=282),r<40&&(r=40),r>580&&(r=580),{x:r,y:n}}static getXYForCityHI(e,t,s){let r=57*(e.lon-s),n=70*(t-e.lat);return n<30&&(n=30),n>282&&(n=282),r<40&&(r=40),r>580&&(r=580),{x:r,y:n}}static formatCity(e){return e.match(/[^-;/\\,]*/)[0].substr(0,12)}drawCanvas(){super.drawCanvas();const{regionalData:e,sourceXY:t,offsetXY:s}=this.data,r=this.elem.querySelector(".title.dual .top"),n=this.elem.querySelector(".title.dual .bottom");if(0===this.screenIndex)r.innerHTML="Regional",n.innerHTML="Observations";else{const t=u.DateTime.fromISO(e[0][this.screenIndex].time).toLocaleString({weekday:"long"});r.innerHTML="Forecast for",e[0][this.screenIndex].daytime?n.innerHTML=t:n.innerHTML=`${t} Night`}const a=640/(2*s.x),i=this.elem.querySelector(".map");i.style.zoom=a,i.style.top=`-${t.y}px`,i.style.left=`-${t.x}px`;const l=e.map((e=>{const t={},s=e[this.screenIndex];t.icon={type:"img",src:(0,o.getWeatherRegionalIconFromIconLink)(s.icon,!s.daytime)},t.city=s.name;const{temperature:r}=s;t.temp=r;const n=this.fillTemplate("location",t);return n.style.left=`${s.x}px`,n.style.top=`${s.y}px`,n})),c=this.elem.querySelector(".location-container");c.innerHTML="",c.append(...l),this.finishDraw()}}(0,d.registerDisplay)(new m(4,"regional-forecast"))},"./server/scripts/modules/status.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});const r={loading:Symbol("loading"),loaded:Symbol("loaded"),failed:Symbol("failed"),noData:Symbol("noData"),disabled:Symbol("disabled")}},"./server/scripts/modules/travelforecast.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/modules/icons.mjs"),i=s("./server/scripts/vendor/auto/luxon.mjs"),o=s("./server/scripts/modules/weatherdisplay.mjs"),l=s("./server/scripts/modules/navigation.mjs");class u extends o.default{constructor(e,t,s){super(e,t,"Travel Forecast",s),this.timing.baseDelay=20;const r=TravelCities.length/4,n=Math.floor(r)-2,a=n%1;this.timing.delay=[450];for(let e=0;e<n;e+=1)this.timing.delay.push(300);0!==a&&this.timing.delay.push(Math.round(this.extra*this.cityHeight)),this.timing.delay.push(150)}async getData(){if(!super.getData())return;const e=TravelCities.map((async e=>{try{if(!e.point)throw new Error("No pre-loaded point");const t=await(0,n.json)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`),s=t.properties.periods[0].isDaytime?0:1;return{today:0===s,high:t.properties.periods[s].temperature,low:t.properties.periods[s+1].temperature,name:e.Name,icon:(0,a.getWeatherRegionalIconFromIconLink)(t.properties.periods[s].icon)}}catch(t){return console.error(`GetTravelWeather for ${e.Name} failed`),console.error(t.status,t.responseJSON),{name:e.Name,error:!0}}})),t=await Promise.all(e);this.data=t;this.data.reduce(((e,t)=>e||t.high),!1)?(this.setStatus(r.default.loaded),this.drawLongCanvas()):this.setStatus(r.default.noData)}async drawLongCanvas(){const e=this.elem.querySelector(".travel-lines");e.innerHTML="";const t=this.data.map((e=>{if(e.error)return!1;const t={};if(t.city=e,e.icon){t.city=e.name;const{low:s,high:r}=e,n=Math.round(s).toString(),a=Math.round(r).toString();t.low=n,t.high=a,t.icon={type:"img",src:e.icon}}else t.error="NO TRAVEL DATA AVAILABLE";return this.fillTemplate("travel-row",t)})).filter((e=>e));e.append(...t)}async drawCanvas(){super.drawCanvas();const e=this.data;this.elem.querySelector(".header .title.dual .bottom").innerHTML=`For ${u.getTravelCitiesDayName(e)}`,this.finishDraw()}async showCanvas(){await this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".travel-lines").getBoundingClientRect().height-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}static getTravelCitiesDayName(e){return e.reduce(((e,t)=>{if(t&&""===e){return i.DateTime.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"")}getLongCanvas(){return this.longCanvas}}(0,l.registerDisplay)(new u(3,"travel",!1))},"./server/scripts/modules/utils/calc.mjs":(e,t,s)=>{s.r(t),s.d(t,{directionToNSEW:()=>i,distance:()=>o,heatIndex:()=>n,relativeHumidity:()=>r,windChill:()=>a,wrap:()=>l});const r=(e,t)=>{const s=e,r=t;return Math.round(Math.exp(17.625*r/(243.04+r))/Math.exp(17.625*s/(243.04+s))*100)},n=(e,t)=>{const s=e,r=t;let n,a=.5*(s+61+1.2*(s-68)+.094*r);return s>=80&&(a=2.04901523*s-42.379+10.14333127*r-.22475541*s*r-.00683783*s*s-.05481717*r*r+.00122874*s*s*r+85282e-8*s*r*r-199e-8*s*s*r*r,r<13&&s>80&&s<112?(n=(13-r)/4*Math.sqrt((17-Math.abs(s-95))/17),a-=n):r>85&&s>80&&s<87&&(n=(r-85)/10*((87-s)/5),a+=n)),a<e&&(a=e),Math.round(a)},a=(e,t)=>{if("0"===t||"Calm"===t||"NA"===t)return"";const s=e,r=t;return Math.round(35.74+.6215*s-35.75*r**.16+.4275*s*r**.16)},i=e=>["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor(e/22.5+.5)%16],o=(e,t,s,r)=>Math.sqrt((s-e)**2+(r-t)**2),l=(e,t)=>(e%t+t)%t},"./server/scripts/modules/utils/cors.mjs":(e,t,s)=>{s.r(t),s.d(t,{rewriteUrl:()=>r});const r=e=>{let t=e;return t=t.replace("https://api.weather.gov/",window.location.href),t=t.replace("https://www.cpc.ncep.noaa.gov/",window.location.href),t}},"./server/scripts/modules/utils/elem.mjs":(e,t,s)=>{s.r(t),s.d(t,{elemForEach:()=>r});const r=(e,t)=>{[...document.querySelectorAll(e)].forEach(t)}},"./server/scripts/modules/utils/fetch.mjs":(e,t,s)=>{s.r(t),s.d(t,{blob:()=>o,json:()=>n,raw:()=>i,text:()=>a});var r=s("./server/scripts/modules/utils/cors.mjs");const n=(e,t)=>l(e,"json",t),a=(e,t)=>l(e,"text",t),i=(e,t)=>l(e,"",t),o=(e,t)=>l(e,"blob",t),l=async(e,t,s={})=>{const n={method:"GET",mode:"cors",type:"GET",...s};let a=e;!0===n.cors&&(a=(0,r.rewriteUrl)(e));const i=new URL(a,`${window.location.origin}/`);i.protocol="localhost"!==window.location.hostname?window.location.protocol:i.protocol,n.data&&Object.keys(n.data).forEach((e=>{const t=n.data[e];i.searchParams.append(e,t)}));const o=await fetch(i,n);if(!o.ok)throw new Error(`Fetch error ${o.status} ${o.statusText} while fetching ${o.url}`);switch(t){case"json":return o.json();case"text":return o.text();case"blob":return o.blob();default:return o}}},"./server/scripts/modules/utils/image.mjs":(e,t,s)=>{s.r(t),s.d(t,{loadImg:()=>a,preloadImg:()=>o});var r=s("./server/scripts/modules/utils/fetch.mjs"),n=s("./server/scripts/modules/utils/cors.mjs");const a=(e,t=!1)=>new Promise((s=>{const r=new Image;if(r.onload=e=>{s(e.target)},e instanceof Blob)r.src=window.URL.createObjectURL(e);else{let s=e;t&&(s=(0,n.rewriteUrl)(e)),r.src=s}})),i=[],o=e=>!i.includes(e)&&((0,r.blob)(e),!0)},"./server/scripts/modules/utils/nosleep.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>a});let r=!1;const n=(e=!1)=>(n.controller||(n.controller=new NoSleep),r!==e&&(r=e,e?n.controller.enable():n.controller.disable())),a=n},"./server/scripts/modules/utils/string.mjs":(e,t,s)=>{s.r(t),s.d(t,{locationCleanup:()=>r});const r=e=>[/^[A-Za-z ]+ \/ /,/^[A-Za-z ]+\//,/^[A-Za-z ]+, /].reduce(((e,t)=>e.replace(t,"")),e)},"./server/scripts/modules/utils/units.mjs":(e,t,s)=>{s.r(t),s.d(t,{celsiusToFahrenheit:()=>n,kilometersToMiles:()=>a,kphToMph:()=>r,metersToFeet:()=>i,pascalToInHg:()=>o});const r=e=>Math.round(e/1.60934),n=e=>Math.round(9*e/5+32),a=e=>Math.round(e/1.60934),i=e=>Math.round(e/.3048),o=e=>{return t=2953e-7*e,s=2,Number(`${Math.round(`${t}e${s}`)}e-${s}`);var t,s}},"./server/scripts/modules/utils/weather.mjs":(e,t,s)=>{s.r(t),s.d(t,{getPoint:()=>n});var r=s("./server/scripts/modules/utils/fetch.mjs");const n=async(e,t)=>{try{return await(0,r.json)(`https://api.weather.gov/points/${e},${t}`)}catch(s){return console.log(`Unable to get point ${e}, ${t}`),console.error(s),!1}}},"./server/scripts/modules/weatherdisplay.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>o});var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/utils/elem.mjs"),i=s("./server/scripts/modules/navigation.mjs");const o=class{constructor(e,t,s,n){this.navId=e,this.elemId=void 0,this.gifs=[],this.data=void 0,this.loadingStatus=r.default.loading,this.name=s??t,this.getDataCallbacks=[],this.defaultEnabled=n,this.okToDrawCurrentConditions=!0,this.okToDrawCurrentDateTime=!0,this.timing={totalScreens:1,baseDelay:9e3,delay:1},this.navBaseCount=0,this.screenIndex=-1,this.storeElemId(t),this.enabled?this.setStatus(r.default.loading):this.setStatus(r.default.disabled),this.startNavCount(),document.addEventListener("DOMContentLoaded",(()=>{this.loadTemplates()}))}generateCheckbox(e=!0){if("progress"===this.elemId)return!1;let t=window.localStorage.getItem(`${this.elemId}Enabled`);null===t&&(t=e),this.enabled="true"===t||!0===t,window.localStorage.setItem(`${this.elemId}Enabled`,this.enabled);const s=document.createElement("template");return s.innerHTML=`<label for="${this.elemId}Enabled">\n\t\t\t\t\t\t\t<input type="checkbox" value="true" id="${this.elemId}Enabled" name="${this.elemId}Enabled"${this.enabled?" checked":""}/>\n\t\t\t\t\t\t ${this.name}</label>`,s.content.firstChild.addEventListener("change",(e=>this.checkboxChange(e))),s.content.firstChild}checkboxChange(e){this.enabled=e.target.checked,window.localStorage.setItem(`${this.elemId}Enabled`,this.enabled),this.getData()}setStatus(e){this.status=e,(0,i.updateStatus)({id:this.navId,status:this.status})}get status(){return this.loadingStatus}set status(e){this.loadingStatus=e}storeElemId(e){this.elemId||(this.elemId=e)}getData(e){return this.data=void 0,e&&(this.weatherParameters=e),this.enabled?(this.setStatus(r.default.loading),this.calcNavTiming(),!0):(this.setStatus(r.default.disabled),!1)}getDataCallback(){this.getDataCallbacks.forEach((e=>e(this.data))),this.getDataCallbacks=[]}drawCanvas(){this.screenIndex<0&&(this.screenIndex=0)}finishDraw(){this.okToDrawCurrentDateTime&&(this.drawCurrentDateTime(),this.dateTimeInterval||setInterval((()=>this.drawCurrentDateTime()),100))}drawCurrentDateTime(){if(!this.isActive())return;const e=n.DateTime.local(),t=e.toLocaleString(n.DateTime.TIME_WITH_SECONDS).padStart(11," ");this.lastTime!==t&&(0,a.elemForEach)(".date-time.time",(e=>{e.innerHTML=t.toUpperCase()})),this.lastTime=t;const s=e.toFormat(" ccc LLL ")+e.day.toString().padStart(2," ");this.lastDate!==s&&(0,a.elemForEach)(".date-time.date",(e=>{e.innerHTML=s.toUpperCase()})),this.lastDate=s}showCanvas(e){e===i.msg.command.firstFrame&&this.navNext(e),e===i.msg.command.lastFrame&&this.navPrev(e),this.startNavCount(),this.elem.classList.add("show")}hideCanvas(){this.resetNavBaseCount(),this.elem.classList.remove("show")}isActive(){return 0!==this.elem.offsetHeight}isEnabled(){return this.enabled}navBaseTime(){(0,i.isPlaying)()&&this.isActive()&&(this.navBaseCount+=1,this.baseCountChange&&this.baseCountChange(this.navBaseCount),this.updateScreenFromBaseCount())}async updateScreenFromBaseCount(){const e=this.screenIndexFromBaseCount();!1!==e?e!==this.screenIndex&&(this.screenIndex=-1===e?0:e,this.screenIndexChange?this.screenIndexChange(this.screenIndex):(await this.drawCanvas(),this.showCanvas())):this.sendNavDisplayMessage(i.msg.response.next)}calcNavTiming(){if(!1===this.timing)return;Array.isArray(this.timing.delay)&&(this.timing.totalScreens=this.timing.delay.length);let e=[];if("number"==typeof this.timing.delay)for(let t=0;t<this.timing.totalScreens;t+=1)e.push(this.timing.delay);else e=this.timing.delay.map((e=>"object"==typeof e?e.time:e));let t=0;if(this.timing.fullDelay=e.map((e=>{const s=t+e;return t+=e,s})),Array.isArray(this.timing.delay)&&"object"==typeof this.timing.delay[0])this.timing.screenIndexes=this.timing.delay.map((e=>e.si));else{this.timing.screenIndexes=[];for(let e=0;e<this.timing.totalScreens;e+=1)this.timing.screenIndexes.push(e)}}navNext(e){if(e===i.msg.command.firstFrame)this.resetNavBaseCount();else{const e=this.timing.fullDelay.find((e=>e>this.navBaseCount));this.navBaseCount=e}this.updateScreenFromBaseCount()}navPrev(e){if(e===i.msg.command.lastFrame)this.navBaseCount=this.timing.fullDelay[this.timing.totalScreens-1]-1;else{const e=this.timing.fullDelay.reduce(((e,t)=>t<this.navBaseCount?t:e),0);if(0===e&&0===this.navBaseCount)return void this.sendNavDisplayMessage(i.msg.response.previous);this.navBaseCount=e}this.updateScreenFromBaseCount()}screenIndexFromBaseCount(){if(!this.timing)return 0;this.timing&&!this.timing.fullDelay&&this.calcNavTiming();const e=this.timing.fullDelay.findIndex((e=>e>this.navBaseCount));return-1!==e&&this.timing.screenIndexes[e]}startNavCount(){this.navInterval||(this.navInterval=setInterval((()=>this.navBaseTime()),this.timing.baseDelay))}resetNavBaseCount(){this.navBaseCount=0,this.screenIndex=-1,this.navInterval&&(clearInterval(this.navInterval),this.navInterval=void 0)}sendNavDisplayMessage(e){(0,i.displayNavMessage)({id:this.navId,type:e})}loadTemplates(){if(this.templates={},this.elem=document.getElementById(`${this.elemId}-html`),!this.elem)return;this.elem.querySelectorAll(".template").forEach((e=>{const t=e.classList[0],s=e.cloneNode(!0);s.classList.remove("template"),this.templates[t]=s,e.remove()}))}fillTemplate(e,t){const s=this.templates[e];if(!s)return!1;const r=s.cloneNode(!0);return Object.entries(t).forEach((([e,t])=>{const s=r.querySelector(`.${e}`);s&&("string"==typeof t||"number"==typeof t?s.innerHTML=t:"img"===t?.type&&(s.querySelector("img").src=t.src))})),r}}},"./server/scripts/vendor/auto/luxon.mjs":(e,t,s)=>{s.r(t),s.d(t,{DateTime:()=>Ks,Duration:()=>Gt,FixedOffsetZone:()=>Oe,IANAZone:()=>Ee,Info:()=>Xt,Interval:()=>Jt,InvalidZone:()=>Fe,Settings:()=>Re,SystemZone:()=>Me,VERSION:()=>er,Zone:()=>Ie});class r extends Error{}class n extends r{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class a extends r{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class i extends r{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class o extends r{}class l extends r{constructor(e){super(`Invalid unit ${e}`)}}class u extends r{}class c extends r{constructor(){super("Zone is an abstract class")}}const d="numeric",m="short",h="long",f={year:d,month:d,day:d},g={year:d,month:m,day:d},p={year:d,month:m,day:d,weekday:m},y={year:d,month:h,day:d},v={year:d,month:h,day:d,weekday:h},w={hour:d,minute:d},S={hour:d,minute:d,second:d},T={hour:d,minute:d,second:d,timeZoneName:m},b={hour:d,minute:d,second:d,timeZoneName:h},C={hour:d,minute:d,hourCycle:"h23"},I={hour:d,minute:d,second:d,hourCycle:"h23"},D={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:m},M={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:h},x={year:d,month:d,day:d,hour:d,minute:d},L={year:d,month:d,day:d,hour:d,minute:d,second:d},k={year:d,month:m,day:d,hour:d,minute:d},E={year:d,month:m,day:d,hour:d,minute:d,second:d},N={year:d,month:m,day:d,weekday:m,hour:d,minute:d},O={year:d,month:h,day:d,hour:d,minute:d,timeZoneName:m},F={year:d,month:h,day:d,hour:d,minute:d,second:d,timeZoneName:m},j={year:d,month:h,day:d,weekday:h,hour:d,minute:d,timeZoneName:h},$={year:d,month:h,day:d,weekday:h,hour:d,minute:d,second:d,timeZoneName:h};function V(e){return void 0===e}function H(e){return"number"==typeof e}function _(e){return"number"==typeof e&&e%1==0}function A(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function P(e,t,s){if(0!==e.length)return e.reduce(((e,r)=>{const n=[t(r),r];return e&&s(e[0],n[0])===e[0]?e:n}),null)[1]}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function z(e,t,s){return _(e)&&e>=t&&e<=s}function B(e,t=2){let s;return s=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),s}function Z(e){return V(e)||null===e||""===e?void 0:parseInt(e,10)}function q(e){return V(e)||null===e||""===e?void 0:parseFloat(e)}function W(e){if(!V(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function U(e,t,s=!1){const r=10**t;return(s?Math.trunc:Math.round)(e*r)/r}function G(e){return e%4==0&&(e%100!=0||e%400==0)}function Y(e){return G(e)?366:365}function J(e,t){const s=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===s?G(e+(t-s)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][s-1]}function X(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function K(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,s=e-1,r=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===t||3===r?53:52}function Q(e){return e>99?e:e>60?1900+e:2e3+e}function ee(e,t,s,r=null){const n=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);const i={timeZoneName:t,...a},o=new Intl.DateTimeFormat(s,i).formatToParts(n).find((e=>"timezonename"===e.type.toLowerCase()));return o?o.value:null}function te(e,t){let s=parseInt(e,10);Number.isNaN(s)&&(s=0);const r=parseInt(t,10)||0;return 60*s+(s<0||Object.is(s,-0)?-r:r)}function se(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new u(`Invalid unit value ${e}`);return t}function re(e,t){const s={};for(const r in e)if(R(e,r)){const n=e[r];if(null==n)continue;s[t(r)]=se(n)}return s}function ne(e,t){const s=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),n=e>=0?"+":"-";switch(t){case"short":return`${n}${B(s,2)}:${B(r,2)}`;case"narrow":return`${n}${s}${r>0?`:${r}`:""}`;case"techie":return`${n}${B(s,2)}${B(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ae(e){return function(e,t){return t.reduce(((t,s)=>(t[s]=e[s],t)),{})}(e,["hour","minute","second","millisecond"])}const ie=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,oe=["January","February","March","April","May","June","July","August","September","October","November","December"],le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ue=["J","F","M","A","M","J","J","A","S","O","N","D"];function ce(e){switch(e){case"narrow":return[...ue];case"short":return[...le];case"long":return[...oe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const de=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],me=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],he=["M","T","W","T","F","S","S"];function fe(e){switch(e){case"narrow":return[...he];case"short":return[...me];case"long":return[...de];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ge=["AM","PM"],pe=["Before Christ","Anno Domini"],ye=["BC","AD"],ve=["B","A"];function we(e){switch(e){case"narrow":return[...ve];case"short":return[...ye];case"long":return[...pe];default:return null}}function Se(e,t){let s="";for(const r of e)r.literal?s+=r.val:s+=t(r.val);return s}const Te={D:f,DD:g,DDD:y,DDDD:v,t:w,tt:S,ttt:T,tttt:b,T:C,TT:I,TTT:D,TTTT:M,f:x,ff:k,fff:O,ffff:j,F:L,FF:E,FFF:F,FFFF:$};class be{static create(e,t={}){return new be(e,t)}static parseFormat(e){let t=null,s="",r=!1;const n=[];for(let a=0;a<e.length;a++){const i=e.charAt(a);"'"===i?(s.length>0&&n.push({literal:r,val:s}),t=null,s="",r=!r):r||i===t?s+=i:(s.length>0&&n.push({literal:!1,val:s}),s=i,t=i)}return s.length>0&&n.push({literal:r,val:s}),n}static macroTokenToFormatOpts(e){return Te[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return B(e,t);const s={...this.opts};return t>0&&(s.padTo=t),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const s="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,n=(t,s)=>this.loc.extract(e,t,s),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>s?function(e){return ge[e.hour<12?0:1]}(e):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(t,r)=>s?function(e,t){return ce(t)[e.month-1]}(e,t):n(r?{month:t}:{month:t,day:"numeric"},"month"),l=(t,r)=>s?function(e,t){return fe(t)[e.weekday-1]}(e,t):n(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),u=t=>{const s=be.macroTokenToFormatOpts(t);return s?this.formatWithSystemDefault(e,s):t},c=t=>s?function(e,t){return we(t)[e.year<0?0:1]}(e,t):n({era:t},"era");return Se(be.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return r?n({day:"numeric"},"day"):this.num(e.day);case"dd":return r?n({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?n({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?n({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?n({month:"numeric"},"month"):this.num(e.month);case"MM":return r?n({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?n({year:"numeric"},"year"):this.num(e.year);case"yy":return r?n({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?n({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?n({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(t)}}))}formatDurationFromString(e,t){const s=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=be.parseFormat(t),n=r.reduce(((e,{literal:t,val:s})=>t?e:e.concat(s)),[]);return Se(r,(e=>t=>{const r=s(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...n.map(s).filter((e=>e)))))}}class Ce{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ie{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}}let De=null;class Me extends Ie{static get instance(){return null===De&&(De=new Me),De}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return ee(e,t,s)}formatOffset(e,t){return ne(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let xe={};const Le={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let ke={};class Ee extends Ie{static create(e){return ke[e]||(ke[e]=new Ee(e)),ke[e]}static resetCache(){ke={},xe={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=Ee.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return ee(e,t,s,this.name)}formatOffset(e,t){return ne(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const s=(r=this.name,xe[r]||(xe[r]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),xe[r]);var r;let[n,a,i,o,l,u,c]=s.formatToParts?function(e,t){const s=e.formatToParts(t),r=[];for(let e=0;e<s.length;e++){const{type:t,value:n}=s[e],a=Le[t];"era"===t?r[a]=n:V(a)||(r[a]=parseInt(n,10))}return r}(s,t):function(e,t){const s=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(s),[,n,a,i,o,l,u,c]=r;return[i,n,a,o,l,u,c]}(s,t);"BC"===o&&(n=1-Math.abs(n));let d=+t;const m=d%1e3;return d-=m>=0?m:1e3+m,(X({year:n,month:a,day:i,hour:24===l?0:l,minute:u,second:c,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Ne=null;class Oe extends Ie{static get utcInstance(){return null===Ne&&(Ne=new Oe(0)),Ne}static instance(e){return 0===e?Oe.utcInstance:new Oe(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Oe(te(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${ne(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${ne(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ne(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Fe extends Ie{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function je(e,t){if(V(e)||null===e)return t;if(e instanceof Ie)return e;if("string"==typeof e){const s=e.toLowerCase();return"default"===s?t:"local"===s||"system"===s?Me.instance:"utc"===s||"gmt"===s?Oe.utcInstance:Oe.parseSpecifier(s)||Ee.create(e)}return H(e)?Oe.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new Fe(e)}let $e,Ve=()=>Date.now(),He="system",_e=null,Ae=null,Pe=null;class Re{static get now(){return Ve}static set now(e){Ve=e}static set defaultZone(e){He=e}static get defaultZone(){return je(He,Me.instance)}static get defaultLocale(){return _e}static set defaultLocale(e){_e=e}static get defaultNumberingSystem(){return Ae}static set defaultNumberingSystem(e){Ae=e}static get defaultOutputCalendar(){return Pe}static set defaultOutputCalendar(e){Pe=e}static get throwOnInvalid(){return $e}static set throwOnInvalid(e){$e=e}static resetCaches(){Ke.resetCache(),Ee.resetCache()}}let ze={};let Be={};function Ze(e,t={}){const s=JSON.stringify([e,t]);let r=Be[s];return r||(r=new Intl.DateTimeFormat(e,t),Be[s]=r),r}let qe={};let We={};let Ue=null;function Ge(e,t,s,r,n){const a=e.listingMode(s);return"error"===a?null:"en"===a?r(t):n(t)}class Ye{constructor(e,t,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:n,...a}=s;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...s};s.padTo>0&&(t.minimumIntegerDigits=s.padTo),this.inf=function(e,t={}){const s=JSON.stringify([e,t]);let r=qe[s];return r||(r=new Intl.NumberFormat(e,t),qe[s]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return B(this.floor?Math.floor(e):U(e,3),this.padTo)}}class Je{constructor(e,t,s){let r;if(this.opts=s,e.zone.isUniversal){const t=e.offset/60*-1,n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&Ee.create(n).valid?(r=n,this.dt=e):(r="UTC",s.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Ks.fromMillis(e.ts+60*e.offset*1e3))}else"system"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name);const n={...this.opts};r&&(n.timeZone=r),this.dtf=Ze(t,n)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Xe{constructor(e,t,s){this.opts={style:"long",...s},!t&&A()&&(this.rtf=function(e,t={}){const{base:s,...r}=t,n=JSON.stringify([e,r]);let a=We[n];return a||(a=new Intl.RelativeTimeFormat(e,t),We[n]=a),a}(e,s))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,s="always",r=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===s&&a){const s="days"===e;switch(t){case 1:return s?"tomorrow":`next ${n[e][0]}`;case-1:return s?"yesterday":`last ${n[e][0]}`;case 0:return s?"today":`this ${n[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,u=n[e],c=r?l?u[1]:u[2]||u[1]:l?n[e][0]:e;return i?`${o} ${c} ago`:`in ${o} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ke{static fromOpts(e){return Ke.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,s,r=!1){const n=e||Re.defaultLocale,a=n||(r?"en-US":Ue||(Ue=(new Intl.DateTimeFormat).resolvedOptions().locale,Ue)),i=t||Re.defaultNumberingSystem,o=s||Re.defaultOutputCalendar;return new Ke(a,i,o,n)}static resetCache(){Ue=null,Be={},qe={},We={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:s}={}){return Ke.create(e,t,s)}constructor(e,t,s,r){const[n,a,i]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let s;const r=e.substring(0,t);try{s=Ze(e).resolvedOptions()}catch(e){s=Ze(r).resolvedOptions()}const{numberingSystem:n,calendar:a}=s;return[r,n,a]}}(e);this.locale=n,this.numberingSystem=t||a||null,this.outputCalendar=s||i||null,this.intl=function(e,t,s){return s||t?(e+="-u",s&&(e+=`-ca-${s}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Ke.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,s=!0){return Ge(this,e,s,ce,(()=>{const s=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let s=1;s<=12;s++){const r=Ks.utc(2016,s,1);t.push(e(r))}return t}((e=>this.extract(e,s,"month")))),this.monthsCache[r][e]}))}weekdays(e,t=!1,s=!0){return Ge(this,e,s,fe,(()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let s=1;s<=7;s++){const r=Ks.utc(2016,11,13+s);t.push(e(r))}return t}((e=>this.extract(e,s,"weekday")))),this.weekdaysCache[r][e]}))}meridiems(e=!0){return Ge(this,void 0,e,(()=>ge),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ks.utc(2016,11,13,9),Ks.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Ge(this,e,t,we,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ks.utc(-40,1,1),Ks.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,s){const r=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===s));return r?r.value:null}numberFormatter(e={}){return new Ye(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Je(e,this.intl,t)}relFormatter(e={}){return new Xe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const s=JSON.stringify([e,t]);let r=ze[s];return r||(r=new Intl.ListFormat(e,t),ze[s]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Qe(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function et(...e){return t=>e.reduce((([e,s,r],n)=>{const[a,i,o]=n(t,r);return[{...e,...a},i||s,o]}),[{},null,1]).slice(0,2)}function tt(e,...t){if(null==e)return[null,null];for(const[s,r]of t){const t=s.exec(e);if(t)return r(t)}return[null,null]}function st(...e){return(t,s)=>{const r={};let n;for(n=0;n<e.length;n++)r[e[n]]=Z(t[s+n]);return[r,null,s+n]}}const rt=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,nt=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,at=RegExp(`${nt.source}${`(?:${rt.source}?(?:\\[(${ie.source})\\])?)?`}`),it=RegExp(`(?:T${at.source})?`),ot=st("weekYear","weekNumber","weekDay"),lt=st("year","ordinal"),ut=RegExp(`${nt.source} ?(?:${rt.source}|(${ie.source}))?`),ct=RegExp(`(?: ${ut.source})?`);function dt(e,t,s){const r=e[t];return V(r)?s:Z(r)}function mt(e,t){return[{hours:dt(e,t,0),minutes:dt(e,t+1,0),seconds:dt(e,t+2,0),milliseconds:W(e[t+3])},null,t+4]}function ht(e,t){const s=!e[t]&&!e[t+1],r=te(e[t+1],e[t+2]);return[{},s?null:Oe.instance(r),t+3]}function ft(e,t){return[{},e[t]?Ee.create(e[t]):null,t+1]}const gt=RegExp(`^T?${nt.source}$`),pt=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function yt(e){const[t,s,r,n,a,i,o,l,u]=e,c="-"===t[0],d=l&&"-"===l[0],m=(e,t=!1)=>void 0!==e&&(t||e&&c)?-e:e;return[{years:m(q(s)),months:m(q(r)),weeks:m(q(n)),days:m(q(a)),hours:m(q(i)),minutes:m(q(o)),seconds:m(q(l),"-0"===l),milliseconds:m(W(u),d)}]}const vt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function wt(e,t,s,r,n,a,i){const o={year:2===t.length?Q(Z(t)):Z(t),month:le.indexOf(s)+1,day:Z(r),hour:Z(n),minute:Z(a)};return i&&(o.second=Z(i)),e&&(o.weekday=e.length>3?de.indexOf(e)+1:me.indexOf(e)+1),o}const St=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Tt(e){const[,t,s,r,n,a,i,o,l,u,c,d]=e,m=wt(t,n,r,s,a,i,o);let h;return h=l?vt[l]:u?0:te(c,d),[m,new Oe(h)]}const bt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ct=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,It=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Dt(e){const[,t,s,r,n,a,i,o]=e;return[wt(t,n,r,s,a,i,o),Oe.utcInstance]}function Mt(e){const[,t,s,r,n,a,i,o]=e;return[wt(t,o,s,r,n,a,i),Oe.utcInstance]}const xt=Qe(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,it),Lt=Qe(/(\d{4})-?W(\d\d)(?:-?(\d))?/,it),kt=Qe(/(\d{4})-?(\d{3})/,it),Et=Qe(at),Nt=et((function(e,t){return[{year:dt(e,t),month:dt(e,t+1,1),day:dt(e,t+2,1)},null,t+3]}),mt,ht,ft),Ot=et(ot,mt,ht,ft),Ft=et(lt,mt,ht,ft),jt=et(mt,ht,ft);const $t=et(mt);const Vt=Qe(/(\d{4})-(\d\d)-(\d\d)/,ct),Ht=Qe(ut),_t=et(mt,ht,ft);const At={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Pt={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...At},Rt=365.2425,zt=30.436875,Bt={years:{quarters:4,months:12,weeks:52.1775,days:Rt,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:zt,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...At},Zt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],qt=Zt.slice(0).reverse();function Wt(e,t,s=!1){const r={values:s?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Gt(r)}function Ut(e,t,s,r,n){const a=e[n][s],i=t[s]/a,o=!(Math.sign(i)===Math.sign(r[n]))&&0!==r[n]&&Math.abs(i)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(i):Math.trunc(i);r[n]+=o,t[s]-=o*a}class Gt{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let s=t?Bt:Pt;e.matrix&&(s=e.matrix),this.values=e.values,this.loc=e.loc||Ke.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(e,t){return Gt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Gt({values:re(e,Gt.normalizeUnit),loc:Ke.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(H(e))return Gt.fromMillis(e);if(Gt.isDuration(e))return e;if("object"==typeof e)return Gt.fromObject(e);throw new u(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[s]=function(e){return tt(e,[pt,yt])}(e);return s?Gt.fromObject(s,t):Gt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[s]=function(e){return tt(e,[gt,$t])}(e);return s?Gt.fromObject(s,t):Gt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Duration is invalid");const s=e instanceof Ce?e:new Ce(e,t);if(Re.throwOnInvalid)throw new i(s);return new Gt({invalid:s})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new l(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const s={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?be.create(this.loc,s).formatDurationFromString(this,e):"Invalid Duration"}toHuman(e={}){const t=Zt.map((t=>{const s=this.values[t];return V(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(s)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=U(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const s=this.shiftTo("hours","minutes","seconds","milliseconds");let r="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===s.seconds&&0===s.milliseconds||(r+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===s.milliseconds||(r+=".SSS"));let n=s.toFormat(r);return e.includePrefix&&(n="T"+n),n}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Gt.fromDurationLike(e),s={};for(const e of Zt)(R(t.values,e)||R(this.values,e))&&(s[e]=t.get(e)+this.get(e));return Wt(this,{values:s},!0)}minus(e){if(!this.isValid)return this;const t=Gt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const s of Object.keys(this.values))t[s]=se(e(this.values[s],s));return Wt(this,{values:t},!0)}get(e){return this[Gt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Wt(this,{values:{...this.values,...re(e,Gt.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:s,matrix:r}={}){return Wt(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:s})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return function(e,t){qt.reduce(((s,r)=>V(t[r])?s:(s&&Ut(e,t,s,t,r),r)),null)}(this.matrix,e),Wt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return Wt(this,{values:function(e){const t={};for(const[s,r]of Object.entries(e))0!==r&&(t[s]=r);return t}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Gt.normalizeUnit(e)));const t={},s={},r=this.toObject();let n;for(const a of Zt)if(e.indexOf(a)>=0){n=a;let e=0;for(const t in s)e+=this.matrix[t][a]*s[t],s[t]=0;H(r[a])&&(e+=r[a]);const i=Math.trunc(e);t[a]=i,s[a]=(1e3*e-1e3*i)/1e3;for(const e in r)Zt.indexOf(e)>Zt.indexOf(a)&&Ut(this.matrix,r,e,t,a)}else H(r[a])&&(s[a]=r[a]);for(const e in s)0!==s[e]&&(t[n]+=e===n?s[e]:s[e]/this.matrix[n][e]);return Wt(this,{values:t},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Wt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const r of Zt)if(t=this.values[r],s=e.values[r],!(void 0===t||0===t?void 0===s||0===s:t===s))return!1;var t,s;return!0}}const Yt="Invalid Interval";class Jt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Interval is invalid");const s=e instanceof Ce?e:new Ce(e,t);if(Re.throwOnInvalid)throw new a(s);return new Jt({invalid:s})}static fromDateTimes(e,t){const s=Qs(e),r=Qs(t),n=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Jt.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:Jt.invalid("missing or invalid end"):Jt.invalid("missing or invalid start")}(s,r);return null==n?new Jt({start:s,end:r}):n}static after(e,t){const s=Gt.fromDurationLike(t),r=Qs(e);return Jt.fromDateTimes(r,r.plus(s))}static before(e,t){const s=Gt.fromDurationLike(t),r=Qs(e);return Jt.fromDateTimes(r.minus(s),r)}static fromISO(e,t){const[s,r]=(e||"").split("/",2);if(s&&r){let e,n,a,i;try{e=Ks.fromISO(s,t),n=e.isValid}catch(r){n=!1}try{a=Ks.fromISO(r,t),i=a.isValid}catch(r){i=!1}if(n&&i)return Jt.fromDateTimes(e,a);if(n){const s=Gt.fromISO(r,t);if(s.isValid)return Jt.after(e,s)}else if(i){const e=Gt.fromISO(s,t);if(e.isValid)return Jt.before(a,e)}}return Jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),s=this.end.startOf(e);return Math.floor(s.diff(t,e).get(e))+1}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Jt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Qs).filter((e=>this.contains(e))).sort(),s=[];let{s:r}=this,n=0;for(;r<this.e;){const e=t[n]||this.e,a=+e>+this.e?this.e:e;s.push(Jt.fromDateTimes(r,a)),r=a,n+=1}return s}splitBy(e){const t=Gt.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let s,{s:r}=this,n=1;const a=[];for(;r<this.e;){const e=this.start.plus(t.mapUnits((e=>e*n)));s=+e>+this.e?this.e:e,a.push(Jt.fromDateTimes(r,s)),r=s,n+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e==+e.s}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,s=this.e<e.e?this.e:e.e;return t>=s?null:Jt.fromDateTimes(t,s)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,s=this.e>e.e?this.e:e.e;return Jt.fromDateTimes(t,s)}static merge(e){const[t,s]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],s)=>t?t.overlaps(s)||t.abutsStart(s)?[e,t.union(s)]:[e.concat([t]),s]:[e,s]),[[],null]);return s&&t.push(s),t}static xor(e){let t=null,s=0;const r=[],n=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),a=Array.prototype.concat(...n).sort(((e,t)=>e.time-t.time));for(const e of a)s+="s"===e.type?1:-1,1===s?t=e.time:(t&&+t!=+e.time&&r.push(Jt.fromDateTimes(t,e.time)),t=null);return Jt.merge(r)}difference(...e){return Jt.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Yt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Yt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Yt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Yt}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Yt}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Gt.invalid(this.invalidReason)}mapEndpoints(e){return Jt.fromDateTimes(e(this.s),e(this.e))}}class Xt{static hasDST(e=Re.defaultZone){const t=Ks.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ee.isValidZone(e)}static normalizeZone(e){return je(e,Re.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null,outputCalendar:n="gregory"}={}){return(r||Ke.create(t,s,n)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null,outputCalendar:n="gregory"}={}){return(r||Ke.create(t,s,n)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null}={}){return(r||Ke.create(t,s,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null}={}){return(r||Ke.create(t,s,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ke.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ke.create(t,null,"gregory").eras(e)}static features(){return{relative:A()}}}function Kt(e,t){const s=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=s(t)-s(e);return Math.floor(Gt.fromMillis(r).as("days"))}function Qt(e,t,s,r){let[n,a,i,o]=function(e,t,s){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const s=Kt(e,t);return(s-s%7)/7}],["days",Kt]],n={};let a,i;for(const[o,l]of r)if(s.indexOf(o)>=0){a=o;let s=l(e,t);i=e.plus({[o]:s}),i>t?(e=e.plus({[o]:s-1}),s-=1):e=i,n[o]=s}return[e,n,i,a]}(e,t,s);const l=t-n,u=s.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===u.length&&(i<t&&(i=n.plus({[o]:1})),i!==n&&(a[o]=(a[o]||0)+l/(i-n)));const c=Gt.fromObject(a,r);return u.length>0?Gt.fromMillis(l,r).shiftTo(...u).plus(c):c}const es={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ts={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ss=es.hanidec.replace(/[\[|\]]/g,"").split("");function rs({numberingSystem:e},t=""){return new RegExp(`${es[e||"latn"]}${t}`)}function ns(e,t=(e=>e)){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);if(-1!==e[s].search(es.hanidec))t+=ss.indexOf(e[s]);else for(const e in ts){const[s,n]=ts[e];r>=s&&r<=n&&(t+=r-s)}}return parseInt(t,10)}return t}(e))}}const as=`[ ${String.fromCharCode(160)}]`,is=new RegExp(as,"g");function os(e){return e.replace(/\./g,"\\.?").replace(is,as)}function ls(e){return e.replace(/\./g,"").replace(is," ").toLowerCase()}function us(e,t){return null===e?null:{regex:RegExp(e.map(os).join("|")),deser:([s])=>e.findIndex((e=>ls(s)===ls(e)))+t}}function cs(e,t){return{regex:e,deser:([,e,t])=>te(e,t),groups:t}}function ds(e){return{regex:e,deser:([e])=>e}}const ms={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let hs=null;function fs(e,t){return Array.prototype.concat(...e.map((e=>function(e,t){if(e.literal)return e;const s=ps(be.macroTokenToFormatOpts(e.val),t);return null==s||s.includes(void 0)?e:s}(e,t))))}function gs(e,t,s){const r=fs(be.parseFormat(s),e),n=r.map((t=>function(e,t){const s=rs(t),r=rs(t,"{2}"),n=rs(t,"{3}"),a=rs(t,"{4}"),i=rs(t,"{6}"),o=rs(t,"{1,2}"),l=rs(t,"{1,3}"),u=rs(t,"{1,6}"),c=rs(t,"{1,9}"),d=rs(t,"{2,4}"),m=rs(t,"{4,6}"),h=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return h(f);switch(f.val){case"G":return us(t.eras("short",!1),0);case"GG":return us(t.eras("long",!1),0);case"y":return ns(u);case"yy":case"kk":return ns(d,Q);case"yyyy":case"kkkk":return ns(a);case"yyyyy":return ns(m);case"yyyyyy":return ns(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return ns(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return ns(r);case"MMM":return us(t.months("short",!0,!1),1);case"MMMM":return us(t.months("long",!0,!1),1);case"LLL":return us(t.months("short",!1,!1),1);case"LLLL":return us(t.months("long",!1,!1),1);case"o":case"S":return ns(l);case"ooo":case"SSS":return ns(n);case"u":return ds(c);case"uu":return ds(o);case"uuu":case"E":case"c":return ns(s);case"a":return us(t.meridiems(),0);case"EEE":return us(t.weekdays("short",!1,!1),1);case"EEEE":return us(t.weekdays("long",!1,!1),1);case"ccc":return us(t.weekdays("short",!0,!1),1);case"cccc":return us(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return cs(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return cs(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return ds(/[a-z_+-/]{1,256}?/i);default:return h(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e))),a=n.find((e=>e.invalidReason));if(a)return{input:t,tokens:r,invalidReason:a.invalidReason};{const[e,s]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(n),a=RegExp(e,"i"),[i,l]=function(e,t,s){const r=e.match(t);if(r){const e={};let t=1;for(const n in s)if(R(s,n)){const a=s[n],i=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+i))),t+=i}return[r,e]}return[r,{}]}(t,a,s),[u,c,d]=l?function(e){let t,s=null;return V(e.z)||(s=Ee.create(e.z)),V(e.Z)||(s||(s=new Oe(e.Z)),t=e.Z),V(e.q)||(e.M=3*(e.q-1)+1),V(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),V(e.u)||(e.S=W(e.u)),[Object.keys(e).reduce(((t,s)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(s);return r&&(t[r]=e[s]),t}),{}),s,t]}(l):[null,null,void 0];if(R(l,"a")&&R(l,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:a,rawMatches:i,matches:l,result:u,zone:c,specificOffset:d}}}function ps(e,t){if(!e)return null;return be.create(t,e).formatDateTimeParts((hs||(hs=Ks.fromMillis(1555555555555)),hs)).map((t=>function(e,t,s){const{type:r,value:n}=e;if("literal"===r)return{literal:!0,val:n};const a=s[r];let i=ms[r];return"object"==typeof i&&(i=i[a]),i?{literal:!1,val:i}:void 0}(t,0,e)))}const ys=[0,31,59,90,120,151,181,212,243,273,304,334],vs=[0,31,60,91,121,152,182,213,244,274,305,335];function ws(e,t){return new Ce("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Ss(e,t,s){const r=new Date(Date.UTC(e,t-1,s));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const n=r.getUTCDay();return 0===n?7:n}function Ts(e,t,s){return s+(G(e)?vs:ys)[t-1]}function bs(e,t){const s=G(e)?vs:ys,r=s.findIndex((e=>e<t));return{month:r+1,day:t-s[r]}}function Cs(e){const{year:t,month:s,day:r}=e,n=Ts(t,s,r),a=Ss(t,s,r);let i,o=Math.floor((n-a+10)/7);return o<1?(i=t-1,o=K(i)):o>K(t)?(i=t+1,o=1):i=t,{weekYear:i,weekNumber:o,weekday:a,...ae(e)}}function Is(e){const{weekYear:t,weekNumber:s,weekday:r}=e,n=Ss(t,1,4),a=Y(t);let i,o=7*s+r-n-3;o<1?(i=t-1,o+=Y(i)):o>a?(i=t+1,o-=Y(t)):i=t;const{month:l,day:u}=bs(i,o);return{year:i,month:l,day:u,...ae(e)}}function Ds(e){const{year:t,month:s,day:r}=e;return{year:t,ordinal:Ts(t,s,r),...ae(e)}}function Ms(e){const{year:t,ordinal:s}=e,{month:r,day:n}=bs(t,s);return{year:t,month:r,day:n,...ae(e)}}function xs(e){const t=_(e.year),s=z(e.month,1,12),r=z(e.day,1,J(e.year,e.month));return t?s?!r&&ws("day",e.day):ws("month",e.month):ws("year",e.year)}function Ls(e){const{hour:t,minute:s,second:r,millisecond:n}=e,a=z(t,0,23)||24===t&&0===s&&0===r&&0===n,i=z(s,0,59),o=z(r,0,59),l=z(n,0,999);return a?i?o?!l&&ws("millisecond",n):ws("second",r):ws("minute",s):ws("hour",t)}const ks="Invalid DateTime",Es=864e13;function Ns(e){return new Ce("unsupported zone",`the zone "${e.name}" is not supported`)}function Os(e){return null===e.weekData&&(e.weekData=Cs(e.c)),e.weekData}function Fs(e,t){const s={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ks({...s,...t,old:s})}function js(e,t,s){let r=e-60*t*1e3;const n=s.offset(r);if(t===n)return[r,t];r-=60*(n-t)*1e3;const a=s.offset(r);return n===a?[r,n]:[e-60*Math.min(n,a)*1e3,Math.max(n,a)]}function $s(e,t){const s=new Date(e+=60*t*1e3);return{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),millisecond:s.getUTCMilliseconds()}}function Vs(e,t,s){return js(X(e),t,s)}function Hs(e,t){const s=e.o,r=e.c.year+Math.trunc(t.years),n=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),a={...e.c,year:r,month:n,day:Math.min(e.c.day,J(r,n))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},i=Gt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=X(a);let[l,u]=js(o,s,e.zone);return 0!==i&&(l+=i,u=e.zone.offset(l)),{ts:l,o:u}}function _s(e,t,s,r,n,a){const{setZone:i,zone:o}=s;if(e&&0!==Object.keys(e).length){const r=t||o,n=Ks.fromObject(e,{...s,zone:r,specificOffset:a});return i?n:n.setZone(o)}return Ks.invalid(new Ce("unparsable",`the input "${n}" can't be parsed as ${r}`))}function As(e,t,s=!0){return e.isValid?be.create(Ke.create("en-US"),{allowZ:s,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ps(e,t){const s=e.c.year>9999||e.c.year<0;let r="";return s&&e.c.year>=0&&(r+="+"),r+=B(e.c.year,s?6:4),t?(r+="-",r+=B(e.c.month),r+="-",r+=B(e.c.day)):(r+=B(e.c.month),r+=B(e.c.day)),r}function Rs(e,t,s,r,n,a){let i=B(e.c.hour);return t?(i+=":",i+=B(e.c.minute),0===e.c.second&&s||(i+=":")):i+=B(e.c.minute),0===e.c.second&&s||(i+=B(e.c.second),0===e.c.millisecond&&r||(i+=".",i+=B(e.c.millisecond,3))),n&&(e.isOffsetFixed&&0===e.offset&&!a?i+="Z":e.o<0?(i+="-",i+=B(Math.trunc(-e.o/60)),i+=":",i+=B(Math.trunc(-e.o%60))):(i+="+",i+=B(Math.trunc(e.o/60)),i+=":",i+=B(Math.trunc(e.o%60)))),a&&(i+="["+e.zone.ianaName+"]"),i}const zs={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Bs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Zs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},qs=["year","month","day","hour","minute","second","millisecond"],Ws=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Us=["year","ordinal","hour","minute","second","millisecond"];function Gs(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new l(e);return t}function Ys(e,t){const s=je(t.zone,Re.defaultZone),r=Ke.fromObject(t),n=Re.now();let a,i;if(V(e.year))a=n;else{for(const t of qs)V(e[t])&&(e[t]=zs[t]);const t=xs(e)||Ls(e);if(t)return Ks.invalid(t);const r=s.offset(n);[a,i]=Vs(e,r,s)}return new Ks({ts:a,zone:s,loc:r,o:i})}function Js(e,t,s){const r=!!V(s.round)||s.round,n=(e,n)=>{e=U(e,r||s.calendary?0:2,!0);return t.loc.clone(s).relFormatter(s).format(e,n)},a=r=>s.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(s.unit)return n(a(s.unit),s.unit);for(const e of s.units){const t=a(e);if(Math.abs(t)>=1)return n(t,e)}return n(e>t?-0:0,s.units[s.units.length-1])}function Xs(e){let t,s={};return e.length>0&&"object"==typeof e[e.length-1]?(s=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[s,t]}class Ks{constructor(e){const t=e.zone||Re.defaultZone;let s=e.invalid||(Number.isNaN(e.ts)?new Ce("invalid input"):null)||(t.isValid?null:Ns(t));this.ts=V(e.ts)?Re.now():e.ts;let r=null,n=null;if(!s){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,n]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=$s(this.ts,e),s=Number.isNaN(r.year)?new Ce("invalid input"):null,r=s?null:r,n=s?null:e}}this._zone=t,this.loc=e.loc||Ke.create(),this.invalid=s,this.weekData=null,this.c=r,this.o=n,this.isLuxonDateTime=!0}static now(){return new Ks({})}static local(){const[e,t]=Xs(arguments),[s,r,n,a,i,o,l]=t;return Ys({year:s,month:r,day:n,hour:a,minute:i,second:o,millisecond:l},e)}static utc(){const[e,t]=Xs(arguments),[s,r,n,a,i,o,l]=t;return e.zone=Oe.utcInstance,Ys({year:s,month:r,day:n,hour:a,minute:i,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const s=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(s))return Ks.invalid("invalid input");const n=je(t.zone,Re.defaultZone);return n.isValid?new Ks({ts:s,zone:n,loc:Ke.fromObject(t)}):Ks.invalid(Ns(n))}static fromMillis(e,t={}){if(H(e))return e<-Es||e>Es?Ks.invalid("Timestamp out of range"):new Ks({ts:e,zone:je(t.zone,Re.defaultZone),loc:Ke.fromObject(t)});throw new u(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(H(e))return new Ks({ts:1e3*e,zone:je(t.zone,Re.defaultZone),loc:Ke.fromObject(t)});throw new u("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const s=je(t.zone,Re.defaultZone);if(!s.isValid)return Ks.invalid(Ns(s));const r=Re.now(),n=V(t.specificOffset)?s.offset(r):t.specificOffset,a=re(e,Gs),i=!V(a.ordinal),l=!V(a.year),u=!V(a.month)||!V(a.day),c=l||u,d=a.weekYear||a.weekNumber,m=Ke.fromObject(t);if((c||i)&&d)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&i)throw new o("Can't mix ordinal dates with month/day");const h=d||a.weekday&&!c;let f,g,p=$s(r,n);h?(f=Ws,g=Bs,p=Cs(p)):i?(f=Us,g=Zs,p=Ds(p)):(f=qs,g=zs);let y=!1;for(const e of f){V(a[e])?a[e]=y?g[e]:p[e]:y=!0}const v=h?function(e){const t=_(e.weekYear),s=z(e.weekNumber,1,K(e.weekYear)),r=z(e.weekday,1,7);return t?s?!r&&ws("weekday",e.weekday):ws("week",e.week):ws("weekYear",e.weekYear)}(a):i?function(e){const t=_(e.year),s=z(e.ordinal,1,Y(e.year));return t?!s&&ws("ordinal",e.ordinal):ws("year",e.year)}(a):xs(a),w=v||Ls(a);if(w)return Ks.invalid(w);const S=h?Is(a):i?Ms(a):a,[T,b]=Vs(S,n,s),C=new Ks({ts:T,zone:s,o:b,loc:m});return a.weekday&&c&&e.weekday!==C.weekday?Ks.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${C.toISO()}`):C}static fromISO(e,t={}){const[s,r]=function(e){return tt(e,[xt,Nt],[Lt,Ot],[kt,Ft],[Et,jt])}(e);return _s(s,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[s,r]=function(e){return tt(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[St,Tt])}(e);return _s(s,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[s,r]=function(e){return tt(e,[bt,Dt],[Ct,Dt],[It,Mt])}(e);return _s(s,r,t,"HTTP",t)}static fromFormat(e,t,s={}){if(V(e)||V(t))throw new u("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:n=null}=s,a=Ke.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0}),[i,o,l,c]=function(e,t,s){const{result:r,zone:n,specificOffset:a,invalidReason:i}=gs(e,t,s);return[r,n,a,i]}(a,e,t);return c?Ks.invalid(c):_s(i,o,s,`format ${t}`,e,l)}static fromString(e,t,s={}){return Ks.fromFormat(e,t,s)}static fromSQL(e,t={}){const[s,r]=function(e){return tt(e,[Vt,Nt],[Ht,_t])}(e);return _s(s,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the DateTime is invalid");const s=e instanceof Ce?e:new Ce(e,t);if(Re.throwOnInvalid)throw new n(s);return new Ks({invalid:s})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const s=ps(e,Ke.fromObject(t));return s?s.map((e=>e?e.val:null)).join(""):null}static expandFormat(e,t={}){return fs(be.parseFormat(e),Ke.fromObject(t)).map((e=>e.val)).join("")}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Os(this).weekYear:NaN}get weekNumber(){return this.isValid?Os(this).weekNumber:NaN}get weekday(){return this.isValid?Os(this).weekday:NaN}get ordinal(){return this.isValid?Ds(this.c).ordinal:NaN}get monthShort(){return this.isValid?Xt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Xt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Xt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Xt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return G(this.year)}get daysInMonth(){return J(this.year,this.month)}get daysInYear(){return this.isValid?Y(this.year):NaN}get weeksInWeekYear(){return this.isValid?K(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:s,calendar:r}=be.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:s,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Oe.instance(e),t)}toLocal(){return this.setZone(Re.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:s=!1}={}){if((e=je(e,Re.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||s){const t=e.offset(this.ts),s=this.toObject();[r]=Vs(s,t,e)}return Fs(this,{ts:r,zone:e})}return Ks.invalid(Ns(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:s}={}){return Fs(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:s})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=re(e,Gs),s=!V(t.weekYear)||!V(t.weekNumber)||!V(t.weekday),r=!V(t.ordinal),n=!V(t.year),a=!V(t.month)||!V(t.day),i=n||a,l=t.weekYear||t.weekNumber;if((i||r)&&l)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&r)throw new o("Can't mix ordinal dates with month/day");let u;s?u=Is({...Cs(this.c),...t}):V(t.ordinal)?(u={...this.toObject(),...t},V(t.day)&&(u.day=Math.min(J(u.year,u.month),u.day))):u=Ms({...Ds(this.c),...t});const[c,d]=Vs(u,this.o,this.zone);return Fs(this,{ts:c,o:d})}plus(e){if(!this.isValid)return this;return Fs(this,Hs(this,Gt.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Fs(this,Hs(this,Gt.fromDurationLike(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},s=Gt.normalizeUnit(e);switch(s){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===s&&(t.weekday=1),"quarters"===s){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?be.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ks}toLocaleString(e=f,t={}){return this.isValid?be.create(this.loc.clone(t),e).formatDateTime(this):ks}toLocaleParts(e={}){return this.isValid?be.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:n=!1}={}){if(!this.isValid)return null;const a="extended"===e;let i=Ps(this,a);return i+="T",i+=Rs(this,a,t,s,r,n),i}toISODate({format:e="extended"}={}){return this.isValid?Ps(this,"extended"===e):null}toISOWeekDate(){return As(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:n=!1,format:a="extended"}={}){if(!this.isValid)return null;return(r?"T":"")+Rs(this,"extended"===a,t,e,s,n)}toRFC2822(){return As(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return As(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ps(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(s&&(r+=" "),t?r+="z":e&&(r+="ZZ")),As(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ks}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",s={}){if(!this.isValid||!e.isValid)return Gt.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},n=(o=t,Array.isArray(o)?o:[o]).map(Gt.normalizeUnit),a=e.valueOf()>this.valueOf(),i=Qt(a?this:e,a?e:this,n,r);var o;return a?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(Ks.now(),e,t)}until(e){return this.isValid?Jt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const s=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t)<=s&&s<=r.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ks.fromObject({},{zone:this.zone}),s=e.padding?this<t?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],n=e.unit;return Array.isArray(e.unit)&&(r=e.unit,n=void 0),Js(t,this.plus(s),{...e,numeric:"always",units:r,unit:n})}toRelativeCalendar(e={}){return this.isValid?Js(e.base||Ks.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Ks.isDateTime))throw new u("min requires all arguments be DateTimes");return P(e,(e=>e.valueOf()),Math.min)}static max(...e){if(!e.every(Ks.isDateTime))throw new u("max requires all arguments be DateTimes");return P(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,s={}){const{locale:r=null,numberingSystem:n=null}=s;return gs(Ke.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,s={}){return Ks.fromFormatExplain(e,t,s)}static get DATE_SHORT(){return f}static get DATE_MED(){return g}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return y}static get DATE_HUGE(){return v}static get TIME_SIMPLE(){return w}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return T}static get TIME_WITH_LONG_OFFSET(){return b}static get TIME_24_SIMPLE(){return C}static get TIME_24_WITH_SECONDS(){return I}static get TIME_24_WITH_SHORT_OFFSET(){return D}static get TIME_24_WITH_LONG_OFFSET(){return M}static get DATETIME_SHORT(){return x}static get DATETIME_SHORT_WITH_SECONDS(){return L}static get DATETIME_MED(){return k}static get DATETIME_MED_WITH_SECONDS(){return E}static get DATETIME_MED_WITH_WEEKDAY(){return N}static get DATETIME_FULL(){return O}static get DATETIME_FULL_WITH_SECONDS(){return F}static get DATETIME_HUGE(){return j}static get DATETIME_HUGE_WITH_SECONDS(){return $}}function Qs(e){if(Ks.isDateTime(e))return e;if(e&&e.valueOf&&H(e.valueOf()))return Ks.fromJSDate(e);if(e&&"object"==typeof e)return Ks.fromObject(e);throw new u(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const er="3.1.0"}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s("./server/scripts/modules/currentweatherscroll.mjs"),s("./server/scripts/modules/currentweather.mjs"),s("./server/scripts/modules/almanac.mjs"),s("./server/scripts/modules/icons.mjs"),s("./server/scripts/modules/extendedforecast.mjs"),s("./server/scripts/modules/hourly.mjs"),s("./server/scripts/modules/latestobservations.mjs"),s("./server/scripts/modules/localforecast.mjs"),s("./server/scripts/modules/radar.mjs"),s("./server/scripts/modules/regionalforecast.mjs"),s("./server/scripts/modules/travelforecast.mjs"),s("./server/scripts/modules/progress.mjs");s("./server/scripts/index.mjs")})();
|
||
//# sourceMappingURL=ws.min.js.map
|