ws4kp/dist/resources/ws.min.js.map
2022-12-07 10:53:18 -06:00

1 line
510 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"ws.min.js","mappings":"6NAMAA,SAASC,iBAAiB,oBAAoB,KAC7CC,GAAM,IAGP,MAAMC,EAAY,CAAC,EAEnB,IAAIC,GAAkB,EAClBC,GAAqB,EAEzB,MAUMC,EAVa,CAClB,gBACA,MAAO,UAAW,OAAQ,MAAO,QAAS,OAAQ,SAAU,OAAQ,QAAS,OAAQ,YAAa,MAAO,QAAS,SAAU,YAAa,QACzI,iBAAkB,sBAAuB,WAAY,qBAAsB,MAC3E,UACA,QAAS,aAAc,cAAe,SAAU,iBAAkB,2BAA4B,OAAQ,YACtG,kBAAmB,aAAc,gBAAiB,eAAgB,mBAClE,UAAW,QAAS,SAAU,OAAQ,OAAQ,SAC9C,SAAU,mBAEaC,KAAK,KAEvBL,EAAO,KACZF,SAASQ,eAAe,cAAcP,iBAAiB,SAAUQ,IAChEA,EAAEC,OAAOC,QAAQ,KAGlB,IAAAC,qBAAoBC,GAEpBb,SAASQ,eAAe,gBAAgBP,iBAAiB,QAASa,GAClEd,SAASQ,eAAe,mBAAmBP,iBAAiB,QAASc,GACrEf,SAASQ,eAAe,gBAAgBP,iBAAiB,QAASe,GAClEhB,SAASQ,eAAe,oBAAoBP,iBAAiB,QAASgB,GACtEjB,SAASQ,eAAe,gBAAgBP,iBAAiB,QAASiB,GAClElB,SAASQ,eAAe,oBAAoBP,iBAAiB,QAASkB,GACtEnB,SAASQ,eAAe,aAAaP,iBAAiB,QAASmB,GAE/DpB,SAASQ,eAAe,UAAUP,iBAAiB,SAAS,KACvDD,SAASqB,mBAAmBC,GAA0B,IAG3DtB,SAASC,iBAAiB,UAAWsB,GACrCvB,SAASC,iBAAiB,aAAcQ,IAAYJ,GAAoBI,EAAEe,gBAAgB,IAE1FC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4C,WAAWD,GACtB,GAAIA,GAAsC,iBAAhBA,EAC/B,OAAOp4C,GAASoiC,WAAWgW,GAE3B,MAAM,IAAIxxB,EACR,8BAA8BwxB,qBAA+BA,IAGnE,CAEA,MAAME,GAAU,O,GCz8NZC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBt0C,IAAjBu0C,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,CAAC,GAOX,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,OACf,CCrBAH,EAAoB1jC,EAAI,CAAC6jC,EAASG,KACjC,IAAI,IAAIrpC,KAAOqpC,EACXN,EAAoB/vB,EAAEqwB,EAAYrpC,KAAS+oC,EAAoB/vB,EAAEkwB,EAASlpC,IAC5EH,OAAOypC,eAAeJ,EAASlpC,EAAK,CAAEupC,YAAY,EAAMv+B,IAAKq+B,EAAWrpC,IAE1E,ECND+oC,EAAoB/vB,EAAI,CAACa,EAAKC,IAAUja,OAAOka,UAAUH,eAAe/tB,KAAKguB,EAAKC,GCClFivB,EAAoBp9B,EAAKu9B,IACH,oBAAX/lC,QAA0BA,OAAOqmC,aAC1C3pC,OAAOypC,eAAeJ,EAAS/lC,OAAOqmC,YAAa,CAAEjhD,MAAO,WAE7DsX,OAAOypC,eAAeJ,EAAS,aAAc,CAAE3gD,OAAO,GAAO,ECH9DwgD,EAAoB,qDAEpBA,EAAoB,+CACpBA,EAAoB,wCACpBA,EAAoB,sCACpBA,EAAoB,iDACpBA,EAAoB,uCACpBA,EAAoB,mDACpBA,EAAoB,8CACpBA,EAAoB,sCACpBA,EAAoB,iDACpBA,EAAoB,+CACpBA,EAAoB,yCACMA,EAAoB,6B","sources":["webpack://ws4kp/./server/scripts/index.mjs","webpack://ws4kp/./server/scripts/modules/almanac.mjs","webpack://ws4kp/./server/scripts/modules/currentweather.mjs","webpack://ws4kp/./server/scripts/modules/currentweatherscroll.mjs","webpack://ws4kp/./server/scripts/modules/extendedforecast.mjs","webpack://ws4kp/./server/scripts/modules/hourly.mjs","webpack://ws4kp/./server/scripts/modules/icons.mjs","webpack://ws4kp/./server/scripts/modules/latestobservations.mjs","webpack://ws4kp/./server/scripts/modules/localforecast.mjs","webpack://ws4kp/./server/scripts/modules/navigation.mjs","webpack://ws4kp/./server/scripts/modules/progress.mjs","webpack://ws4kp/./server/scripts/modules/radar.mjs","webpack://ws4kp/./server/scripts/modules/regionalforecast.mjs","webpack://ws4kp/./server/scripts/modules/status.mjs","webpack://ws4kp/./server/scripts/modules/travelforecast.mjs","webpack://ws4kp/./server/scripts/modules/utils/calc.mjs","webpack://ws4kp/./server/scripts/modules/utils/cors.mjs","webpack://ws4kp/./server/scripts/modules/utils/elem.mjs","webpack://ws4kp/./server/scripts/modules/utils/fetch.mjs","webpack://ws4kp/./server/scripts/modules/utils/image.mjs","webpack://ws4kp/./server/scripts/modules/utils/nosleep.mjs","webpack://ws4kp/./server/scripts/modules/utils/string.mjs","webpack://ws4kp/./server/scripts/modules/utils/units.mjs","webpack://ws4kp/./server/scripts/modules/utils/weather.mjs","webpack://ws4kp/./server/scripts/modules/weatherdisplay.mjs","webpack://ws4kp/./server/scripts/vendor/auto/luxon.mjs","webpack://ws4kp/webpack/bootstrap","webpack://ws4kp/webpack/runtime/define property getters","webpack://ws4kp/webpack/runtime/hasOwnProperty shorthand","webpack://ws4kp/webpack/runtime/make namespace object","webpack://ws4kp/webpack/startup"],"sourcesContent":["import { json } from './modules/utils/fetch.mjs';\nimport noSleep from './modules/utils/nosleep.mjs';\nimport {\n\tmessage as navMessage, isPlaying, resize, resetStatuses, latLonReceived, stopAutoRefreshTimer, registerRefreshData,\n} from './modules/navigation.mjs';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\tinit();\n});\n\nconst overrides = {};\n\nlet AutoSelectQuery = false;\nlet FullScreenOverride = false;\n\nconst categories = [\n\t'Land Features',\n\t'Bay', 'Channel', 'Cove', 'Dam', 'Delta', 'Gulf', 'Lagoon', 'Lake', 'Ocean', 'Reef', 'Reservoir', 'Sea', 'Sound', 'Strait', 'Waterfall', 'Wharf', // Water Features\n\t'Amusement Park', 'Historical Monument', 'Landmark', 'Tourist Attraction', 'Zoo', // POI/Arts and Entertainment\n\t'College', // POI/Education\n\t'Beach', 'Campground', 'Golf Course', 'Harbor', 'Nature Reserve', 'Other Parks and Outdoors', 'Park', 'Racetrack',\n\t'Scenic Overlook', 'Ski Resort', 'Sports Center', 'Sports Field', 'Wildlife Reserve', // POI/Parks and Outdoors\n\t'Airport', 'Ferry', 'Marina', 'Pier', 'Port', 'Resort', // POI/Travel\n\t'Postal', 'Populated Place',\n];\nconst cats = categories.join(',');\n\nconst init = () => {\n\tdocument.getElementById('txtAddress').addEventListener('focus', (e) => {\n\t\te.target.select();\n\t});\n\n\tregisterRefreshData(LoadTwcData);\n\n\tdocument.getElementById('NavigateMenu').addEventListener('click', btnNavigateMenuClick);\n\tdocument.getElementById('NavigateRefresh').addEventListener('click', btnNavigateRefreshClick);\n\tdocument.getElementById('NavigateNext').addEventListener('click', btnNavigateNextClick);\n\tdocument.getElementById('NavigatePrevious').addEventListener('click', btnNavigatePreviousClick);\n\tdocument.getElementById('NavigatePlay').addEventListener('click', btnNavigatePlayClick);\n\tdocument.getElementById('ToggleFullScreen').addEventListener('click', btnFullScreenClick);\n\tdocument.getElementById('btnGetGps').addEventListener('click', btnGetGpsClick);\n\n\tdocument.getElementById('divTwc').addEventListener('click', () => {\n\t\tif (document.fullscreenElement) UpdateFullScreenNavigate();\n\t});\n\n\tdocument.addEventListener('keydown', documentKeydown);\n\tdocument.addEventListener('touchmove', (e) => { if (FullScreenOverride) e.preventDefault(); });\n\n\t$('#frmGetLatLng #txtAddress').devbridgeAutocomplete({\n\t\tserviceUrl: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest',\n\t\tdeferRequestBy: 300,\n\t\tparamName: 'text',\n\t\tparams: {\n\t\t\tf: 'json',\n\t\t\tcountryCode: 'USA', // 'USA,PRI,VIR,GUM,ASM',\n\t\t\tcategory: cats,\n\t\t\tmaxSuggestions: 10,\n\t\t},\n\t\tdataType: 'json',\n\t\ttransformResult: (response) => {\n\t\t\tif (AutoSelectQuery) {\n\t\t\t\tAutoSelectQuery = false;\n\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\t$(ac.suggestionsContainer.children[0]).click();\n\t\t\t\t}, 1);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsuggestions: $.map(response.suggestions, (i) => ({\n\t\t\t\t\tvalue: i.text,\n\t\t\t\t\tdata: i.magicKey,\n\t\t\t\t})),\n\t\t\t};\n\t\t},\n\t\tminChars: 3,\n\t\tshowNoSuggestionNotice: true,\n\t\tnoSuggestionNotice: 'No results found. Please try a different search string.',\n\t\tonSelect(suggestion) { autocompleteOnSelect(suggestion, this); },\n\t\twidth: 490,\n\t});\n\n\tconst ac = $('#frmGetLatLng #txtAddress').devbridgeAutocomplete();\n\t$('#frmGetLatLng').on('submit', () => {\n\t\tif (ac.suggestions[0]) $(ac.suggestionsContainer.children[0]).click();\n\t\treturn false;\n\t});\n\n\t// Auto load the previous query\n\tconst TwcQuery = localStorage.getItem('TwcQuery');\n\tif (TwcQuery) {\n\t\tAutoSelectQuery = true;\n\t\tconst txtAddress = document.getElementById('txtAddress');\n\t\ttxtAddress.value = TwcQuery;\n\t\ttxtAddress.blur();\n\t\ttxtAddress.focus();\n\t}\n\n\tconst TwcPlay = localStorage.getItem('TwcPlay');\n\tif (TwcPlay === null || TwcPlay === 'true') postMessage('navButton', 'play');\n\n\tdocument.getElementById('btnClearQuery').addEventListener('click', () => {\n\t\tdocument.getElementById('spanCity').innerHTML = '';\n\t\tdocument.getElementById('spanState').innerHTML = '';\n\t\tdocument.getElementById('spanStationId').innerHTML = '';\n\t\tdocument.getElementById('spanRadarId').innerHTML = '';\n\t\tdocument.getElementById('spanZoneId').innerHTML = '';\n\n\t\tlocalStorage.removeItem('TwcScrollText');\n\t\tlocalStorage.removeItem('TwcScrollTextChecked');\n\n\t\tdocument.getElementById('chkAutoRefresh').checked = true;\n\t\tlocalStorage.removeItem('TwcAutoRefresh');\n\n\t\tdocument.getElementById('radEnglish').checked = true;\n\n\t\tlocalStorage.removeItem('TwcPlay');\n\t\tpostMessage('navButton', 'play');\n\n\t\tlocalStorage.removeItem('TwcQuery');\n\t});\n\n\t// swipe functionality\n\tdocument.getElementById('container').addEventListener('swiped-left', () => swipeCallBack('left'));\n\tdocument.getElementById('container').addEventListener('swiped-right', () => swipeCallBack('right'));\n};\n\nconst autocompleteOnSelect = async (suggestion, elem) => {\n\t// Do not auto get the same city twice.\n\tif (elem.previousSuggestionValue === suggestion.value) return;\n\n\tif (overrides[suggestion.value]) {\n\t\tdoRedirectToGeometry(overrides[suggestion.value]);\n\t} else {\n\t\tconst data = await json('https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find', {\n\t\t\tdata: {\n\t\t\t\ttext: suggestion.value,\n\t\t\t\tmagicKey: suggestion.data,\n\t\t\t\tf: 'json',\n\t\t\t},\n\t\t});\n\n\t\tconst loc = data.locations[0];\n\t\tif (loc) {\n\t\t\tdoRedirectToGeometry(loc.feature.geometry);\n\t\t} else {\n\t\t\tconsole.error('An unexpected error occurred. Please try a different search string.');\n\t\t}\n\t}\n};\n\nconst doRedirectToGeometry = (geom) => {\n\tconst latLon = { lat: Math.round2(geom.y, 4), lon: Math.round2(geom.x, 4) };\n\tLoadTwcData(latLon);\n\t// Save the query\n\tlocalStorage.setItem('TwcQuery', document.getElementById('txtAddress').value);\n};\n\nconst btnFullScreenClick = () => {\n\tif (!document.fullscreenElement) {\n\t\tEnterFullScreen();\n\t} else {\n\t\tExitFullscreen();\n\t}\n\n\tif (isPlaying()) {\n\t\tnoSleep(true);\n\t} else {\n\t\tnoSleep(false);\n\t}\n\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nconst EnterFullScreen = () => {\n\tconst element = document.getElementById('divTwc');\n\n\t// Supports most browsers and their versions.\n\tconst requestMethod = element.requestFullScreen || element.webkitRequestFullScreen\n\t\t\t|| element.mozRequestFullScreen || element.msRequestFullscreen;\n\n\tif (requestMethod) {\n\t\t// Native full screen.\n\t\trequestMethod.call(element, { navigationUI: 'hide' }); // https://bugs.chromium.org/p/chromium/issues/detail?id=933436#c7\n\t} else {\n\t\t// iOS doesn't support FullScreen API.\n\t\twindow.scrollTo(0, 0);\n\t\tFullScreenOverride = true;\n\t}\n\tresize();\n\tUpdateFullScreenNavigate();\n\n\t// change hover text\n\tdocument.getElementById('ToggleFullScreen').title = 'Exit fullscreen';\n};\n\nconst ExitFullscreen = () => {\n\t// exit full-screen\n\n\tif (FullScreenOverride) {\n\t\tFullScreenOverride = false;\n\t}\n\n\tif (document.exitFullscreen) {\n\t\t// Chrome 71 broke this if the user pressed F11 to enter full screen mode.\n\t\tdocument.exitFullscreen();\n\t} else if (document.webkitExitFullscreen) {\n\t\tdocument.webkitExitFullscreen();\n\t} else if (document.mozCancelFullScreen) {\n\t\tdocument.mozCancelFullScreen();\n\t} else if (document.msExitFullscreen) {\n\t\tdocument.msExitFullscreen();\n\t}\n\tresize();\n\t// change hover text\n\tdocument.getElementById('ToggleFullScreen').title = 'Enter fullscreen';\n};\n\nconst btnNavigateMenuClick = () => {\n\tpostMessage('navButton', 'menu');\n\tUpdateFullScreenNavigate();\n\treturn false;\n};\n\nconst LoadTwcData = (_latLon) => {\n\t// if latlon is provided store it locally\n\tif (_latLon) LoadTwcData.latLon = _latLon;\n\t// get the data\n\tconst { latLon } = LoadTwcData;\n\t// if there's no data stop\n\tif (!latLon) return;\n\n\tdocument.getElementById('txtAddress').blur();\n\tstopAutoRefreshTimer();\n\tlatLonReceived(latLon);\n};\n\nconst swipeCallBack = (direction) => {\n\tswitch (direction) {\n\tcase 'left':\n\t\tbtnNavigateNextClick();\n\t\tbreak;\n\n\tcase 'right':\n\tdefault:\n\t\tbtnNavigatePreviousClick();\n\t\tbreak;\n\t}\n};\n\nconst btnNavigateRefreshClick = () => {\n\tresetStatuses();\n\tLoadTwcData();\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nconst btnNavigateNextClick = () => {\n\tpostMessage('navButton', 'next');\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nconst btnNavigatePreviousClick = () => {\n\tpostMessage('navButton', 'previous');\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nlet NavigateFadeIntervalId = null;\n\nconst UpdateFullScreenNavigate = () => {\n\tdocument.activeElement.blur();\n\tdocument.getElementById('divTwcBottom').classList.remove('hidden');\n\tdocument.getElementById('divTwcBottom').classList.add('visible');\n\n\tif (NavigateFadeIntervalId) {\n\t\tclearTimeout(NavigateFadeIntervalId);\n\t\tNavigateFadeIntervalId = null;\n\t}\n\n\tNavigateFadeIntervalId = setTimeout(() => {\n\t\tif (document.fullscreenElement) {\n\t\t\tdocument.getElementById('divTwcBottom').classList.remove('visible');\n\t\t\tdocument.getElementById('divTwcBottom').classList.add('hidden');\n\t\t}\n\t}, 2000);\n};\n\nconst documentKeydown = (e) => {\n\tconst code = (e.keyCode || e.which);\n\n\t// 200ms repeat\n\tif ((Date.now() - documentKeydown.lastButton ?? 0) < 200) return false;\n\tdocumentKeydown.lastButton = Date.now();\n\n\tif (document.fullscreenElement || document.activeElement === document.body) {\n\t\tswitch (code) {\n\t\tcase 32: // Space\n\t\t\tbtnNavigatePlayClick();\n\t\t\treturn false;\n\n\t\tcase 39: // Right Arrow\n\t\tcase 34: // Page Down\n\t\t\tbtnNavigateNextClick();\n\t\t\treturn false;\n\n\t\tcase 37: // Left Arrow\n\t\tcase 33: // Page Up\n\t\t\tbtnNavigatePreviousClick();\n\t\t\treturn false;\n\n\t\tcase 36: // Home\n\t\t\tbtnNavigateMenuClick();\n\t\t\treturn false;\n\n\t\tcase 48: // Restart\n\t\t\tbtnNavigateRefreshClick();\n\t\t\treturn false;\n\n\t\tcase 70: // F\n\t\t\tbtnFullScreenClick();\n\t\t\treturn false;\n\n\t\tdefault:\n\t\t}\n\t}\n\treturn false;\n};\n\nMath.round2 = (value, decimals) => Number(`${Math.round(`${value}e${decimals}`)}e-${decimals}`);\n\nconst btnNavigatePlayClick = () => {\n\tpostMessage('navButton', 'playToggle');\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\n// post a message to the iframe\nconst postMessage = (type, myMessage = {}) => {\n\tnavMessage({ type, message: myMessage });\n};\n\nconst btnGetGpsClick = async () => {\n\tif (!navigator.geolocation) return;\n\n\tconst position = await (() => new Promise((resolve) => {\n\t\tnavigator.geolocation.getCurrentPosition(resolve);\n\t}))();\n\tconst { latitude, longitude } = position.coords;\n\n\tlet data;\n\ttry {\n\t\tdata = await json('https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode', {\n\t\t\tdata: {\n\t\t\t\tlocation: `${longitude},${latitude}`,\n\t\t\t\tdistance: 1000, // Find location up to 1 KM.\n\t\t\t\tf: 'json',\n\t\t\t},\n\t\t});\n\t} catch (e) {\n\t\tconsole.error('Unable to fetch reverse geocode');\n\t\tconsole.error(e.status, e.responseJSONe);\n\t}\n\tconst ZipCode = data.address.Postal;\n\tconst { City } = data.address;\n\tconst State = states.getTwoDigitCode(data.address.Region);\n\tconst Country = data.address.CountryCode;\n\tconst TwcQuery = `${ZipCode}, ${City}, ${State}, ${Country}`;\n\n\tconst txtAddress = document.getElementById('txtAddress');\n\ttxtAddress.value = TwcQuery;\n\ttxtAddress.blur();\n\ttxtAddress.focus();\n\n\t// Save the query\n\tlocalStorage.setItem('TwcQuery', TwcQuery);\n};\n","// display sun and moon data\nimport { loadImg, preloadImg } from './utils/image.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport STATUS from './status.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass Almanac extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Almanac', true);\n\n\t\t// pre-load background images (returns promises)\n\t\tthis.backgroundImage0 = loadImg('images/BackGround3_1.png');\n\n\t\t// preload the moon images\n\t\tpreloadImg('images/2/Full-Moon.gif');\n\t\tpreloadImg('images/2/Last-Quarter.gif');\n\t\tpreloadImg('images/2/New-Moon.gif');\n\t\tpreloadImg('images/2/First-Quarter.gif');\n\n\t\tthis.timing.totalScreens = 1;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// get sun/moon data\n\t\tconst { sun, moon } = this.calcSunMoonData(weatherParameters);\n\n\t\t// store the data\n\t\tthis.data = {\n\t\t\tsun,\n\t\t\tmoon,\n\t\t};\n\t\t// update status\n\t\tthis.setStatus(STATUS.loaded);\n\n\t\t// share data\n\t\tthis.getDataCallback();\n\t}\n\n\tcalcSunMoonData(weatherParameters) {\n\t\tconst sun = [\n\t\t\tSunCalc.getTimes(new Date(), weatherParameters.latitude, weatherParameters.longitude),\n\t\t\tSunCalc.getTimes(DateTime.local().plus({ days: 1 }).toJSDate(), weatherParameters.latitude, weatherParameters.longitude),\n\t\t];\n\n\t\t// brute force the moon phases by scanning the next 30 days\n\t\tconst moon = [];\n\t\t// start with yesterday\n\t\tlet moonDate = DateTime.local().minus({ days: 1 });\n\t\tlet { phase } = SunCalc.getMoonIllumination(moonDate.toJSDate());\n\t\tlet iterations = 0;\n\t\tdo {\n\t\t\t// get yesterday's moon info\n\t\t\tconst lastPhase = phase;\n\t\t\t// calculate new values\n\t\t\tmoonDate = moonDate.plus({ days: 1 });\n\t\t\tphase = SunCalc.getMoonIllumination(moonDate.toJSDate()).phase;\n\t\t\t// check for 4 cases\n\t\t\tif (lastPhase < 0.25 && phase >= 0.25) moon.push(this.getMoonTransition(0.25, 'First', moonDate));\n\t\t\tif (lastPhase < 0.50 && phase >= 0.50) moon.push(this.getMoonTransition(0.50, 'Full', moonDate));\n\t\t\tif (lastPhase < 0.75 && phase >= 0.75) moon.push(this.getMoonTransition(0.75, 'Last', moonDate));\n\t\t\tif (lastPhase > phase) moon.push(this.getMoonTransition(0.00, 'New', moonDate));\n\n\t\t\t// stop after 30 days or 4 moon phases\n\t\t\titerations += 1;\n\t\t} while (iterations <= 30 && moon.length < 4);\n\n\t\treturn {\n\t\t\tsun,\n\t\t\tmoon,\n\t\t};\n\t}\n\n\t// get moon transition from one phase to the next by drilling down by hours, minutes and seconds\n\tgetMoonTransition(threshold, phaseName, start, iteration = 0) {\n\t\tlet moonDate = start;\n\t\tlet { phase } = SunCalc.getMoonIllumination(moonDate.toJSDate());\n\t\tlet iterations = 0;\n\t\tconst step = {\n\t\t\thours: iteration === 0 ? -1 : 0,\n\t\t\tminutes: iteration === 1 ? 1 : 0,\n\t\t\tseconds: iteration === 2 ? -1 : 0,\n\t\t\tmilliseconds: iteration === 3 ? 1 : 0,\n\t\t};\n\n\t\t// increasing test\n\t\tlet test = (lastPhase, testPhase) => lastPhase < threshold && testPhase >= threshold;\n\t\t// decreasing test\n\t\tif (iteration % 2 === 0) test = (lastPhase, testPhase) => lastPhase > threshold && testPhase <= threshold;\n\n\t\tdo {\n\t\t// store last phase\n\t\t\tconst lastPhase = phase;\n\t\t\t// calculate new phase after step\n\t\t\tmoonDate = moonDate.plus(step);\n\t\t\tphase = SunCalc.getMoonIllumination(moonDate.toJSDate()).phase;\n\t\t\t// wrap phases > 0.9 to -0.1 for ease of detection\n\t\t\tif (phase > 0.9) phase -= 1.0;\n\t\t\t// compare\n\t\t\tif (test(lastPhase, phase)) {\n\t\t\t// last iteration is three, return value\n\t\t\t\tif (iteration >= 3) break;\n\t\t\t\t// iterate recursively\n\t\t\t\treturn this.getMoonTransition(threshold, phaseName, moonDate, iteration + 1);\n\t\t\t}\n\t\t\titerations += 1;\n\t\t} while (iterations < 1000);\n\n\t\treturn { phase: phaseName, date: moonDate };\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst info = this.data;\n\t\tconst Today = DateTime.local();\n\t\tconst Tomorrow = Today.plus({ days: 1 });\n\n\t\t// sun and moon data\n\t\tthis.elem.querySelector('.day-1').innerHTML = Today.toLocaleString({ weekday: 'long' });\n\t\tthis.elem.querySelector('.day-2').innerHTML = Tomorrow.toLocaleString({ weekday: 'long' });\n\t\tthis.elem.querySelector('.rise-1').innerHTML = DateTime.fromJSDate(info.sun[0].sunrise).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\t\tthis.elem.querySelector('.rise-2').innerHTML = DateTime.fromJSDate(info.sun[1].sunrise).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\t\tthis.elem.querySelector('.set-1').innerHTML = DateTime.fromJSDate(info.sun[0].sunset).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\t\tthis.elem.querySelector('.set-2').innerHTML = DateTime.fromJSDate(info.sun[1].sunset).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\n\t\tconst days = info.moon.map((MoonPhase) => {\n\t\t\tconst fill = {};\n\n\t\t\tconst date = MoonPhase.date.toLocaleString({ month: 'short', day: 'numeric' });\n\n\t\t\tfill.date = date;\n\t\t\tfill.type = MoonPhase.phase;\n\t\t\tfill.icon = { type: 'img', src: Almanac.imageName(MoonPhase.Phase) };\n\n\t\t\treturn this.fillTemplate('day', fill);\n\t\t});\n\n\t\tconst daysContainer = this.elem.querySelector('.moon .days');\n\t\tdaysContainer.innerHTML = '';\n\t\tdaysContainer.append(...days);\n\n\t\tthis.finishDraw();\n\t}\n\n\tstatic imageName(type) {\n\t\tswitch (type) {\n\t\tcase 'Full':\n\t\t\treturn 'images/2/Full-Moon.gif';\n\t\tcase 'Last':\n\t\t\treturn 'images/2/Last-Quarter.gif';\n\t\tcase 'New':\n\t\t\treturn 'images/2/New-Moon.gif';\n\t\tcase 'First':\n\t\tdefault:\n\t\t\treturn 'images/2/First-Quarter.gif';\n\t\t}\n\t}\n\n\t// make sun and moon data available outside this class\n\t// promise allows for data to be requested before it is available\n\tasync getSun() {\n\t\treturn new Promise((resolve) => {\n\t\t\tif (this.data) resolve(this.data);\n\t\t\t// data not available, put it into the data callback queue\n\t\t\tthis.getDataCallbacks.push(resolve);\n\t\t});\n\t}\n}\n\n// register display\nconst display = new Almanac(7, 'almanac');\nregisterDisplay(display);\n\nexport default display.getSun.bind(display);\n","// current weather conditions display\nimport STATUS from './status.mjs';\nimport { loadImg, preloadImg } from './utils/image.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { directionToNSEW } from './utils/calc.mjs';\nimport { locationCleanup } from './utils/string.mjs';\nimport { getWeatherIconFromIconLink } from './icons.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\nimport {\n\tcelsiusToFahrenheit, kphToMph, pascalToInHg, metersToFeet, kilometersToMiles,\n} from './utils/units.mjs';\n\nclass CurrentWeather extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Current Conditions', true);\n\t\t// pre-load background image (returns promise)\n\t\tthis.backgroundImage = loadImg('images/BackGround1_1.png');\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// Load the observations\n\t\tlet observations; let\n\t\t\tstation;\n\t\t// station number counter\n\t\tlet stationNum = 0;\n\t\twhile (!observations && stationNum < weatherParameters.stations.length) {\n\t\t\t// get the station\n\t\t\tstation = weatherParameters.stations[stationNum];\n\t\t\tstationNum += 1;\n\t\t\ttry {\n\t\t\t\t// station observations\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tobservations = await json(`${station.id}/observations`, {\n\t\t\t\t\tcors: true,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tlimit: 2,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\t// test data quality\n\t\t\t\tif (observations.features[0].properties.temperature.value === null\n\t\t\t\t\t|| observations.features[0].properties.windSpeed.value === null\n\t\t\t\t\t|| observations.features[0].properties.textDescription === null) {\n\t\t\t\t\tobservations = undefined;\n\t\t\t\t\tthrow new Error(`Unable to get observations: ${station.properties.stationIdentifier}, trying next station`);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t\t// test for data received\n\t\tif (!observations) {\n\t\t\tconsole.error('All current weather stations exhausted');\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\t\t// preload the icon\n\t\tpreloadImg(getWeatherIconFromIconLink(observations.features[0].properties.icon));\n\n\t\t// we only get here if there was no error above\n\t\tthis.data = { ...observations, station };\n\t\tthis.setStatus(STATUS.loaded);\n\n\t\tthis.getDataCallback();\n\t}\n\n\t// format the data for use outside this function\n\tparseData() {\n\t\tif (!this.data) return false;\n\t\tconst data = {};\n\t\tconst observations = this.data.features[0].properties;\n\t\t// values from api are provided in metric\n\t\tdata.observations = observations;\n\t\tdata.Temperature = Math.round(observations.temperature.value);\n\t\tdata.TemperatureUnit = 'C';\n\t\tdata.DewPoint = Math.round(observations.dewpoint.value);\n\t\tdata.Ceiling = Math.round(observations.cloudLayers[0]?.base?.value ?? 0);\n\t\tdata.CeilingUnit = 'm.';\n\t\tdata.Visibility = Math.round(observations.visibility.value / 1000);\n\t\tdata.VisibilityUnit = ' km.';\n\t\tdata.WindSpeed = Math.round(observations.windSpeed.value);\n\t\tdata.WindDirection = directionToNSEW(observations.windDirection.value);\n\t\tdata.Pressure = Math.round(observations.barometricPressure.value);\n\t\tdata.HeatIndex = Math.round(observations.heatIndex.value);\n\t\tdata.WindChill = Math.round(observations.windChill.value);\n\t\tdata.WindGust = Math.round(observations.windGust.value);\n\t\tdata.WindUnit = 'KPH';\n\t\tdata.Humidity = Math.round(observations.relativeHumidity.value);\n\t\tdata.Icon = getWeatherIconFromIconLink(observations.icon);\n\t\tdata.PressureDirection = '';\n\t\tdata.TextConditions = observations.textDescription;\n\t\tdata.station = this.data.station;\n\n\t\t// difference since last measurement (pascals, looking for difference of more than 150)\n\t\tconst pressureDiff = (observations.barometricPressure.value - this.data.features[1].properties.barometricPressure.value);\n\t\tif (pressureDiff > 150) data.PressureDirection = 'R';\n\t\tif (pressureDiff < -150) data.PressureDirection = 'F';\n\n\t\tdata.Temperature = celsiusToFahrenheit(data.Temperature);\n\t\tdata.TemperatureUnit = 'F';\n\t\tdata.DewPoint = celsiusToFahrenheit(data.DewPoint);\n\t\tdata.Ceiling = Math.round(metersToFeet(data.Ceiling) / 100) * 100;\n\t\tdata.CeilingUnit = 'ft.';\n\t\tdata.Visibility = kilometersToMiles(observations.visibility.value / 1000);\n\t\tdata.VisibilityUnit = ' mi.';\n\t\tdata.WindSpeed = kphToMph(data.WindSpeed);\n\t\tdata.WindUnit = 'MPH';\n\t\tdata.Pressure = pascalToInHg(data.Pressure).toFixed(2);\n\t\tdata.HeatIndex = celsiusToFahrenheit(data.HeatIndex);\n\t\tdata.WindChill = celsiusToFahrenheit(data.WindChill);\n\t\tdata.WindGust = kphToMph(data.WindGust);\n\t\treturn data;\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst fill = {};\n\t\t// parse each time to deal with a change in units if necessary\n\t\tconst data = this.parseData();\n\n\t\tfill.temp = data.Temperature + String.fromCharCode(176);\n\n\t\tlet Conditions = data.observations.textDescription;\n\t\tif (Conditions.length > 15) {\n\t\t\tConditions = this.shortConditions(Conditions);\n\t\t}\n\t\tfill.condition = Conditions;\n\n\t\tfill.wind = data.WindDirection.padEnd(3, '') + data.WindSpeed.toString().padStart(3, ' ');\n\t\tif (data.WindGust) fill['wind-gusts'] = `Gusts to ${data.WindGust}`;\n\n\t\tfill.location = locationCleanup(this.data.station.properties.name).substr(0, 20);\n\n\t\tfill.humidity = `${data.Humidity}%`;\n\t\tfill.dewpoint = data.DewPoint + String.fromCharCode(176);\n\t\tfill.ceiling = (data.Ceiling === 0 ? 'Unlimited' : data.Ceiling + data.CeilingUnit);\n\t\tfill.visibility = data.Visibility + data.VisibilityUnit;\n\t\tfill.pressure = `${data.Pressure} ${data.PressureDirection}`;\n\n\t\tif (data.observations.heatIndex.value && data.HeatIndex !== data.Temperature) {\n\t\t\tfill['heat-index-label'] = 'Heat Index:';\n\t\t\tfill['heat-index'] = data.HeatIndex + String.fromCharCode(176);\n\t\t} else if (data.observations.windChill.value && data.WindChill !== '' && data.WindChill < data.Temperature) {\n\t\t\tfill['heat-index-label'] = 'Wind Chill:';\n\t\t\tfill['heat-index'] = data.WindChill + String.fromCharCode(176);\n\t\t}\n\n\t\tfill.icon = { type: 'img', src: data.Icon };\n\n\t\tconst area = this.elem.querySelector('.main');\n\n\t\tarea.innerHTML = '';\n\t\tarea.append(this.fillTemplate('weather', fill));\n\n\t\tthis.finishDraw();\n\t}\n\n\t// make data available outside this class\n\t// promise allows for data to be requested before it is available\n\tasync getCurrentWeather() {\n\t\treturn new Promise((resolve) => {\n\t\t\tif (this.data) resolve(this.parseData());\n\t\t\t// data not available, put it into the data callback queue\n\t\t\tthis.getDataCallbacks.push(() => resolve(this.parseData()));\n\t\t});\n\t}\n\n\tstatic shortConditions(_condition) {\n\t\tlet condition = _condition;\n\t\tcondition = condition.replace(/Light/g, 'L');\n\t\tcondition = condition.replace(/Heavy/g, 'H');\n\t\tcondition = condition.replace(/Partly/g, 'P');\n\t\tcondition = condition.replace(/Mostly/g, 'M');\n\t\tcondition = condition.replace(/Few/g, 'F');\n\t\tcondition = condition.replace(/Thunderstorm/g, 'T\\'storm');\n\t\tcondition = condition.replace(/ in /g, '');\n\t\tcondition = condition.replace(/Vicinity/g, '');\n\t\tcondition = condition.replace(/ and /g, ' ');\n\t\tcondition = condition.replace(/Freezing Rain/g, 'Frz Rn');\n\t\tcondition = condition.replace(/Freezing/g, 'Frz');\n\t\tcondition = condition.replace(/Unknown Precip/g, '');\n\t\tcondition = condition.replace(/L Snow Fog/g, 'L Snw/Fog');\n\t\tcondition = condition.replace(/ with /g, '/');\n\t\treturn condition;\n\t}\n}\nconst display = new CurrentWeather(0, 'current-weather');\nregisterDisplay(display);\n\nexport default display.getCurrentWeather.bind(display);\n","import { locationCleanup } from './utils/string.mjs';\nimport { elemForEach } from './utils/elem.mjs';\nimport getCurrentWeather from './currentweather.mjs';\nimport { currentDisplay } from './navigation.mjs';\n\n// constants\nconst degree = String.fromCharCode(176);\n\n// local variables\nlet interval;\nlet screenIndex = 0;\n\n// start drawing conditions\n// reset starts from the first item in the text scroll list\nconst start = () => {\n\t// store see if the context is new\n\n\t// set up the interval if needed\n\tif (!interval) {\n\t\tinterval = setInterval(incrementInterval, 4000);\n\t}\n\n\t// draw the data\n\tdrawScreen();\n};\n\nconst stop = (reset) => {\n\tif (reset) screenIndex = 0;\n};\n\n// increment interval, roll over\nconst incrementInterval = () => {\n\t// test current screen\n\tconst display = currentDisplay();\n\tif (!display?.okToDrawCurrentConditions) {\n\t\tstop(display?.elemId === 'progress');\n\t\treturn;\n\t}\n\tscreenIndex = (screenIndex + 1) % (screens.length);\n\t// draw new text\n\tdrawScreen();\n};\n\nconst drawScreen = async () => {\n\t// get the conditions\n\tconst data = await getCurrentWeather();\n\n\t// nothing to do if there's no data yet\n\tif (!data) return;\n\n\tdrawCondition(screens[screenIndex](data));\n};\n\n// the \"screens\" are stored in an array for easy addition and removal\nconst screens = [\n\t// station name\n\t(data) => `Conditions at ${locationCleanup(data.station.properties.name).substr(0, 20)}`,\n\n\t// temperature\n\t(data) => {\n\t\tlet text = `Temp: ${data.Temperature}${degree} ${data.TemperatureUnit}`;\n\t\tif (data.observations.heatIndex.value) {\n\t\t\ttext += ` Heat Index: ${data.HeatIndex}${degree} ${data.TemperatureUnit}`;\n\t\t} else if (data.observations.windChill.value) {\n\t\t\ttext += ` Wind Chill: ${data.WindChill}${degree} ${data.TemperatureUnit}`;\n\t\t}\n\t\treturn text;\n\t},\n\n\t// humidity\n\t(data) => `Humidity: ${data.Humidity}${degree} ${data.TemperatureUnit} Dewpoint: ${data.DewPoint}${degree} ${data.TemperatureUnit}`,\n\n\t// barometric pressure\n\t(data) => `Barometric Pressure: ${data.Pressure} ${data.PressureDirection}`,\n\n\t// wind\n\t(data) => {\n\t\tlet text = '';\n\t\tif (data.WindSpeed > 0) {\n\t\t\ttext = `Wind: ${data.WindDirection} ${data.WindSpeed} ${data.WindUnit}`;\n\t\t} else {\n\t\t\ttext = 'Wind: Calm';\n\t\t}\n\t\tif (data.WindGust > 0) {\n\t\t\ttext += ` Gusts to ${data.WindGust}`;\n\t\t}\n\t\treturn text;\n\t},\n\n\t// visibility\n\t(data) => `Visib: ${data.Visibility} ${data.VisibilityUnit} Ceiling: ${data.Ceiling === 0 ? 'Unlimited' : `${data.Ceiling} ${data.CeilingUnit}`}`,\n];\n\n// internal draw function with preset parameters\nconst drawCondition = (text) => {\n\t// update all html scroll elements\n\telemForEach('.weather-display .scroll .fixed', (elem) => {\n\t\telem.innerHTML = text;\n\t});\n};\ndocument.addEventListener('DOMContentLoaded', () => {\n\tstart();\n});\n","// display extended forecast graphically\n// technically uses the same data as the local forecast, we'll let the browser do the caching of that\n\nimport STATUS from './status.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport { getWeatherIconFromIconLink } from './icons.mjs';\nimport { preloadImg } from './utils/image.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass ExtendedForecast extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Extended Forecast', true);\n\n\t\t// set timings\n\t\tthis.timing.totalScreens = 2;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// request us or si units\n\t\tlet forecast;\n\t\ttry {\n\t\t\tforecast = await json(weatherParameters.forecast, {\n\t\t\t\tdata: {\n\t\t\t\t\tunits: 'us',\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error('Unable to get extended forecast');\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\t\t// we only get here if there was no error above\n\t\tthis.data = ExtendedForecast.parse(forecast.properties.periods);\n\t\tthis.screenIndex = 0;\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\t// the api provides the forecast in 12 hour increments, flatten to day increments with high and low temperatures\n\tstatic parse(fullForecast) {\n\t// create a list of days starting with today\n\t\tconst Days = [0, 1, 2, 3, 4, 5, 6];\n\n\t\tconst dates = Days.map((shift) => {\n\t\t\tconst date = DateTime.local().startOf('day').plus({ days: shift });\n\t\t\treturn date.toLocaleString({ weekday: 'short' });\n\t\t});\n\n\t\t// track the destination forecast index\n\t\tlet destIndex = 0;\n\t\tconst forecast = [];\n\t\tfullForecast.forEach((period) => {\n\t\t// create the destination object if necessary\n\t\t\tif (!forecast[destIndex]) {\n\t\t\t\tforecast.push({\n\t\t\t\t\tdayName: '', low: undefined, high: undefined, text: undefined, icon: undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t\t// get the object to modify/populate\n\t\t\tconst fDay = forecast[destIndex];\n\t\t\t// high temperature will always be last in the source array so it will overwrite the low values assigned below\n\t\t\tfDay.icon = getWeatherIconFromIconLink(period.icon);\n\t\t\tfDay.text = ExtendedForecast.shortenExtendedForecastText(period.shortForecast);\n\t\t\tfDay.dayName = dates[destIndex];\n\n\t\t\t// preload the icon\n\t\t\tpreloadImg(fDay.icon);\n\n\t\t\tif (period.isDaytime) {\n\t\t\t// day time is the high temperature\n\t\t\t\tfDay.high = period.temperature;\n\t\t\t\tdestIndex += 1;\n\t\t\t} else {\n\t\t\t// low temperature\n\t\t\t\tfDay.low = period.temperature;\n\t\t\t}\n\t\t});\n\n\t\treturn forecast;\n\t}\n\n\tstatic shortenExtendedForecastText(long) {\n\t\tconst regexList = [\n\t\t\t[/ and /ig, ' '],\n\t\t\t[/Slight /ig, ''],\n\t\t\t[/Chance /ig, ''],\n\t\t\t[/Very /ig, ''],\n\t\t\t[/Patchy /ig, ''],\n\t\t\t[/Areas /ig, ''],\n\t\t\t[/Dense /ig, ''],\n\t\t\t[/Thunderstorm/g, 'T\\'Storm'],\n\t\t];\n\t\t// run all regexes\n\t\tconst short = regexList.reduce((working, [regex, replace]) => working.replace(regex, replace), long);\n\n\t\tlet conditions = short.split(' ');\n\t\tif (short.indexOf('then') !== -1) {\n\t\t\tconditions = short.split(' then ');\n\t\t\tconditions = conditions[1].split(' ');\n\t\t}\n\n\t\tlet short1 = conditions[0].substr(0, 10);\n\t\tlet short2 = '';\n\t\tif (conditions[1]) {\n\t\t\tif (!short1.endsWith('.')) {\n\t\t\t\tshort2 = conditions[1].substr(0, 10);\n\t\t\t} else {\n\t\t\t\tshort1 = short1.replace(/\\./, '');\n\t\t\t}\n\n\t\t\tif (short2 === 'Blowing') {\n\t\t\t\tshort2 = '';\n\t\t\t}\n\t\t}\n\t\tlet result = short1;\n\t\tif (short2 !== '') {\n\t\t\tresult += ` ${short2}`;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\n\t\t// determine bounds\n\t\t// grab the first three or second set of three array elements\n\t\tconst forecast = this.data.slice(0 + 3 * this.screenIndex, 3 + this.screenIndex * 3);\n\n\t\t// create each day template\n\t\tconst days = forecast.map((Day) => {\n\t\t\tconst fill = {};\n\t\t\tfill.date = Day.dayName;\n\n\t\t\tconst { low } = Day;\n\t\t\tif (low !== undefined) {\n\t\t\t\tfill['value-lo'] = Math.round(low);\n\t\t\t}\n\t\t\tconst { high } = Day;\n\t\t\tfill['value-hi'] = Math.round(high);\n\t\t\tfill.condition = Day.text;\n\n\t\t\t// draw the icon\n\t\t\tfill.icon = { type: 'img', src: Day.icon };\n\n\t\t\t// return the filled template\n\t\t\treturn this.fillTemplate('day', fill);\n\t\t});\n\n\t\t// empty and update the container\n\t\tconst dayContainer = this.elem.querySelector('.day-container');\n\t\tdayContainer.innerHTML = '';\n\t\tdayContainer.append(...days);\n\t\tthis.finishDraw();\n\t}\n}\n\n// register display\nregisterDisplay(new ExtendedForecast(6, 'extended-forecast'));\n","// hourly forecast list\n\nimport STATUS from './status.mjs';\nimport { DateTime, Interval, Duration } from '../vendor/auto/luxon.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { celsiusToFahrenheit, kilometersToMiles } from './utils/units.mjs';\nimport { getHourlyIcon } from './icons.mjs';\nimport { directionToNSEW } from './utils/calc.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\nimport getSun from './almanac.mjs';\n\nclass Hourly extends WeatherDisplay {\n\tconstructor(navId, elemId, defaultActive) {\n\t\t// special height and width for scrolling\n\t\tsuper(navId, elemId, 'Hourly Forecast', defaultActive);\n\n\t\t// set up the timing\n\t\tthis.timing.baseDelay = 20;\n\t\t// 24 hours = 6 pages\n\t\tconst pages = 4; // first page is already displayed, last page doesn't happen\n\t\tconst timingStep = 75 * 4;\n\t\tthis.timing.delay = [150 + timingStep];\n\t\t// add additional pages\n\t\tfor (let i = 0; i < pages; i += 1) this.timing.delay.push(timingStep);\n\t\t// add the final 3 second delay\n\t\tthis.timing.delay.push(150);\n\t}\n\n\tasync getData(weatherParameters) {\n\t\t// super checks for enabled\n\t\tif (!super.getData(weatherParameters)) return;\n\t\tlet forecast;\n\t\ttry {\n\t\t\t// get the forecast\n\t\t\tforecast = await json(weatherParameters.forecastGridData);\n\t\t} catch (e) {\n\t\t\tconsole.error('Get hourly forecast failed');\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.data = await Hourly.parseForecast(forecast.properties);\n\n\t\tthis.setStatus(STATUS.loaded);\n\t\tthis.drawLongCanvas();\n\t}\n\n\t// extract specific values from forecast and format as an array\n\tstatic async parseForecast(data) {\n\t\tconst temperature = Hourly.expand(data.temperature.values);\n\t\tconst apparentTemperature = Hourly.expand(data.apparentTemperature.values);\n\t\tconst windSpeed = Hourly.expand(data.windSpeed.values);\n\t\tconst windDirection = Hourly.expand(data.windDirection.values);\n\t\tconst skyCover = Hourly.expand(data.skyCover.values);\t// cloud icon\n\t\tconst weather = Hourly.expand(data.weather.values);\t// fog icon\n\t\tconst iceAccumulation = Hourly.expand(data.iceAccumulation.values); \t// ice icon\n\t\tconst probabilityOfPrecipitation = Hourly.expand(data.probabilityOfPrecipitation.values);\t// rain icon\n\t\tconst snowfallAmount = Hourly.expand(data.snowfallAmount.values);\t// snow icon\n\n\t\tconst icons = await Hourly.determineIcon(skyCover, weather, iceAccumulation, probabilityOfPrecipitation, snowfallAmount, windSpeed);\n\n\t\treturn temperature.map((val, idx) => ({\n\t\t\ttemperature: celsiusToFahrenheit(temperature[idx]),\n\t\t\tapparentTemperature: celsiusToFahrenheit(apparentTemperature[idx]),\n\t\t\twindSpeed: kilometersToMiles(windSpeed[idx]),\n\t\t\twindDirection: directionToNSEW(windDirection[idx]),\n\t\t\ticon: icons[idx],\n\t\t}));\n\t}\n\n\t// given forecast paramaters determine a suitable icon\n\tstatic async determineIcon(skyCover, weather, iceAccumulation, probabilityOfPrecipitation, snowfallAmount, windSpeed) {\n\t\tconst startOfHour = DateTime.local().startOf('hour');\n\t\tconst sunTimes = (await getSun()).sun;\n\t\tconst overnight = Interval.fromDateTimes(DateTime.fromJSDate(sunTimes[0].sunset), DateTime.fromJSDate(sunTimes[1].sunrise));\n\t\tconst tomorrowOvernight = DateTime.fromJSDate(sunTimes[1].sunset);\n\t\treturn skyCover.map((val, idx) => {\n\t\t\tconst hour = startOfHour.plus({ hours: idx });\n\t\t\tconst isNight = overnight.contains(hour) || (hour > tomorrowOvernight);\n\t\t\treturn getHourlyIcon(skyCover[idx], weather[idx], iceAccumulation[idx], probabilityOfPrecipitation[idx], snowfallAmount[idx], windSpeed[idx], isNight);\n\t\t});\n\t}\n\n\t// expand a set of values with durations to an hour-by-hour array\n\tstatic expand(data) {\n\t\tconst startOfHour = DateTime.utc().startOf('hour').toMillis();\n\t\tconst result = []; // resulting expanded values\n\t\tdata.forEach((item) => {\n\t\t\tlet startTime = Date.parse(item.validTime.substr(0, item.validTime.indexOf('/')));\n\t\t\tconst duration = Duration.fromISO(item.validTime.substr(item.validTime.indexOf('/') + 1)).shiftTo('milliseconds').values.milliseconds;\n\t\t\tconst endTime = startTime + duration;\n\t\t\t// loop through duration at one hour intervals\n\t\t\tdo {\n\t\t\t\t// test for timestamp greater than now\n\t\t\t\tif (startTime >= startOfHour && result.length < 24) {\n\t\t\t\t\tresult.push(item.value); // push data array\n\t\t\t\t} // timestamp is after now\n\t\t\t\t// increment start time by 1 hour\n\t\t\t\tstartTime += 3600000;\n\t\t\t} while (startTime < endTime && result.length < 24);\n\t\t}); // for each value\n\n\t\treturn result;\n\t}\n\n\tasync drawLongCanvas() {\n\t\t// get the list element and populate\n\t\tconst list = this.elem.querySelector('.hourly-lines');\n\t\tlist.innerHTML = '';\n\n\t\tconst startingHour = DateTime.local();\n\n\t\tconst lines = this.data.map((data, index) => {\n\t\t\tconst fillValues = {};\n\t\t\t// hour\n\t\t\tconst hour = startingHour.plus({ hours: index });\n\t\t\tconst formattedHour = hour.toLocaleString({ weekday: 'short', hour: 'numeric' });\n\t\t\tfillValues.hour = formattedHour;\n\n\t\t\t// temperatures, convert to strings with no decimal\n\t\t\tconst temperature = Math.round(data.temperature).toString().padStart(3);\n\t\t\tconst feelsLike = Math.round(data.apparentTemperature).toString().padStart(3);\n\t\t\tfillValues.temp = temperature;\n\t\t\t// only plot apparent temperature if there is a difference\n\t\t\t// if (temperature !== feelsLike) line.querySelector('.like').innerHTML = feelsLike;\n\t\t\tif (temperature !== feelsLike) fillValues.like = feelsLike;\n\n\t\t\t// wind\n\t\t\tlet wind = 'Calm';\n\t\t\tif (data.windSpeed > 0) {\n\t\t\t\tconst windSpeed = Math.round(data.windSpeed).toString();\n\t\t\t\twind = data.windDirection + (Array(6 - data.windDirection.length - windSpeed.length).join(' ')) + windSpeed;\n\t\t\t}\n\t\t\tfillValues.wind = wind;\n\n\t\t\t// image\n\t\t\tfillValues.icon = { type: 'img', src: data.icon };\n\n\t\t\treturn this.fillTemplate('hourly-row', fillValues);\n\t\t});\n\n\t\tlist.append(...lines);\n\t}\n\n\tdrawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tthis.finishDraw();\n\t}\n\n\tshowCanvas() {\n\t\t// special to hourly to draw the remainder of the canvas\n\t\tthis.drawCanvas();\n\t\tsuper.showCanvas();\n\t}\n\n\t// screen index change callback just runs the base count callback\n\tscreenIndexChange() {\n\t\tthis.baseCountChange(this.navBaseCount);\n\t}\n\n\t// base count change callback\n\tbaseCountChange(count) {\n\t\t// calculate scroll offset and don't go past end\n\t\tlet offsetY = Math.min(this.elem.querySelector('.hourly-lines').getBoundingClientRect().height - 289, (count - 150));\n\n\t\t// don't let offset go negative\n\t\tif (offsetY < 0) offsetY = 0;\n\n\t\t// copy the scrolled portion of the canvas\n\t\tthis.elem.querySelector('.main').scrollTo(0, offsetY);\n\t}\n\n\tstatic getTravelCitiesDayName(cities) {\n\t\t// effectively returns early on the first found date\n\t\treturn cities.reduce((dayName, city) => {\n\t\t\tif (city && dayName === '') {\n\t\t\t\t// today or tomorrow\n\t\t\t\tconst day = DateTime.local().plus({ days: (city.today) ? 0 : 1 });\n\t\t\t\t// return the day\n\t\t\t\treturn day.toLocaleString({ weekday: 'long' });\n\t\t\t}\n\t\t\treturn dayName;\n\t\t}, '');\n\t}\n}\n\n// register display\nregisterDisplay(new Hourly(2, 'hourly'));\n","/* spell-checker: disable */\n\nconst getWeatherRegionalIconFromIconLink = (link, _isNightTime) => {\n\t// extract day or night if not provided\n\tconst isNightTime = _isNightTime ?? link.indexOf('/night/') >= 0;\n\t// internal function to add path to returned icon\n\tconst addPath = (icon) => `images/r/${icon}`;\n\n\t// grab everything after the last slash ending at any of these: ?&,\n\tconst afterLastSlash = link.toLowerCase().match(/[^/]+$/)[0];\n\tlet conditionName = afterLastSlash.match(/(.*?)[,?&.]/)[1];\n\t// using probability as a crude heavy/light indication where possible\n\tconst value = +(link.match(/,(\\d{2,3})/) ?? [0, 100])[1];\n\n\t// if a 'DualImage' is captured, adjust to just the j parameter\n\tif (conditionName === 'dualimage') {\n\t\tconst match = link.match(/&j=(.*)&/);\n\t\t[, conditionName] = match;\n\t}\n\n\t// find the icon\n\tswitch (conditionName + (isNightTime ? '-n' : '')) {\n\tcase 'skc':\n\tcase 'hot':\n\tcase 'haze':\n\t\treturn addPath('Sunny.gif');\n\n\tcase 'skc-n':\n\tcase 'nskc':\n\tcase 'nskc-n':\n\tcase 'cold-n':\n\t\treturn addPath('Clear-1992.gif');\n\n\tcase 'bkn':\n\t\treturn addPath('Mostly-Cloudy-1994-2.gif');\n\n\tcase 'bkn-n':\n\tcase 'few-n':\n\tcase 'nfew-n':\n\tcase 'nfew':\n\t\treturn addPath('Partly-Clear-1994-2.gif');\n\n\tcase 'sct':\n\tcase 'few':\n\t\treturn addPath('Partly-Cloudy.gif');\n\n\tcase 'sct-n':\n\tcase 'nsct':\n\tcase 'nsct-n':\n\t\treturn addPath('Mostly-Clear.gif');\n\n\tcase 'ovc':\n\tcase 'ovc-n':\n\t\treturn addPath('Cloudy.gif');\n\n\tcase 'fog':\n\tcase 'fog-n':\n\t\treturn addPath('Fog.gif');\n\n\tcase 'rain_sleet':\n\t\treturn addPath('Sleet.gif');\n\n\tcase 'rain_showers':\n\tcase 'rain_showers_high':\n\t\treturn addPath('Scattered-Showers-1994-2.gif');\n\n\tcase 'rain_showers-n':\n\tcase 'rain_showers_high-n':\n\t\treturn addPath('Scattered-Showers-Night-1994-2.gif');\n\n\tcase 'rain':\n\tcase 'rain-n':\n\t\treturn addPath('Rain-1992.gif');\n\n\t\t// case 'snow':\n\t\t// \treturn addPath('Light-Snow.gif');\n\t\t// \tbreak;\n\n\t\t// case 'cc_snowshowers.gif':\n\t\t// \t//case \"heavy-snow.gif\":\n\t\t// \treturn addPath('AM-Snow-1994.gif');\n\t\t// \tbreak;\n\n\tcase 'snow':\n\tcase 'snow-n':\n\t\tif (value > 50)\treturn addPath('Heavy-Snow-1994-2.gif');\n\t\treturn addPath('Light-Snow.gif');\n\n\tcase 'rain_snow':\n\t\treturn addPath('Rain-Snow-1992.gif');\n\n\tcase 'snow_fzra':\n\tcase 'snow_fzra-n':\n\t\treturn addPath('Freezing-Rain-Snow-1992.gif');\n\n\tcase 'fzra':\n\tcase 'fzra-n':\n\t\treturn addPath('Freezing-Rain-1992.gif');\n\n\tcase 'snow_sleet':\n\tcase 'snow_sleet-n':\n\t\treturn addPath('Snow and Sleet.gif');\n\n\tcase 'sleet':\n\tcase 'sleet-n':\n\t\treturn addPath('Sleet.gif');\n\n\tcase 'tsra_sct':\n\tcase 'tsra':\n\t\treturn addPath('Scattered-Tstorms-1994-2.gif');\n\n\tcase 'tsra_sct-n':\n\tcase 'tsra-n':\n\t\treturn addPath('Scattered-Tstorms-Night-1994-2.gif');\n\n\tcase 'tsra_hi':\n\tcase 'tsra_hi-n':\n\tcase 'hurricane':\n\tcase 'tropical_storm':\n\t\treturn addPath('Thunderstorm.gif');\n\n\tcase 'wind_few':\n\tcase 'wind_sct':\n\tcase 'wind_bkn':\n\tcase 'wind_ovc':\n\t\treturn addPath('Wind.gif');\n\n\tcase 'wind_skc':\n\t\treturn addPath('Sunny-Wind-1994.gif');\n\n\tcase 'wind_skc-n':\n\tcase 'wind_sct-n':\n\t\treturn addPath('Clear-Wind-1994.gif');\n\n\tcase 'blizzard':\n\t\treturn addPath('Blowing Snow.gif');\n\n\tcase 'cold':\n\t\treturn addPath('cold.gif');\n\n\tdefault:\n\t\tconsole.log(`Unable to locate regional icon for ${conditionName} ${link} ${isNightTime}`);\n\t\treturn false;\n\t}\n};\n\nconst getWeatherIconFromIconLink = (link, _isNightTime) => {\n\tif (!link) return false;\n\n\t// internal function to add path to returned icon\n\tconst addPath = (icon) => `images/${icon}`;\n\t// extract day or night if not provided\n\tconst isNightTime = _isNightTime ?? link.indexOf('/night/') >= 0;\n\n\t// grab everything after the last slash ending at any of these: ?&,\n\tconst afterLastSlash = link.toLowerCase().match(/[^/]+$/)[0];\n\tlet conditionName = afterLastSlash.match(/(.*?)[,?&.]/)[1];\n\t// using probability as a crude heavy/light indication where possible\n\tconst value = +(link.match(/,(\\d{2,3})/) ?? [0, 100])[1];\n\n\t// if a 'DualImage' is captured, adjust to just the j parameter\n\tif (conditionName === 'dualimage') {\n\t\tconst match = link.match(/&j=(.*)&/);\n\t\t[, conditionName] = match;\n\t}\n\n\t// find the icon\n\tswitch (conditionName + (isNightTime ? '-n' : '')) {\n\tcase 'skc':\n\tcase 'hot':\n\tcase 'haze':\n\tcase 'cold':\n\t\treturn addPath('CC_Clear1.gif');\n\n\tcase 'skc-n':\n\tcase 'nskc':\n\tcase 'nskc-n':\n\tcase 'cold-n':\n\t\treturn addPath('CC_Clear0.gif');\n\n\tcase 'sct':\n\tcase 'few':\n\tcase 'bkn':\n\t\treturn addPath('CC_PartlyCloudy1.gif');\n\n\tcase 'bkn-n':\n\tcase 'few-n':\n\tcase 'nfew-n':\n\tcase 'nfew':\n\tcase 'sct-n':\n\tcase 'nsct':\n\tcase 'nsct-n':\n\t\treturn addPath('CC_PartlyCloudy0.gif');\n\n\tcase 'ovc':\n\tcase 'novc':\n\tcase 'ovc-n':\n\t\treturn addPath('CC_Cloudy.gif');\n\n\tcase 'fog':\n\tcase 'fog-n':\n\t\treturn addPath('CC_Fog.gif');\n\n\tcase 'rain_sleet':\n\t\treturn addPath('Sleet.gif');\n\n\tcase 'rain_showers':\n\tcase 'rain_showers_high':\n\t\treturn addPath('CC_Showers.gif');\n\n\tcase 'rain_showers-n':\n\tcase 'rain_showers_high-n':\n\t\treturn addPath('CC_Showers.gif');\n\n\tcase 'rain':\n\tcase 'rain-n':\n\t\treturn addPath('CC_Rain.gif');\n\n\t\t// case 'snow':\n\t\t// \treturn addPath('Light-Snow.gif');\n\t\t// \tbreak;\n\n\t\t// case 'cc_snowshowers.gif':\n\t\t// \t//case \"heavy-snow.gif\":\n\t\t// \treturn addPath('AM-Snow-1994.gif');\n\t\t// \tbreak;\n\n\tcase 'snow':\n\tcase 'snow-n':\n\t\tif (value > 50)\treturn addPath('CC_Snow.gif');\n\t\treturn addPath('CC_SnowShowers.gif');\n\n\tcase 'rain_snow':\n\t\treturn addPath('CC_RainSnow.gif');\n\n\tcase 'snow_fzra':\n\tcase 'snow_fzra-n':\n\tcase 'fzra':\n\tcase 'fzra-n':\n\t\treturn addPath('CC_FreezingRain.gif');\n\n\tcase 'snow_sleet':\n\t\treturn addPath('Snow-Sleet.gif');\n\n\tcase 'tsra_sct':\n\tcase 'tsra':\n\t\treturn addPath('EF_ScatTstorms.gif');\n\n\tcase 'tsra_sct-n':\n\tcase 'tsra-n':\n\t\treturn addPath('CC_TStorm.gif');\n\n\tcase 'tsra_hi':\n\tcase 'tsra_hi-n':\n\tcase 'hurricane':\n\tcase 'tropical_storm':\n\t\treturn addPath('CC_TStorm.gif');\n\n\tcase 'wind_few':\n\tcase 'wind_sct':\n\tcase 'wind_bkn':\n\tcase 'wind_ovc':\n\t\treturn addPath('CC_Windy.gif');\n\n\tcase 'wind_skc':\n\tcase 'wind_skc-n':\n\tcase 'wind_sct-n':\n\t\treturn addPath('CC_Windy.gif');\n\n\tcase 'blizzard':\n\t\treturn addPath('Blowing-Snow.gif');\n\n\tdefault:\n\t\tconsole.log(`Unable to locate icon for ${conditionName} ${link} ${isNightTime}`);\n\t\treturn false;\n\t}\n};\n\nconst getHourlyIcon = (skyCover, weather, iceAccumulation, probabilityOfPrecipitation, snowfallAmount, windSpeed, isNight = false) => {\n\t// internal function to add path to returned icon\n\tconst addPath = (icon) => `images/r/${icon}`;\n\n\t// possible phenomenon\n\tlet thunder = false;\n\tlet snow = false;\n\tlet ice = false;\n\tlet fog = false;\n\tlet wind = false;\n\n\t// test the phenomenon for various value if it is provided.\n\tweather.forEach((phenomenon) => {\n\t\tif (!phenomenon.weather) return;\n\t\tif (phenomenon.weather.toLowerCase().includes('thunder')) thunder = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('snow')) snow = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('ice')) ice = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('fog')) fog = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('wind')) wind = true;\n\t});\n\n\t// first item in list is highest priority, units are metric where applicable\n\tif (iceAccumulation > 0 || ice) return addPath('Freezing-Rain-1992.gif');\n\tif (snowfallAmount > 10) {\n\t\tif (windSpeed > 30 || wind) return addPath('Blowing Snow.gif');\n\t\treturn addPath('Heavy-Snow-1994.gif');\n\t}\n\tif ((snowfallAmount > 0 || snow) && thunder) return addPath('ThunderSnow.gif');\n\tif (snowfallAmount > 0 || snow) return addPath('Light-Snow.gif');\n\tif (thunder) return (addPath('Thunderstorm.gif'));\n\tif (probabilityOfPrecipitation > 70) return addPath('Rain-1992.gif');\n\tif (probabilityOfPrecipitation > 50) return addPath('Shower.gif');\n\tif (probabilityOfPrecipitation > 30) {\n\t\tif (!isNight) return addPath('Scattered-Showers-1994.gif');\n\t\treturn addPath('Scattered-Showers-Night.gif');\n\t}\n\tif (fog) return addPath('Fog.gif');\n\tif (skyCover > 70) return addPath('Cloudy.gif');\n\tif (skyCover > 50) {\n\t\tif (!isNight) return addPath('Mostly-Cloudy-1994.gif');\n\t\treturn addPath('Partly-Clear-1994.gif');\n\t}\n\tif (skyCover > 30) {\n\t\tif (!isNight) return addPath('Partly-Cloudy.gif');\n\t\treturn addPath('Mostly-Clear.gif');\n\t}\n\tif (isNight) return addPath('Clear-1992.gif');\n\treturn addPath('Sunny.gif');\n};\n\nexport {\n\tgetWeatherIconFromIconLink,\n\tgetWeatherRegionalIconFromIconLink,\n\tgetHourlyIcon,\n};\n","// current weather conditions display\nimport { distance as calcDistance, directionToNSEW } from './utils/calc.mjs';\nimport { json } from './utils/fetch.mjs';\nimport STATUS from './status.mjs';\nimport { locationCleanup } from './utils/string.mjs';\nimport { celsiusToFahrenheit, kphToMph } from './utils/units.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass LatestObservations extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Latest Observations', true);\n\n\t\t// constants\n\t\tthis.MaximumRegionalStations = 7;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// calculate distance to each station\n\t\tconst stationsByDistance = Object.keys(StationInfo).map((key) => {\n\t\t\tconst station = StationInfo[key];\n\t\t\tconst distance = calcDistance(station.lat, station.lon, weatherParameters.latitude, weatherParameters.longitude);\n\t\t\treturn { ...station, distance };\n\t\t});\n\n\t\t// sort the stations by distance\n\t\tconst sortedStations = stationsByDistance.sort((a, b) => a.distance - b.distance);\n\t\t// try up to 30 regional stations\n\t\tconst regionalStations = sortedStations.slice(0, 30);\n\n\t\t// get data for regional stations\n\t\tconst allConditions = await Promise.all(regionalStations.map(async (station) => {\n\t\t\ttry {\n\t\t\t\tconst data = await json(`https://api.weather.gov/stations/${station.id}/observations/latest`);\n\t\t\t\t// test for temperature, weather and wind values present\n\t\t\t\tif (data.properties.temperature.value === null\n\t\t\t\t\t|| data.properties.textDescription === ''\n\t\t\t\t\t|| data.properties.windSpeed.value === null) return false;\n\t\t\t\t// format the return values\n\t\t\t\treturn {\n\t\t\t\t\t...data.properties,\n\t\t\t\t\tStationId: station.id,\n\t\t\t\t\tcity: station.city,\n\t\t\t\t};\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(`Unable to get latest observations for ${station.id}`);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}));\n\t\t// remove and stations that did not return data\n\t\tconst actualConditions = allConditions.filter((condition) => condition);\n\t\t// cut down to the maximum of 7\n\t\tthis.data = actualConditions.slice(0, this.MaximumRegionalStations);\n\n\t\t// test for at least one station\n\t\tif (this.data.length < 1) {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst conditions = this.data;\n\n\t\t// sort array by station name\n\t\tconst sortedConditions = conditions.sort((a, b) => ((a.Name < b.Name) ? -1 : 1));\n\n\t\tthis.elem.querySelector('.column-headers .temp.english').classList.add('show');\n\t\tthis.elem.querySelector('.column-headers .temp.metric').classList.remove('show');\n\n\t\tconst lines = sortedConditions.map((condition) => {\n\t\t\tconst windDirection = directionToNSEW(condition.windDirection.value);\n\n\t\t\tconst\tTemperature = Math.round(celsiusToFahrenheit(condition.temperature.value));\n\t\t\tconst WindSpeed = Math.round(kphToMph(condition.windSpeed.value));\n\n\t\t\tconst fill = {};\n\t\t\tfill.location = locationCleanup(condition.city).substr(0, 14);\n\t\t\tfill.temp = Temperature;\n\t\t\tfill.weather = LatestObservations.shortenCurrentConditions(condition.textDescription).substr(0, 9);\n\t\t\tif (WindSpeed > 0) {\n\t\t\t\tfill.wind = windDirection + (Array(6 - windDirection.length - WindSpeed.toString().length).join(' ')) + WindSpeed.toString();\n\t\t\t} else if (WindSpeed === 'NA') {\n\t\t\t\tfill.wind = 'NA';\n\t\t\t} else {\n\t\t\t\tfill.wind = 'Calm';\n\t\t\t}\n\n\t\t\treturn this.fillTemplate('observation-row', fill);\n\t\t});\n\n\t\tconst linesContainer = this.elem.querySelector('.observation-lines');\n\t\tlinesContainer.innerHTML = '';\n\t\tlinesContainer.append(...lines);\n\n\t\tthis.finishDraw();\n\t}\n\n\tstatic shortenCurrentConditions(_condition) {\n\t\tlet condition = _condition;\n\t\tcondition = condition.replace(/Light/, 'L');\n\t\tcondition = condition.replace(/Heavy/, 'H');\n\t\tcondition = condition.replace(/Partly/, 'P');\n\t\tcondition = condition.replace(/Mostly/, 'M');\n\t\tcondition = condition.replace(/Few/, 'F');\n\t\tcondition = condition.replace(/Thunderstorm/, 'T\\'storm');\n\t\tcondition = condition.replace(/ in /, '');\n\t\tcondition = condition.replace(/Vicinity/, '');\n\t\tcondition = condition.replace(/ and /, ' ');\n\t\tcondition = condition.replace(/Freezing Rain/, 'Frz Rn');\n\t\tcondition = condition.replace(/Freezing/, 'Frz');\n\t\tcondition = condition.replace(/Unknown Precip/, '');\n\t\tcondition = condition.replace(/L Snow Fog/, 'L Snw/Fog');\n\t\tcondition = condition.replace(/ with /, '/');\n\t\treturn condition;\n\t}\n}\n// register display\nregisterDisplay(new LatestObservations(1, 'latest-observations'));\n","// display text based local forecast\n\nimport STATUS from './status.mjs';\nimport { json } from './utils/fetch.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass LocalForecast extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Local Forecast', true);\n\n\t\t// set timings\n\t\tthis.timing.baseDelay = 5000;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// get raw data\n\t\tconst rawData = await this.getRawData(weatherParameters);\n\t\t// check for data\n\t\tif (!rawData) {\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\t\t// parse raw data\n\t\tconst conditions = LocalForecast.parse(rawData);\n\n\t\t// read each text\n\t\tthis.screenTexts = conditions.map((condition) => {\n\t\t\t// process the text\n\t\t\tlet text = `${condition.DayName.toUpperCase()}...`;\n\t\t\tconst conditionText = condition.Text;\n\t\t\ttext += conditionText.toUpperCase().replace('...', ' ');\n\n\t\t\treturn text;\n\t\t});\n\n\t\t// fill the forecast texts\n\t\tconst templates = this.screenTexts.map((text) => this.fillTemplate('forecast', { text }));\n\t\tconst forecastsElem = this.elem.querySelector('.forecasts');\n\t\tforecastsElem.innerHTML = '';\n\t\tforecastsElem.append(...templates);\n\n\t\t// increase each forecast height to a multiple of container height\n\t\tthis.pageHeight = forecastsElem.parentNode.getBoundingClientRect().height;\n\t\ttemplates.forEach((forecast) => {\n\t\t\tconst newHeight = Math.ceil(forecast.scrollHeight / this.pageHeight) * this.pageHeight;\n\t\t\tforecast.style.height = `${newHeight}px`;\n\t\t});\n\n\t\tthis.timing.totalScreens = forecastsElem.scrollHeight / this.pageHeight;\n\t\tthis.calcNavTiming();\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\t// get the unformatted data (also used by extended forecast)\n\tasync getRawData(weatherParameters) {\n\t\t// request us or si units\n\t\ttry {\n\t\t\treturn await json(weatherParameters.forecast, {\n\t\t\t\tdata: {\n\t\t\t\t\tunits: 'us',\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error(`GetWeatherForecast failed: ${weatherParameters.forecast}`);\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\n\t\tconst top = -this.screenIndex * this.pageHeight;\n\t\tthis.elem.querySelector('.forecasts').style.top = `${top}px`;\n\n\t\tthis.finishDraw();\n\t}\n\n\t// format the forecast\n\tstatic parse(forecast) {\n\t\t// only use the first 6 lines\n\t\treturn forecast.properties.periods.slice(0, 6).map((text) => ({\n\t\t\t// format day and text\n\t\t\tDayName: text.name.toUpperCase(),\n\t\t\tText: text.detailedForecast,\n\t\t}));\n\t}\n}\n\n// register display\nregisterDisplay(new LocalForecast(5, 'local-forecast'));\n","// navigation handles progress, next/previous and initial load messages from the parent frame\nimport noSleep from './utils/nosleep.mjs';\nimport STATUS from './status.mjs';\nimport { wrap } from './utils/calc.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { getPoint } from './utils/weather.mjs';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\tinit();\n});\n\nconst displays = [];\nlet playing = false;\nlet progress;\nconst weatherParameters = {};\n\n// auto refresh\nconst AUTO_REFRESH_INTERVAL_MS = 500;\nconst AUTO_REFRESH_TIME_MS = 600000; // 10 min.\nlet AutoRefreshIntervalId = null;\nlet AutoRefreshCountMs = 0;\n\nconst init = async () => {\n\t// set up resize handler\n\twindow.addEventListener('resize', resize);\n\n\t// auto refresh\n\tconst TwcAutoRefresh = localStorage.getItem('TwcAutoRefresh');\n\tif (!TwcAutoRefresh || TwcAutoRefresh === 'true') {\n\t\tdocument.getElementById('chkAutoRefresh').checked = true;\n\t} else {\n\t\tdocument.getElementById('chkAutoRefresh').checked = false;\n\t}\n\tdocument.getElementById('chkAutoRefresh').addEventListener('change', autoRefreshChange);\n\tgenerateCheckboxes();\n};\n\nconst message = (data) => {\n\t// dispatch event\n\tif (!data.type) return;\n\tswitch (data.type) {\n\tcase 'navButton':\n\t\thandleNavButton(data.message);\n\t\tbreak;\n\n\tdefault:\n\t\tconsole.error(`Unknown event ${data.type}`);\n\t}\n};\n\nconst getWeather = async (latLon) => {\n\t// get initial weather data\n\tconst point = await getPoint(latLon.lat, latLon.lon);\n\n\t// get stations\n\tconst stations = await json(point.properties.observationStations);\n\n\tconst StationId = stations.features[0].properties.stationIdentifier;\n\n\tlet { city } = point.properties.relativeLocation.properties;\n\n\tif (StationId in StationInfo) {\n\t\tcity = StationInfo[StationId].city;\n\t\t[city] = city.split('/');\n\t}\n\n\t// populate the weather parameters\n\tweatherParameters.latitude = latLon.lat;\n\tweatherParameters.longitude = latLon.lon;\n\tweatherParameters.zoneId = point.properties.forecastZone.substr(-6);\n\tweatherParameters.radarId = point.properties.radarStation.substr(-3);\n\tweatherParameters.stationId = StationId;\n\tweatherParameters.weatherOffice = point.properties.cwa;\n\tweatherParameters.city = city;\n\tweatherParameters.state = point.properties.relativeLocation.properties.state;\n\tweatherParameters.timeZone = point.properties.relativeLocation.properties.timeZone;\n\tweatherParameters.forecast = point.properties.forecast;\n\tweatherParameters.forecastGridData = point.properties.forecastGridData;\n\tweatherParameters.stations = stations.features;\n\n\t// update the main process for display purposes\n\tpopulateWeatherParameters(weatherParameters);\n\n\t// draw the progress canvas and hide others\n\thideAllCanvases();\n\tdocument.getElementById('loading').style.display = 'none';\n\tif (progress) {\n\t\tawait progress.drawCanvas();\n\t\tprogress.showCanvas();\n\t}\n\n\t// call for new data on each display\n\tdisplays.forEach((display) => display.getData(weatherParameters));\n};\n\n// receive a status update from a module {id, value}\nconst updateStatus = (value) => {\n\tif (value.id < 0) return;\n\tif (!progress) return;\n\tprogress.drawCanvas(displays, countLoadedCanvases());\n\n\t// if this is the first display and we're playing, load it up so it starts playing\n\tif (isPlaying() && value.id === 0 && value.status === STATUS.loaded) {\n\t\tnavTo(msg.command.firstFrame);\n\t}\n\n\t// send loaded messaged to parent\n\tif (countLoadedCanvases() < displays.length) return;\n\n\t// everything loaded, set timestamps\n\tAssignLastUpdate(new Date());\n};\n\nconst countLoadedCanvases = () => displays.reduce((acc, display) => {\n\tif (display.status !== STATUS.loading) return acc + 1;\n\treturn acc;\n}, 0);\n\nconst hideAllCanvases = () => {\n\tdisplays.forEach((display) => display.hideCanvas());\n};\n\n// is playing interface\nconst isPlaying = () => playing;\n\n// navigation message constants\nconst msg = {\n\tresponse: {\t// display to navigation\n\t\tprevious: Symbol('previous'),\t\t// already at first frame, calling function should switch to previous canvas\n\t\tinProgress: Symbol('inProgress'),\t// have data to display, calling function should do nothing\n\t\tnext: Symbol('next'),\t\t\t\t// end of frames reached, calling function should switch to next canvas\n\t},\n\tcommand: {\t// navigation to display\n\t\tfirstFrame: Symbol('firstFrame'),\n\t\tpreviousFrame: Symbol('previousFrame'),\n\t\tnextFrame: Symbol('nextFrame'),\n\t\tlastFrame: Symbol('lastFrame'),\t// used when navigating backwards from the begining of the next canvas\n\t},\n};\n\n// receive navigation messages from displays\nconst displayNavMessage = (myMessage) => {\n\tif (myMessage.type === msg.response.previous) loadDisplay(-1);\n\tif (myMessage.type === msg.response.next) loadDisplay(1);\n};\n\n// navigate to next or previous\nconst navTo = (direction) => {\n\t// test for a current display\n\tconst current = currentDisplay();\n\tprogress.hideCanvas();\n\tif (!current) {\n\t\t// special case for no active displays (typically on progress screen)\n\t\t// find the first ready display\n\t\tlet firstDisplay;\n\t\tlet displayCount = 0;\n\t\tdo {\n\t\t\tif (displays[displayCount].status === STATUS.loaded) firstDisplay = displays[displayCount];\n\t\t\tdisplayCount += 1;\n\t\t} while (!firstDisplay && displayCount < displays.length);\n\n\t\tif (!firstDisplay) return;\n\n\t\tfirstDisplay.navNext(msg.command.firstFrame);\n\t\treturn;\n\t}\n\tif (direction === msg.command.nextFrame) currentDisplay().navNext();\n\tif (direction === msg.command.previousFrame) currentDisplay().navPrev();\n};\n\n// find the next or previous available display\nconst loadDisplay = (direction) => {\n\tconst totalDisplays = displays.length;\n\tconst curIdx = currentDisplayIndex();\n\tlet idx;\n\tfor (let i = 0; i < totalDisplays; i += 1) {\n\t\t// convert form simple 0-10 to start at current display index +/-1 and wrap\n\t\tidx = wrap(curIdx + (i + 1) * direction, totalDisplays);\n\t\tif (displays[idx].status === STATUS.loaded) break;\n\t}\n\t// if new display index is less than current display a wrap occurred, test for reload timeout\n\tif (idx <= curIdx) {\n\t\tif (refreshCheck()) return;\n\t}\n\tconst newDisplay = displays[idx];\n\t// hide all displays\n\thideAllCanvases();\n\t// show the new display and navigate to an appropriate display\n\tif (direction < 0) newDisplay.showCanvas(msg.command.lastFrame);\n\tif (direction > 0) newDisplay.showCanvas(msg.command.firstFrame);\n};\n\n// get the current display index or value\nconst currentDisplayIndex = () => {\n\tconst index = displays.findIndex((display) => display.isActive());\n\treturn index;\n};\nconst currentDisplay = () => displays[currentDisplayIndex()];\n\nconst setPlaying = (newValue) => {\n\tplaying = newValue;\n\tconst playButton = document.getElementById('NavigatePlay');\n\tlocalStorage.setItem('TwcPlay', playing);\n\n\tif (playing) {\n\t\tnoSleep(true);\n\t\tplayButton.title = 'Pause';\n\t\tplayButton.src = 'images/nav/ic_pause_white_24dp_1x.png';\n\t} else {\n\t\tnoSleep(false);\n\t\tplayButton.title = 'Play';\n\t\tplayButton.src = 'images/nav/ic_play_arrow_white_24dp_1x.png';\n\t}\n\t// if we're playing and on the progress screen jump to the next screen\n\tif (!progress) return;\n\tif (playing && !currentDisplay()) navTo(msg.command.firstFrame);\n};\n\n// handle all navigation buttons\nconst handleNavButton = (button) => {\n\tswitch (button) {\n\tcase 'play':\n\t\tsetPlaying(true);\n\t\tbreak;\n\tcase 'playToggle':\n\t\tsetPlaying(!playing);\n\t\tbreak;\n\tcase 'stop':\n\t\tsetPlaying(false);\n\t\tbreak;\n\tcase 'next':\n\t\tsetPlaying(false);\n\t\tnavTo(msg.command.nextFrame);\n\t\tbreak;\n\tcase 'previous':\n\t\tsetPlaying(false);\n\t\tnavTo(msg.command.previousFrame);\n\t\tbreak;\n\tcase 'menu':\n\t\tsetPlaying(false);\n\t\tprogress.showCanvas();\n\t\thideAllCanvases();\n\t\tbreak;\n\tdefault:\n\t\tconsole.error(`Unknown navButton ${button}`);\n\t}\n};\n\n// return the specificed display\nconst getDisplay = (index) => displays[index];\n\n// resize the container on a page resize\nconst resize = () => {\n\tconst widthZoomPercent = window.innerWidth / 640;\n\tconst heightZoomPercent = window.innerHeight / 480;\n\n\tconst scale = Math.min(widthZoomPercent, heightZoomPercent);\n\n\tif (scale < 1.0 || document.fullscreenElement) {\n\t\tdocument.getElementById('container').style.zoom = scale;\n\t} else {\n\t\tdocument.getElementById('container').style.zoom = 1;\n\t}\n};\n\n// reset all statuses to loading on all displays, used to keep the progress bar accurate during refresh\nconst resetStatuses = () => {\n\tdisplays.forEach((display) => { display.status = STATUS.loading; });\n};\n\n// allow displays to register themselves\nconst registerDisplay = (display) => {\n\tdisplays[display.navId] = display;\n\n\t// generate checkboxes\n\tgenerateCheckboxes();\n};\n\nconst generateCheckboxes = () => {\n\tconst availableDisplays = document.getElementById('enabledDisplays');\n\n\tif (!availableDisplays) return;\n\t// generate checkboxes\n\tconst checkboxes = displays.map((d) => d.generateCheckbox()).filter((d) => d);\n\n\t// write to page\n\tavailableDisplays.innerHTML = '';\n\tavailableDisplays.append(...checkboxes);\n};\n\n// special registration method for progress display\nconst registerProgress = (_progress) => {\n\tprogress = _progress;\n};\n\nconst populateWeatherParameters = (params) => {\n\tdocument.getElementById('spanCity').innerHTML = `${params.city}, `;\n\tdocument.getElementById('spanState').innerHTML = params.state;\n\tdocument.getElementById('spanStationId').innerHTML = params.stationId;\n\tdocument.getElementById('spanRadarId').innerHTML = params.radarId;\n\tdocument.getElementById('spanZoneId').innerHTML = params.zoneId;\n};\n\nconst autoRefreshChange = (e) => {\n\tconst { checked } = e.target;\n\n\tif (checked) {\n\t\tstartAutoRefreshTimer();\n\t} else {\n\t\tstopAutoRefreshTimer();\n\t}\n\n\tlocalStorage.setItem('TwcAutoRefresh', checked);\n};\n\nconst AssignLastUpdate = (date) => {\n\tif (date) {\n\t\tdocument.getElementById('spanLastRefresh').innerHTML = date.toLocaleString('en-US', {\n\t\t\tweekday: 'short', month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZoneName: 'short',\n\t\t});\n\t\tif (document.getElementById('chkAutoRefresh').checked) startAutoRefreshTimer();\n\t} else {\n\t\tdocument.getElementById('spanLastRefresh').innerHTML = '(none)';\n\t}\n};\n\nconst latLonReceived = (data) => {\n\tgetWeather(data);\n\tAssignLastUpdate(null);\n};\n\nconst startAutoRefreshTimer = () => {\n\t// Ensure that any previous timer has already stopped.\n\t// check if timer is running\n\tif (AutoRefreshIntervalId) return;\n\n\t// Reset the time elapsed.\n\tAutoRefreshCountMs = 0;\n\n\tconst AutoRefreshTimer = () => {\n\t\t// Increment the total time elapsed.\n\t\tAutoRefreshCountMs += AUTO_REFRESH_INTERVAL_MS;\n\n\t\t// Display the count down.\n\t\tlet RemainingMs = (AUTO_REFRESH_TIME_MS - AutoRefreshCountMs);\n\t\tif (RemainingMs < 0) {\n\t\t\tRemainingMs = 0;\n\t\t}\n\t\tconst dt = new Date(RemainingMs);\n\t\tdocument.getElementById('spanRefreshCountDown').innerHTML = `${dt.getMinutes() < 10 ? `0${dt.getMinutes()}` : dt.getMinutes()}:${dt.getSeconds() < 10 ? `0${dt.getSeconds()}` : dt.getSeconds()}`;\n\n\t\t// Time has elapsed.\n\t\tif (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS && !isPlaying()) loadTwcData();\n\t};\n\tAutoRefreshIntervalId = window.setInterval(AutoRefreshTimer, AUTO_REFRESH_INTERVAL_MS);\n\tAutoRefreshTimer();\n};\nconst stopAutoRefreshTimer = () => {\n\tif (AutoRefreshIntervalId) {\n\t\twindow.clearInterval(AutoRefreshIntervalId);\n\t\tdocument.getElementById('spanRefreshCountDown').innerHTML = '--:--';\n\t\tAutoRefreshIntervalId = null;\n\t}\n};\n\nconst refreshCheck = () => {\n\t// Time has elapsed.\n\tif (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS) {\n\t\tloadTwcData();\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nconst loadTwcData = () => {\n\tif (loadTwcData.callback) loadTwcData.callback();\n};\n\nconst registerRefreshData = (callback) => {\n\tloadTwcData.callback = callback;\n};\n\nexport {\n\tupdateStatus,\n\tdisplayNavMessage,\n\tresetStatuses,\n\tisPlaying,\n\tresize,\n\tregisterDisplay,\n\tregisterProgress,\n\tcurrentDisplay,\n\tgetDisplay,\n\tmsg,\n\tmessage,\n\tlatLonReceived,\n\tstopAutoRefreshTimer,\n\tregisterRefreshData,\n};\n","// regional forecast and observations\nimport { loadImg } from './utils/image.mjs';\nimport STATUS from './status.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport {\n\tregisterProgress, message, getDisplay, msg,\n} from './navigation.mjs';\n\nclass Progress extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, '', false);\n\n\t\t// pre-load background image (returns promise)\n\t\tthis.backgroundImage = loadImg('images/BackGround1_1.png');\n\n\t\t// disable any navigation timing\n\t\tthis.timing = false;\n\n\t\t// setup event listener for dom-required initialization\n\t\tdocument.addEventListener('DOMContentLoaded', () => {\n\t\t\tthis.version = document.getElementById('version').innerHTML;\n\t\t\tthis.elem.querySelector('.container').addEventListener('click', this.lineClick.bind(this));\n\t\t});\n\n\t\tthis.okToDrawCurrentConditions = false;\n\t}\n\n\tasync drawCanvas(displays, loadedCount) {\n\t\tsuper.drawCanvas();\n\n\t\t// get the progress bar cover (makes percentage)\n\t\tif (!this.progressCover) this.progressCover = this.elem.querySelector('.scroll .cover');\n\n\t\t// if no displays provided just draw the backgrounds (above)\n\t\tif (!displays) return;\n\t\tconst lines = displays.map((display, index) => {\n\t\t\tconst fill = {};\n\n\t\t\tfill.name = display.name;\n\n\t\t\tlet statusClass;\n\t\t\tswitch (display.status) {\n\t\t\tcase STATUS.loading:\n\t\t\t\tstatusClass = 'loading';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.loaded:\n\t\t\t\tstatusClass = 'press-here';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.failed:\n\t\t\t\tstatusClass = 'failed';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.noData:\n\t\t\t\tstatusClass = 'no-data';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.disabled:\n\t\t\t\tstatusClass = 'disabled';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t}\n\n\t\t\t// make the line\n\t\t\tconst line = this.fillTemplate('item', fill);\n\t\t\t// because of timing, this might get called before the template is loaded\n\t\t\tif (!line) return false;\n\n\t\t\t// update the status\n\t\t\tconst links = line.querySelector('.links');\n\t\t\tlinks.classList.remove('loading');\n\t\t\tlinks.classList.add(statusClass);\n\t\t\tlinks.dataset.index = index;\n\t\t\treturn line;\n\t\t}).filter((d) => d);\n\n\t\t// get the container and update\n\t\tconst container = this.elem.querySelector('.container');\n\t\tcontainer.innerHTML = '';\n\t\tcontainer.append(...lines);\n\n\t\tthis.finishDraw();\n\n\t\t// calculate loaded percent\n\t\tconst loadedPercent = (loadedCount / displays.length);\n\n\t\tthis.progressCover.style.width = `${(1.0 - loadedPercent) * 100}%`;\n\t\tif (loadedPercent < 1.0) {\n\t\t\t// show the progress bar and set width\n\t\t\tthis.progressCover.parentNode.classList.add('show');\n\t\t} else {\n\t\t\t// hide the progressbar after 1 second (lines up with with width transition animation)\n\t\t\tsetTimeout(() => this.progressCover.parentNode.classList.remove('show'), 1000);\n\t\t}\n\t}\n\n\tlineClick(e) {\n\t\t// get index\n\t\tconst indexRaw = e.target?.parentNode?.dataset?.index;\n\t\tif (indexRaw === undefined) return;\n\t\tconst index = +indexRaw;\n\n\t\t// stop playing\n\t\tmessage('navButton');\n\t\t// use the y value to determine an index\n\t\tconst display = getDisplay(index);\n\t\tif (display && display.status === STATUS.loaded) {\n\t\t\tdisplay.showCanvas(msg.command.firstFrame);\n\t\t\tthis.elem.classList.remove('show');\n\t\t}\n\t}\n}\n\n// register our own display\nconst progress = new Progress(-1, 'progress');\nregisterProgress(progress);\n","// current weather conditions display\nimport STATUS from './status.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport { loadImg } from './utils/image.mjs';\nimport { text } from './utils/fetch.mjs';\nimport { rewriteUrl } from './utils/cors.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass Radar extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Local Radar', true);\n\n\t\tthis.okToDrawCurrentConditions = false;\n\t\tthis.okToDrawCurrentDateTime = false;\n\n\t\t// set max images\n\t\tthis.dopplerRadarImageMax = 6;\n\t\t// update timing\n\t\tthis.timing.baseDelay = 350;\n\t\tthis.timing.delay = [\n\t\t\t{ time: 4, si: 5 },\n\t\t\t{ time: 1, si: 0 },\n\t\t\t{ time: 1, si: 1 },\n\t\t\t{ time: 1, si: 2 },\n\t\t\t{ time: 1, si: 3 },\n\t\t\t{ time: 1, si: 4 },\n\t\t\t{ time: 4, si: 5 },\n\t\t\t{ time: 1, si: 0 },\n\t\t\t{ time: 1, si: 1 },\n\t\t\t{ time: 1, si: 2 },\n\t\t\t{ time: 1, si: 3 },\n\t\t\t{ time: 1, si: 4 },\n\t\t\t{ time: 4, si: 5 },\n\t\t\t{ time: 1, si: 0 },\n\t\t\t{ time: 1, si: 1 },\n\t\t\t{ time: 1, si: 2 },\n\t\t\t{ time: 1, si: 3 },\n\t\t\t{ time: 1, si: 4 },\n\t\t\t{ time: 12, si: 5 },\n\t\t];\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// ALASKA AND HAWAII AREN'T SUPPORTED!\n\t\tif (weatherParameters.state === 'AK' || weatherParameters.state === 'HI') {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\n\t\t// get the base map\n\t\tlet src = 'images/4000RadarMap2.jpg';\n\t\tif (weatherParameters.State === 'HI') src = 'images/HawaiiRadarMap2.png';\n\t\tthis.baseMap = await loadImg(src);\n\n\t\tconst baseUrl = 'https://mesonet.agron.iastate.edu/archive/data/';\n\t\tconst baseUrlEnd = '/GIS/uscomp/';\n\t\tconst baseUrls = [];\n\t\tlet date = DateTime.utc().minus({ days: 1 }).startOf('day');\n\n\t\t// make urls for yesterday and today\n\t\twhile (date <= DateTime.utc().startOf('day')) {\n\t\t\tbaseUrls.push(`${baseUrl}${date.toFormat('yyyy/LL/dd')}${baseUrlEnd}`);\n\t\t\tdate = date.plus({ days: 1 });\n\t\t}\n\n\t\tconst lists = (await Promise.all(baseUrls.map(async (url) => {\n\t\t\ttry {\n\t\t\t// get a list of available radars\n\t\t\t\tconst radarHtml = await text(url, { cors: true });\n\t\t\t\treturn radarHtml;\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log('Unable to get list of radars');\n\t\t\t\tconsole.error(e);\n\t\t\t\tthis.setStatus(STATUS.failed);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}))).filter((d) => d);\n\n\t\t// convert to an array of gif urls\n\t\tconst pngs = lists.map((html, htmlIdx) => {\n\t\t\tconst parser = new DOMParser();\n\t\t\tconst xmlDoc = parser.parseFromString(html, 'text/html');\n\t\t\t// add the base url\n\t\t\tconst base = xmlDoc.createElement('base');\n\t\t\tbase.href = baseUrls[htmlIdx];\n\t\t\txmlDoc.head.append(base);\n\t\t\tconst anchors = xmlDoc.getElementsByTagName('a');\n\t\t\tconst urls = [];\n\t\t\tArray.from(anchors).forEach((elem) => {\n\t\t\t\tif (elem.innerHTML?.includes('.png') && elem.innerHTML?.includes('n0r_'))\t{\n\t\t\t\t\turls.push(elem.href);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn urls;\n\t\t}).flat();\n\n\t\t// get the last few images\n\t\tconst sortedPngs = pngs.sort((a, b) => (Date(a) < Date(b) ? -1 : 1));\n\t\tconst urls = sortedPngs.slice(-(this.dopplerRadarImageMax));\n\n\t\t// calculate offsets and sizes\n\t\tlet offsetX = 120;\n\t\tlet offsetY = 69;\n\t\tconst width = 2550;\n\t\tconst height = 1600;\n\t\toffsetX *= 2;\n\t\toffsetY *= 2;\n\t\tconst sourceXY = Radar.getXYFromLatitudeLongitudeMap(weatherParameters, offsetX, offsetY);\n\n\t\t// create working context for manipulation\n\t\tconst workingCanvas = document.createElement('canvas');\n\t\tworkingCanvas.width = width;\n\t\tworkingCanvas.height = height;\n\t\tconst workingContext = workingCanvas.getContext('2d');\n\t\tworkingContext.imageSmoothingEnabled = false;\n\n\t\t// calculate radar offsets\n\t\tconst radarOffsetX = 120;\n\t\tconst radarOffsetY = 70;\n\t\tconst radarSourceXY = Radar.getXYFromLatitudeLongitudeDoppler(weatherParameters, offsetX, offsetY);\n\t\tconst radarSourceX = radarSourceXY.x / 2;\n\t\tconst radarSourceY = radarSourceXY.y / 2;\n\n\t\t// Load the most recent doppler radar images.\n\t\tconst radarInfo = await Promise.all(urls.map(async (url) => {\n\t\t\t// create destination context\n\t\t\tconst canvas = document.createElement('canvas');\n\t\t\tcanvas.width = 640;\n\t\t\tcanvas.height = 367;\n\t\t\tconst context = canvas.getContext('2d');\n\t\t\tcontext.imageSmoothingEnabled = false;\n\n\t\t\t// get the image\n\t\t\tconst response = await fetch(rewriteUrl(url));\n\n\t\t\t// test response\n\t\t\tif (!response.ok) throw new Error(`Unable to fetch radar error ${response.status} ${response.statusText} from ${response.url}`);\n\n\t\t\t// get the blob\n\t\t\tconst blob = await response.blob();\n\n\t\t\t// store the time\n\t\t\tconst timeMatch = url.match(/_(\\d{4})(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)\\./);\n\t\t\tlet time;\n\t\t\tif (timeMatch) {\n\t\t\t\tconst [, year, month, day, hour, minute] = timeMatch;\n\t\t\t\ttime = DateTime.fromObject({\n\t\t\t\t\tyear,\n\t\t\t\t\tmonth,\n\t\t\t\t\tday,\n\t\t\t\t\thour,\n\t\t\t\t\tminute,\n\t\t\t\t}, {\n\t\t\t\t\tzone: 'UTC',\n\t\t\t\t}).setZone();\n\t\t\t} else {\n\t\t\t\ttime = DateTime.fromHTTP(response.headers.get('last-modified')).setZone();\n\t\t\t}\n\n\t\t\t// assign to an html image element\n\t\t\tconst imgBlob = await loadImg(blob);\n\n\t\t\t// draw the entire image\n\t\t\tworkingContext.clearRect(0, 0, width, 1600);\n\t\t\tworkingContext.drawImage(imgBlob, 0, 0, width, 1600);\n\n\t\t\t// get the base map\n\t\t\tcontext.drawImage(await this.baseMap, sourceXY.x, sourceXY.y, offsetX * 2, offsetY * 2, 0, 0, 640, 367);\n\n\t\t\t// crop the radar image\n\t\t\tconst cropCanvas = document.createElement('canvas');\n\t\t\tcropCanvas.width = 640;\n\t\t\tcropCanvas.height = 367;\n\t\t\tconst cropContext = cropCanvas.getContext('2d', { willReadFrequently: true });\n\t\t\tcropContext.imageSmoothingEnabled = false;\n\t\t\tcropContext.drawImage(workingCanvas, radarSourceX, radarSourceY, (radarOffsetX * 2), (radarOffsetY * 2.33), 0, 0, 640, 367);\n\t\t\t// clean the image\n\t\t\tRadar.removeDopplerRadarImageNoise(cropContext);\n\n\t\t\t// merge the radar and map\n\t\t\tRadar.mergeDopplerRadarImage(context, cropContext);\n\n\t\t\tconst elem = this.fillTemplate('frame', { map: { type: 'img', src: canvas.toDataURL() } });\n\n\t\t\treturn {\n\t\t\t\tcanvas,\n\t\t\t\ttime,\n\t\t\t\telem,\n\t\t\t};\n\t\t}));\n\n\t\t// put the elements in the container\n\t\tconst scrollArea = this.elem.querySelector('.scroll-area');\n\t\tscrollArea.innerHTML = '';\n\t\tscrollArea.append(...radarInfo.map((r) => r.elem));\n\n\t\t// set max length\n\t\tthis.timing.totalScreens = radarInfo.length;\n\t\t// store the images\n\t\tthis.data = radarInfo.map((radar) => radar.canvas);\n\n\t\tthis.times = radarInfo.map((radar) => radar.time);\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst time = this.times[this.screenIndex].toLocaleString(DateTime.TIME_SIMPLE);\n\t\tconst timePadded = time.length >= 8 ? time : `&nbsp;${time}`;\n\t\tthis.elem.querySelector('.header .right .time').innerHTML = timePadded;\n\n\t\t// scroll to image\n\t\tthis.elem.querySelector('.scroll-area').style.top = `${-this.screenIndex * 371}px`;\n\n\t\tthis.finishDraw();\n\t}\n\n\tstatic getXYFromLatitudeLongitudeMap(pos, offsetX, offsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst imgHeight = 3200;\n\t\tconst imgWidth = 5100;\n\n\t\ty = (51.75 - pos.latitude) * 55.2;\n\t\t// center map\n\t\ty -= offsetY;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (imgHeight - (offsetY * 2))) {\n\t\t\ty = imgHeight - (offsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-130.37 - pos.longitude) * 41.775) * -1;\n\t\t// center map\n\t\tx -= offsetX;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (imgWidth - (offsetX * 2))) {\n\t\t\tx = imgWidth - (offsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x: x * 2, y: y * 2 };\n\t}\n\n\tstatic getXYFromLatitudeLongitudeDoppler(pos, offsetX, offsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst imgHeight = 6000;\n\t\tconst imgWidth = 2800;\n\n\t\ty = (51 - pos.latitude) * 61.4481;\n\t\t// center map\n\t\ty -= offsetY;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (imgHeight - (offsetY * 2))) {\n\t\t\ty = imgHeight - (offsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-129.138 - pos.longitude) * 42.1768) * -1;\n\t\t// center map\n\t\tx -= offsetX;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (imgWidth - (offsetX * 2))) {\n\t\t\tx = imgWidth - (offsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x: x * 2, y: y * 2 };\n\t}\n\n\tstatic removeDopplerRadarImageNoise(RadarContext) {\n\t\tconst RadarImageData = RadarContext.getImageData(0, 0, RadarContext.canvas.width, RadarContext.canvas.height);\n\n\t\t// examine every pixel,\n\t\t// change any old rgb to the new-rgb\n\t\tfor (let i = 0; i < RadarImageData.data.length; i += 4) {\n\t\t\t// i + 0 = red\n\t\t\t// i + 1 = green\n\t\t\t// i + 2 = blue\n\t\t\t// i + 3 = alpha (0 = transparent, 255 = opaque)\n\t\t\tlet R = RadarImageData.data[i];\n\t\t\tlet G = RadarImageData.data[i + 1];\n\t\t\tlet B = RadarImageData.data[i + 2];\n\t\t\tlet A = RadarImageData.data[i + 3];\n\n\t\t\t// is this pixel the old rgb?\n\t\t\tif ((R === 0 && G === 0 && B === 0)\n || (R === 0 && G === 236 && B === 236)\n || (R === 1 && G === 160 && B === 246)\n || (R === 0 && G === 0 && B === 246)) {\n\t\t\t\t// change to your new rgb\n\n\t\t\t\t// Transparent\n\t\t\t\tR = 0;\n\t\t\t\tG = 0;\n\t\t\t\tB = 0;\n\t\t\t\tA = 0;\n\t\t\t} else if ((R === 0 && G === 255 && B === 0)) {\n\t\t\t\t// Light Green 1\n\t\t\t\tR = 49;\n\t\t\t\tG = 210;\n\t\t\t\tB = 22;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 0 && G === 200 && B === 0)) {\n\t\t\t\t// Light Green 2\n\t\t\t\tR = 0;\n\t\t\t\tG = 142;\n\t\t\t\tB = 0;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 0 && G === 144 && B === 0)) {\n\t\t\t\t// Dark Green 1\n\t\t\t\tR = 20;\n\t\t\t\tG = 90;\n\t\t\t\tB = 15;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 255 && G === 255 && B === 0)) {\n\t\t\t\t// Dark Green 2\n\t\t\t\tR = 10;\n\t\t\t\tG = 40;\n\t\t\t\tB = 10;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 231 && G === 192 && B === 0)) {\n\t\t\t\t// Yellow\n\t\t\t\tR = 196;\n\t\t\t\tG = 179;\n\t\t\t\tB = 70;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 255 && G === 144 && B === 0)) {\n\t\t\t\t// Orange\n\t\t\t\tR = 190;\n\t\t\t\tG = 72;\n\t\t\t\tB = 19;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 214 && G === 0 && B === 0)\n || (R === 255 && G === 0 && B === 0)) {\n\t\t\t\t// Red\n\t\t\t\tR = 171;\n\t\t\t\tG = 14;\n\t\t\t\tB = 14;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 192 && G === 0 && B === 0)\n || (R === 255 && G === 0 && B === 255)) {\n\t\t\t\t// Brown\n\t\t\t\tR = 115;\n\t\t\t\tG = 31;\n\t\t\t\tB = 4;\n\t\t\t\tA = 255;\n\t\t\t}\n\n\t\t\tRadarImageData.data[i] = R;\n\t\t\tRadarImageData.data[i + 1] = G;\n\t\t\tRadarImageData.data[i + 2] = B;\n\t\t\tRadarImageData.data[i + 3] = A;\n\t\t}\n\n\t\tRadarContext.putImageData(RadarImageData, 0, 0);\n\n\t\t// MapContext.drawImage(RadarContext.canvas, 0, 0);\n\t}\n\n\tstatic mergeDopplerRadarImage(mapContext, radarContext) {\n\t\tconst mapImageData = mapContext.getImageData(0, 0, mapContext.canvas.width, mapContext.canvas.height);\n\t\tconst radarImageData = radarContext.getImageData(0, 0, radarContext.canvas.width, radarContext.canvas.height);\n\n\t\t// examine every pixel,\n\t\t// change any old rgb to the new-rgb\n\t\tfor (let i = 0; i < radarImageData.data.length; i += 4) {\n\t\t\t// i + 0 = red\n\t\t\t// i + 1 = green\n\t\t\t// i + 2 = blue\n\t\t\t// i + 3 = alpha (0 = transparent, 255 = opaque)\n\n\t\t\t// is this pixel the old rgb?\n\t\t\tif ((mapImageData.data[i] < 116 && mapImageData.data[i + 1] < 116 && mapImageData.data[i + 2] < 116)) {\n\t\t\t\t// change to your new rgb\n\n\t\t\t\t// Transparent\n\t\t\t\tradarImageData.data[i] = 0;\n\t\t\t\tradarImageData.data[i + 1] = 0;\n\t\t\t\tradarImageData.data[i + 2] = 0;\n\t\t\t\tradarImageData.data[i + 3] = 0;\n\t\t\t}\n\t\t}\n\n\t\tradarContext.putImageData(radarImageData, 0, 0);\n\n\t\tmapContext.drawImage(radarContext.canvas, 0, 0);\n\t}\n}\n\n// register display\nregisterDisplay(new Radar(8, 'radar'));\n","// regional forecast and observations\n// type 0 = observations, 1 = first forecast, 2 = second forecast\n\nimport STATUS from './status.mjs';\nimport { distance as calcDistance } from './utils/calc.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { celsiusToFahrenheit } from './utils/units.mjs';\nimport { getWeatherRegionalIconFromIconLink } from './icons.mjs';\nimport { preloadImg } from './utils/image.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass RegionalForecast extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Regional Forecast', true);\n\n\t\t// timings\n\t\tthis.timing.totalScreens = 3;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// pre-load the base map\n\t\tlet baseMap = 'images/Basemap2.png';\n\t\tif (weatherParameters.state === 'HI') {\n\t\t\tbaseMap = 'images/HawaiiRadarMap4.png';\n\t\t} else if (weatherParameters.state === 'AK') {\n\t\t\tbaseMap = 'images/AlaskaRadarMap6.png';\n\t\t}\n\t\tthis.elem.querySelector('.map img').src = baseMap;\n\n\t\t// map offset\n\t\tconst offsetXY = {\n\t\t\tx: 240,\n\t\t\ty: 117,\n\t\t};\n\t\t// get user's location in x/y\n\t\tconst sourceXY = RegionalForecast.getXYFromLatitudeLongitude(weatherParameters.latitude, weatherParameters.longitude, offsetXY.x, offsetXY.y, weatherParameters.state);\n\n\t\t// get latitude and longitude limits\n\t\tconst minMaxLatLon = RegionalForecast.getMinMaxLatitudeLongitude(sourceXY.x, sourceXY.y, offsetXY.x, offsetXY.y, weatherParameters.state);\n\n\t\t// get a target distance\n\t\tlet targetDistance = 2.5;\n\t\tif (weatherParameters.state === 'HI') targetDistance = 1;\n\n\t\t// make station info into an array\n\t\tconst stationInfoArray = Object.values(StationInfo).map((value) => ({ ...value, targetDistance }));\n\t\t// combine regional cities with station info for additional stations\n\t\t// stations are intentionally after cities to allow cities priority when drawing the map\n\t\tconst combinedCities = [...RegionalCities, ...stationInfoArray];\n\n\t\t// Determine which cities are within the max/min latitude/longitude.\n\t\tconst regionalCities = [];\n\t\tcombinedCities.forEach((city) => {\n\t\t\tif (city.lat > minMaxLatLon.minLat && city.lat < minMaxLatLon.maxLat\n\t\t\t\t\t\t&& city.lon > minMaxLatLon.minLon && city.lon < minMaxLatLon.maxLon - 1) {\n\t\t\t\t// default to 1 for cities loaded from RegionalCities, use value calculate above for remaining stations\n\t\t\t\tconst targetDist = city.targetDistance || 1;\n\t\t\t\t// Only add the city as long as it isn't within set distance degree of any other city already in the array.\n\t\t\t\tconst okToAddCity = regionalCities.reduce((acc, testCity) => {\n\t\t\t\t\tconst distance = calcDistance(city.lon, city.lat, testCity.lon, testCity.lat);\n\t\t\t\t\treturn acc && distance >= targetDist;\n\t\t\t\t}, true);\n\t\t\t\tif (okToAddCity) regionalCities.push(city);\n\t\t\t}\n\t\t});\n\n\t\t// get regional forecasts and observations (the two are intertwined due to the design of api.weather.gov)\n\t\tconst regionalDataAll = await Promise.all(regionalCities.map(async (city) => {\n\t\t\ttry {\n\t\t\t\tif (!city.point) throw new Error('No pre-loaded point');\n\n\t\t\t\t// start off the observation task\n\t\t\t\tconst observationPromise = RegionalForecast.getRegionalObservation(city.point, city);\n\n\t\t\t\tconst forecast = await json(`https://api.weather.gov/gridpoints/${city.point.wfo}/${city.point.x},${city.point.y}/forecast`);\n\n\t\t\t\t// get XY on map for city\n\t\t\t\tconst cityXY = RegionalForecast.getXYForCity(city, minMaxLatLon.maxLat, minMaxLatLon.minLon, weatherParameters.state);\n\n\t\t\t\t// wait for the regional observation if it's not done yet\n\t\t\t\tconst observation = await observationPromise;\n\t\t\t\t// format the observation the same as the forecast\n\t\t\t\tconst regionalObservation = {\n\t\t\t\t\tdaytime: !!observation.icon.match(/\\/day\\//),\n\t\t\t\t\ttemperature: celsiusToFahrenheit(observation.temperature.value),\n\t\t\t\t\tname: RegionalForecast.formatCity(city.city),\n\t\t\t\t\ticon: observation.icon,\n\t\t\t\t\tx: cityXY.x,\n\t\t\t\t\ty: cityXY.y,\n\t\t\t\t};\n\n\t\t\t\t// preload the icon\n\t\t\t\tpreloadImg(getWeatherRegionalIconFromIconLink(regionalObservation.icon, !regionalObservation.daytime));\n\n\t\t\t\t// return a pared-down forecast\n\t\t\t\t// 0th object is the current conditions\n\t\t\t\t// first object is the next period i.e. if it's daytime then it's the \"tonight\" forecast\n\t\t\t\t// second object is the following period\n\t\t\t\t// always skip the first forecast index because it's what's going on right now\n\t\t\t\treturn [\n\t\t\t\t\tregionalObservation,\n\t\t\t\t\tRegionalForecast.buildForecast(forecast.properties.periods[1], city, cityXY),\n\t\t\t\t\tRegionalForecast.buildForecast(forecast.properties.periods[2], city, cityXY),\n\t\t\t\t];\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(`No regional forecast data for '${city.name ?? city.city}'`);\n\t\t\t\tconsole.log(e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}));\n\n\t\t// filter out any false (unavailable data)\n\t\tconst regionalData = regionalDataAll.filter((data) => data);\n\n\t\t// test for data present\n\t\tif (regionalData.length === 0) {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\n\t\t// return the weather data and offsets\n\t\tthis.data = {\n\t\t\tregionalData,\n\t\t\toffsetXY,\n\t\t\tsourceXY,\n\t\t};\n\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\tstatic buildForecast(forecast, city, cityXY) {\n\t\treturn {\n\t\t\tdaytime: forecast.isDaytime,\n\t\t\ttemperature: forecast.temperature || 0,\n\t\t\tname: RegionalForecast.formatCity(city.city),\n\t\t\ticon: forecast.icon,\n\t\t\tx: cityXY.x,\n\t\t\ty: cityXY.y,\n\t\t\ttime: forecast.startTime,\n\t\t};\n\t}\n\n\tstatic async getRegionalObservation(point, city) {\n\t\ttry {\n\t\t\t// get stations\n\t\t\tconst stations = await json(`https://api.weather.gov/gridpoints/${city.point.wfo}/${city.point.x},${city.point.y}/stations`);\n\n\t\t\t// get the first station\n\t\t\tconst station = stations.features[0].id;\n\t\t\t// get the observation data\n\t\t\tconst observation = await json(`${station}/observations/latest`);\n\t\t\t// preload the image\n\t\t\tif (!observation.properties.icon) return false;\n\t\t\tpreloadImg(getWeatherRegionalIconFromIconLink(observation.properties.icon, !observation.properties.daytime));\n\t\t\t// return the observation\n\t\t\treturn observation.properties;\n\t\t} catch (e) {\n\t\t\tconsole.log(`Unable to get regional observations for ${city.Name ?? city.city}`);\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// utility latitude/pixel conversions\n\tstatic getXYFromLatitudeLongitude(Latitude, Longitude, OffsetX, OffsetY, state) {\n\t\tif (state === 'AK') return RegionalForecast.getXYFromLatitudeLongitudeAK(Latitude, Longitude, OffsetX, OffsetY);\n\t\tif (state === 'HI') return RegionalForecast.getXYFromLatitudeLongitudeHI(Latitude, Longitude, OffsetX, OffsetY);\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst ImgHeight = 1600;\n\t\tconst ImgWidth = 2550;\n\n\t\ty = (50.5 - Latitude) * 55.2;\n\t\ty -= OffsetY; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (ImgHeight - (OffsetY * 2))) {\n\t\t\ty = ImgHeight - (OffsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-127.5 - Longitude) * 41.775) * -1;\n\t\tx -= OffsetX; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (ImgWidth - (OffsetX * 2))) {\n\t\t\tx = ImgWidth - (OffsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYFromLatitudeLongitudeAK(Latitude, Longitude, OffsetX, OffsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst ImgHeight = 1142;\n\t\tconst ImgWidth = 1200;\n\n\t\ty = (73.0 - Latitude) * 56;\n\t\ty -= OffsetY; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (ImgHeight - (OffsetY * 2))) {\n\t\t\ty = ImgHeight - (OffsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-175.0 - Longitude) * 25.0) * -1;\n\t\tx -= OffsetX; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (ImgWidth - (OffsetX * 2))) {\n\t\t\tx = ImgWidth - (OffsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYFromLatitudeLongitudeHI(Latitude, Longitude, OffsetX, OffsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst ImgHeight = 571;\n\t\tconst ImgWidth = 600;\n\n\t\ty = (25 - Latitude) * 55.2;\n\t\ty -= OffsetY; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (ImgHeight - (OffsetY * 2))) {\n\t\t\ty = ImgHeight - (OffsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-164.5 - Longitude) * 41.775) * -1;\n\t\tx -= OffsetX; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (ImgWidth - (OffsetX * 2))) {\n\t\t\tx = ImgWidth - (OffsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getMinMaxLatitudeLongitude(X, Y, OffsetX, OffsetY, state) {\n\t\tif (state === 'AK') return RegionalForecast.getMinMaxLatitudeLongitudeAK(X, Y, OffsetX, OffsetY);\n\t\tif (state === 'HI') return RegionalForecast.getMinMaxLatitudeLongitudeHI(X, Y, OffsetX, OffsetY);\n\t\tconst maxLat = ((Y / 55.2) - 50.5) * -1;\n\t\tconst minLat = (((Y + (OffsetY * 2)) / 55.2) - 50.5) * -1;\n\t\tconst minLon = (((X * -1) / 41.775) + 127.5) * -1;\n\t\tconst maxLon = ((((X + (OffsetX * 2)) * -1) / 41.775) + 127.5) * -1;\n\n\t\treturn {\n\t\t\tminLat, maxLat, minLon, maxLon,\n\t\t};\n\t}\n\n\tstatic getMinMaxLatitudeLongitudeAK(X, Y, OffsetX, OffsetY) {\n\t\tconst maxLat = ((Y / 56) - 73.0) * -1;\n\t\tconst minLat = (((Y + (OffsetY * 2)) / 56) - 73.0) * -1;\n\t\tconst minLon = (((X * -1) / 25) + 175.0) * -1;\n\t\tconst maxLon = ((((X + (OffsetX * 2)) * -1) / 25) + 175.0) * -1;\n\n\t\treturn {\n\t\t\tminLat, maxLat, minLon, maxLon,\n\t\t};\n\t}\n\n\tstatic getMinMaxLatitudeLongitudeHI(X, Y, OffsetX, OffsetY) {\n\t\tconst maxLat = ((Y / 55.2) - 25) * -1;\n\t\tconst minLat = (((Y + (OffsetY * 2)) / 55.2) - 25) * -1;\n\t\tconst minLon = (((X * -1) / 41.775) + 164.5) * -1;\n\t\tconst maxLon = ((((X + (OffsetX * 2)) * -1) / 41.775) + 164.5) * -1;\n\n\t\treturn {\n\t\t\tminLat, maxLat, minLon, maxLon,\n\t\t};\n\t}\n\n\tstatic getXYForCity(City, MaxLatitude, MinLongitude, state) {\n\t\tif (state === 'AK') RegionalForecast.getXYForCityAK(City, MaxLatitude, MinLongitude);\n\t\tif (state === 'HI') RegionalForecast.getXYForCityHI(City, MaxLatitude, MinLongitude);\n\t\tlet x = (City.lon - MinLongitude) * 57;\n\t\tlet y = (MaxLatitude - City.lat) * 70;\n\n\t\tif (y < 30) y = 30;\n\t\tif (y > 282) y = 282;\n\n\t\tif (x < 40) x = 40;\n\t\tif (x > 580) x = 580;\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYForCityAK(City, MaxLatitude, MinLongitude) {\n\t\tlet x = (City.lon - MinLongitude) * 37;\n\t\tlet y = (MaxLatitude - City.lat) * 70;\n\n\t\tif (y < 30) y = 30;\n\t\tif (y > 282) y = 282;\n\n\t\tif (x < 40) x = 40;\n\t\tif (x > 580) x = 580;\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYForCityHI(City, MaxLatitude, MinLongitude) {\n\t\tlet x = (City.lon - MinLongitude) * 57;\n\t\tlet y = (MaxLatitude - City.lat) * 70;\n\n\t\tif (y < 30) y = 30;\n\t\tif (y > 282) y = 282;\n\n\t\tif (x < 40) x = 40;\n\t\tif (x > 580) x = 580;\n\n\t\treturn { x, y };\n\t}\n\n\t// to fit on the map, remove anything after punctuation and then limit to 15 characters\n\tstatic formatCity(city) {\n\t\treturn city.match(/[^-;/\\\\,]*/)[0].substr(0, 12);\n\t}\n\n\tdrawCanvas() {\n\t\tsuper.drawCanvas();\n\t\t// break up data into useful values\n\t\tconst { regionalData: data, sourceXY, offsetXY } = this.data;\n\n\t\t// draw the header graphics\n\n\t\t// draw the appropriate title\n\t\tconst titleTop = this.elem.querySelector('.title.dual .top');\n\t\tconst titleBottom = this.elem.querySelector('.title.dual .bottom');\n\t\tif (this.screenIndex === 0) {\n\t\t\ttitleTop.innerHTML = 'Regional';\n\t\t\ttitleBottom.innerHTML = 'Observations';\n\t\t} else {\n\t\t\tconst forecastDate = DateTime.fromISO(data[0][this.screenIndex].time);\n\n\t\t\t// get the name of the day\n\t\t\tconst dayName = forecastDate.toLocaleString({ weekday: 'long' });\n\t\t\ttitleTop.innerHTML = 'Forecast for';\n\t\t\t// draw the title\n\t\t\tif (data[0][this.screenIndex].daytime) {\n\t\t\t\ttitleBottom.innerHTML = dayName;\n\t\t\t} else {\n\t\t\t\ttitleBottom.innerHTML = `${dayName} Night`;\n\t\t\t}\n\t\t}\n\n\t\t// draw the map\n\t\tconst scale = 640 / (offsetXY.x * 2);\n\t\tconst map = this.elem.querySelector('.map');\n\t\tmap.style.zoom = scale;\n\t\tmap.style.top = `-${sourceXY.y}px`;\n\t\tmap.style.left = `-${sourceXY.x}px`;\n\n\t\tconst cities = data.map((city) => {\n\t\t\tconst fill = {};\n\t\t\tconst period = city[this.screenIndex];\n\n\t\t\tfill.icon = { type: 'img', src: getWeatherRegionalIconFromIconLink(period.icon, !period.daytime) };\n\t\t\tfill.city = period.name;\n\t\t\tconst { temperature } = period;\n\t\t\tfill.temp = temperature;\n\n\t\t\tconst elem = this.fillTemplate('location', fill);\n\t\t\telem.style.left = `${period.x}px`;\n\t\t\telem.style.top = `${period.y}px`;\n\n\t\t\treturn elem;\n\t\t});\n\n\t\tconst locationContainer = this.elem.querySelector('.location-container');\n\t\tlocationContainer.innerHTML = '';\n\t\tlocationContainer.append(...cities);\n\n\t\tthis.finishDraw();\n\t}\n}\n\n// register display\nregisterDisplay(new RegionalForecast(4, 'regional-forecast'));\n","const STATUS = {\n\tloading: Symbol('loading'),\n\tloaded: Symbol('loaded'),\n\tfailed: Symbol('failed'),\n\tnoData: Symbol('noData'),\n\tdisabled: Symbol('disabled'),\n};\n\nexport default STATUS;\n","// travel forecast display\nimport STATUS from './status.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { getWeatherRegionalIconFromIconLink } from './icons.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass TravelForecast extends WeatherDisplay {\n\tconstructor(navId, elemId, defaultActive) {\n\t\t// special height and width for scrolling\n\t\tsuper(navId, elemId, 'Travel Forecast', defaultActive);\n\n\t\t// set up the timing\n\t\tthis.timing.baseDelay = 20;\n\t\t// page sizes are 4 cities, calculate the number of pages necessary plus overflow\n\t\tconst pagesFloat = TravelCities.length / 4;\n\t\tconst pages = Math.floor(pagesFloat) - 2; // first page is already displayed, last page doesn't happen\n\t\tconst extra = pages % 1;\n\t\tconst timingStep = 75 * 4;\n\t\tthis.timing.delay = [150 + timingStep];\n\t\t// add additional pages\n\t\tfor (let i = 0; i < pages; i += 1) this.timing.delay.push(timingStep);\n\t\t// add the extra (not exactly 4 pages portion)\n\t\tif (extra !== 0) this.timing.delay.push(Math.round(this.extra * this.cityHeight));\n\t\t// add the final 3 second delay\n\t\tthis.timing.delay.push(150);\n\t}\n\n\tasync getData() {\n\t\t// super checks for enabled\n\t\tif (!super.getData()) return;\n\t\tconst forecastPromises = TravelCities.map(async (city) => {\n\t\t\ttry {\n\t\t\t\t// get point then forecast\n\t\t\t\tif (!city.point) throw new Error('No pre-loaded point');\n\t\t\t\tconst forecast = await json(`https://api.weather.gov/gridpoints/${city.point.wfo}/${city.point.x},${city.point.y}/forecast`);\n\t\t\t\t// determine today or tomorrow (shift periods by 1 if tomorrow)\n\t\t\t\tconst todayShift = forecast.properties.periods[0].isDaytime ? 0 : 1;\n\t\t\t\t// return a pared-down forecast\n\t\t\t\treturn {\n\t\t\t\t\ttoday: todayShift === 0,\n\t\t\t\t\thigh: forecast.properties.periods[todayShift].temperature,\n\t\t\t\t\tlow: forecast.properties.periods[todayShift + 1].temperature,\n\t\t\t\t\tname: city.Name,\n\t\t\t\t\ticon: getWeatherRegionalIconFromIconLink(forecast.properties.periods[todayShift].icon),\n\t\t\t\t};\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(`GetTravelWeather for ${city.Name} failed`);\n\t\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\t\treturn { name: city.Name, error: true };\n\t\t\t}\n\t\t});\n\n\t\t// wait for all forecasts\n\t\tconst forecasts = await Promise.all(forecastPromises);\n\t\tthis.data = forecasts;\n\n\t\t// test for some data available in at least one forecast\n\t\tconst hasData = this.data.reduce((acc, forecast) => acc || forecast.high, false);\n\t\tif (!hasData) {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setStatus(STATUS.loaded);\n\t\tthis.drawLongCanvas();\n\t}\n\n\tasync drawLongCanvas() {\n\t\t// get the element and populate\n\t\tconst list = this.elem.querySelector('.travel-lines');\n\t\tlist.innerHTML = '';\n\n\t\t// set up variables\n\t\tconst cities = this.data;\n\n\t\tconst lines = cities.map((city) => {\n\t\t\tif (city.error) return false;\n\t\t\tconst fillValues = {};\n\n\t\t\t// city name\n\t\t\tfillValues.city = city;\n\n\t\t\t// check for forecast data\n\t\t\tif (city.icon) {\n\t\t\t\tfillValues.city = city.name;\n\t\t\t\t// get temperatures and convert if necessary\n\t\t\t\tconst { low, high } = city;\n\n\t\t\t\t// convert to strings with no decimal\n\t\t\t\tconst lowString = Math.round(low).toString();\n\t\t\t\tconst highString = Math.round(high).toString();\n\n\t\t\t\tfillValues.low = lowString;\n\t\t\t\tfillValues.high = highString;\n\n\t\t\t\tfillValues.icon = { type: 'img', src: city.icon };\n\t\t\t} else {\n\t\t\t\tfillValues.error = 'NO TRAVEL DATA AVAILABLE';\n\t\t\t}\n\t\t\treturn this.fillTemplate('travel-row', fillValues);\n\t\t}).filter((d) => d);\n\t\tlist.append(...lines);\n\t}\n\n\tasync drawCanvas() {\n\t\t// there are technically 2 canvases: the standard canvas and the extra-long canvas that contains the complete\n\t\t// list of cities. The second canvas is copied into the standard canvas to create the scroll\n\t\tsuper.drawCanvas();\n\n\t\t// set up variables\n\t\tconst cities = this.data;\n\n\t\tthis.elem.querySelector('.header .title.dual .bottom').innerHTML = `For ${TravelForecast.getTravelCitiesDayName(cities)}`;\n\n\t\tthis.finishDraw();\n\t}\n\n\tasync showCanvas() {\n\t\t// special to travel forecast to draw the remainder of the canvas\n\t\tawait this.drawCanvas();\n\t\tsuper.showCanvas();\n\t}\n\n\t// screen index change callback just runs the base count callback\n\tscreenIndexChange() {\n\t\tthis.baseCountChange(this.navBaseCount);\n\t}\n\n\t// base count change callback\n\tbaseCountChange(count) {\n\t\t// calculate scroll offset and don't go past end\n\t\tlet offsetY = Math.min(this.elem.querySelector('.travel-lines').getBoundingClientRect().height - 289, (count - 150));\n\n\t\t// don't let offset go negative\n\t\tif (offsetY < 0) offsetY = 0;\n\n\t\t// copy the scrolled portion of the canvas\n\t\tthis.elem.querySelector('.main').scrollTo(0, offsetY);\n\t}\n\n\tstatic getTravelCitiesDayName(cities) {\n\t\t// effectively returns early on the first found date\n\t\treturn cities.reduce((dayName, city) => {\n\t\t\tif (city && dayName === '') {\n\t\t\t\t// today or tomorrow\n\t\t\t\tconst day = DateTime.local().plus({ days: (city.today) ? 0 : 1 });\n\t\t\t\t// return the day\n\t\t\t\treturn day.toLocaleString({ weekday: 'long' });\n\t\t\t}\n\t\t\treturn dayName;\n\t\t}, '');\n\t}\n\n\t// necessary to get the lastest long canvas when scrolling\n\tgetLongCanvas() {\n\t\treturn this.longCanvas;\n\t}\n}\n\n// register display, not active by default\nregisterDisplay(new TravelForecast(3, 'travel', false));\n","const relativeHumidity = (Temperature, DewPoint) => {\n\tconst T = Temperature;\n\tconst TD = DewPoint;\n\treturn Math.round(100 * (Math.exp((17.625 * TD) / (243.04 + TD)) / Math.exp((17.625 * T) / (243.04 + T))));\n};\n\nconst heatIndex = (Temperature, RelativeHumidity) => {\n\tconst T = Temperature;\n\tconst RH = RelativeHumidity;\n\tlet HI = 0.5 * (T + 61.0 + ((T - 68.0) * 1.2) + (RH * 0.094));\n\tlet ADJUSTMENT;\n\n\tif (T >= 80) {\n\t\tHI = -42.379 + 2.04901523 * T + 10.14333127 * RH - 0.22475541 * T * RH - 0.00683783 * T * T - 0.05481717 * RH * RH + 0.00122874 * T * T * RH + 0.00085282 * T * RH * RH - 0.00000199 * T * T * RH * RH;\n\n\t\tif (RH < 13 && (T > 80 && T < 112)) {\n\t\t\tADJUSTMENT = ((13 - RH) / 4) * Math.sqrt((17 - Math.abs(T - 95)) / 17);\n\t\t\tHI -= ADJUSTMENT;\n\t\t} else if (RH > 85 && (T > 80 && T < 87)) {\n\t\t\tADJUSTMENT = ((RH - 85) / 10) * ((87 - T) / 5);\n\t\t\tHI += ADJUSTMENT;\n\t\t}\n\t}\n\n\tif (HI < Temperature) {\n\t\tHI = Temperature;\n\t}\n\n\treturn Math.round(HI);\n};\n\nconst windChill = (Temperature, WindSpeed) => {\n\tif (WindSpeed === '0' || WindSpeed === 'Calm' || WindSpeed === 'NA') {\n\t\treturn '';\n\t}\n\n\tconst T = Temperature;\n\tconst V = WindSpeed;\n\n\treturn Math.round(35.74 + (0.6215 * T) - (35.75 * (V ** 0.16)) + (0.4275 * T * (V ** 0.16)));\n};\n\n// wind direction\nconst directionToNSEW = (Direction) => {\n\tconst val = Math.floor((Direction / 22.5) + 0.5);\n\tconst arr = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'];\n\treturn arr[(val % 16)];\n};\n\nconst distance = (x1, y1, x2, y2) => Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);\n\n// wrap a number to 0-m\nconst wrap = (x, m) => ((x % m) + m) % m;\n\nexport {\n\trelativeHumidity,\n\theatIndex,\n\twindChill,\n\tdirectionToNSEW,\n\tdistance,\n\twrap,\n};\n","// rewrite some urls for local server\nconst rewriteUrl = (_url) => {\n\tlet url = _url;\n\turl = url.replace('https://api.weather.gov/', window.location.href);\n\turl = url.replace('https://www.cpc.ncep.noaa.gov/', window.location.href);\n\treturn url;\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\trewriteUrl,\n};\n","const elemForEach = (selector, callback) => {\n\t[...document.querySelectorAll(selector)].forEach(callback);\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\telemForEach,\n};\n","import { rewriteUrl } from './cors.mjs';\n\nconst json = (url, params) => fetchAsync(url, 'json', params);\nconst text = (url, params) => fetchAsync(url, 'text', params);\nconst raw = (url, params) => fetchAsync(url, '', params);\nconst blob = (url, params) => fetchAsync(url, 'blob', params);\n\nconst fetchAsync = async (_url, responseType, _params = {}) => {\n\t// combine default and provided parameters\n\tconst params = {\n\t\tmethod: 'GET',\n\t\tmode: 'cors',\n\t\ttype: 'GET',\n\t\t..._params,\n\t};\n\t\t// build a url, including the rewrite for cors if necessary\n\tlet corsUrl = _url;\n\tif (params.cors === true) corsUrl = rewriteUrl(_url);\n\tconst url = new URL(corsUrl, `${window.location.origin}/`);\n\t// match the security protocol when not on localhost\n\turl.protocol = window.location.hostname !== 'localhost' ? window.location.protocol : url.protocol;\n\t// add parameters if necessary\n\tif (params.data) {\n\t\tObject.keys(params.data).forEach((key) => {\n\t\t\t// get the value\n\t\t\tconst value = params.data[key];\n\t\t\t// add to the url\n\t\t\turl.searchParams.append(key, value);\n\t\t});\n\t}\n\n\t// make the request\n\tconst response = await fetch(url, params);\n\n\t// check for ok response\n\tif (!response.ok) throw new Error(`Fetch error ${response.status} ${response.statusText} while fetching ${response.url}`);\n\t// return the requested response\n\tswitch (responseType) {\n\tcase 'json':\n\t\treturn response.json();\n\tcase 'text':\n\t\treturn response.text();\n\tcase 'blob':\n\t\treturn response.blob();\n\tdefault:\n\t\treturn response;\n\t}\n};\n\nexport {\n\tjson,\n\ttext,\n\traw,\n\tblob,\n};\n","import { blob } from './fetch.mjs';\nimport { rewriteUrl } from './cors.mjs';\n\n// ****************************** load images *********************************\n// load an image from a blob or url\nconst loadImg = (imgData, cors = false) => new Promise((resolve) => {\n\tconst img = new Image();\n\timg.onload = (e) => {\n\t\tresolve(e.target);\n\t};\n\tif (imgData instanceof Blob) {\n\t\timg.src = window.URL.createObjectURL(imgData);\n\t} else {\n\t\tlet url = imgData;\n\t\tif (cors) url = rewriteUrl(imgData);\n\t\timg.src = url;\n\t}\n});\n\n// preload an image\n// the goal is to get it in the browser's cache so it is available more quickly when the browser needs it\n// a list of cached icons is used to avoid hitting the cache multiple times\nconst cachedImages = [];\nconst preloadImg = (src) => {\n\tif (cachedImages.includes(src)) return false;\n\tblob(src);\n\t// cachedImages.push(src);\n\treturn true;\n};\n\nexport {\n\tloadImg,\n\tpreloadImg,\n};\n","// track state of nosleep locally to avoid a null case error\n// when nosleep.disable is called without first calling .enable\n\nlet wakeLock = false;\n\nconst noSleep = (enable = false) => {\n\t// get a nosleep controller\n\tif (!noSleep.controller) noSleep.controller = new NoSleep();\n\t// don't call anything if the states match\n\tif (wakeLock === enable) return false;\n\t// store the value\n\twakeLock = enable;\n\t// call the function\n\tif (enable) return noSleep.controller.enable();\n\treturn noSleep.controller.disable();\n};\n\nexport default noSleep;\n","const locationCleanup = (input) => {\n\t// regexes to run\n\tconst regexes = [\n\t\t// \"Chicago / West Chicago\", removes before slash\n\t\t/^[A-Za-z ]+ \\/ /,\n\t\t// \"Chicago/Waukegan\" removes before slash\n\t\t/^[A-Za-z ]+\\//,\n\t\t// \"Chicago, Chicago O'hare\" removes before comma\n\t\t/^[A-Za-z ]+, /,\n\t];\n\n\t// run all regexes\n\treturn regexes.reduce((value, regex) => value.replace(regex, ''), input);\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\tlocationCleanup,\n};\n","// *********************************** unit conversions ***********************\n\nconst round2 = (value, decimals) => Number(`${Math.round(`${value}e${decimals}`)}e-${decimals}`);\n\nconst kphToMph = (Kph) => Math.round(Kph / 1.60934);\nconst celsiusToFahrenheit = (Celsius) => Math.round((Celsius * 9) / 5 + 32);\nconst kilometersToMiles = (Kilometers) => Math.round(Kilometers / 1.60934);\nconst metersToFeet = (Meters) => Math.round(Meters / 0.3048);\nconst pascalToInHg = (Pascal) => round2(Pascal * 0.0002953, 2);\n\nexport {\n\tkphToMph,\n\tcelsiusToFahrenheit,\n\tkilometersToMiles,\n\tmetersToFeet,\n\tpascalToInHg,\n};\n","import { json } from './fetch.mjs';\n\nconst getPoint = async (lat, lon) => {\n\ttry {\n\t\treturn await json(`https://api.weather.gov/points/${lat},${lon}`);\n\t} catch (e) {\n\t\tconsole.log(`Unable to get point ${lat}, ${lon}`);\n\t\tconsole.error(e);\n\t\treturn false;\n\t}\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\tgetPoint,\n};\n","// base weather display class\n\nimport STATUS from './status.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport { elemForEach } from './utils/elem.mjs';\nimport {\n\tmsg, displayNavMessage, isPlaying, updateStatus,\n} from './navigation.mjs';\n\nclass WeatherDisplay {\n\tconstructor(navId, elemId, name, defaultEnabled) {\n\t\t// navId is used in messaging and sort order\n\t\tthis.navId = navId;\n\t\tthis.elemId = undefined;\n\t\tthis.gifs = [];\n\t\tthis.data = undefined;\n\t\tthis.loadingStatus = STATUS.loading;\n\t\tthis.name = name ?? elemId;\n\t\tthis.getDataCallbacks = [];\n\t\tthis.defaultEnabled = defaultEnabled;\n\t\tthis.okToDrawCurrentConditions = true;\n\t\tthis.okToDrawCurrentDateTime = true;\n\n\t\t// default navigation timing\n\t\tthis.timing = {\n\t\t\ttotalScreens: 1,\n\t\t\tbaseDelay: 9000, // 5 seconds\n\t\t\tdelay: 1, // 1*1second = 1 second total display time\n\t\t};\n\t\tthis.navBaseCount = 0;\n\t\tthis.screenIndex = -1;\t// special starting condition\n\n\t\t// store elemId once\n\t\tthis.storeElemId(elemId);\n\n\t\tif (this.enabled) {\n\t\t\tthis.setStatus(STATUS.loading);\n\t\t} else {\n\t\t\tthis.setStatus(STATUS.disabled);\n\t\t}\n\t\tthis.startNavCount();\n\n\t\t// get any templates\n\t\tdocument.addEventListener('DOMContentLoaded', () => {\n\t\t\tthis.loadTemplates();\n\t\t});\n\t}\n\n\tgenerateCheckbox(defaultEnabled = true) {\n\t\t// no checkbox if progress\n\t\tif (this.elemId === 'progress') return false;\n\n\t\t// get the saved status of the checkbox\n\t\tlet savedStatus = window.localStorage.getItem(`${this.elemId}Enabled`);\n\t\tif (savedStatus === null) savedStatus = defaultEnabled;\n\t\tif (savedStatus === 'true' || savedStatus === true) {\n\t\t\tthis.enabled = true;\n\t\t} else {\n\t\t\tthis.enabled = false;\n\t\t}\n\n\t\t// refresh (or initially store the state of the checkbox)\n\t\twindow.localStorage.setItem(`${this.elemId}Enabled`, this.enabled);\n\n\t\t// create a checkbox in the selected displays area\n\t\tconst checkbox = document.createElement('template');\n\t\tcheckbox.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>`;\n\t\tcheckbox.content.firstChild.addEventListener('change', (e) => this.checkboxChange(e));\n\n\t\treturn checkbox.content.firstChild;\n\t}\n\n\tcheckboxChange(e) {\n\t\t// update the state\n\t\tthis.enabled = e.target.checked;\n\t\t// store the value for the next load\n\t\twindow.localStorage.setItem(`${this.elemId}Enabled`, this.enabled);\n\t\t// calling get data will update the status and actually get the data if we're set to enabled\n\t\tthis.getData();\n\t}\n\n\t// set data status and send update to navigation module\n\tsetStatus(value) {\n\t\tthis.status = value;\n\t\tupdateStatus({\n\t\t\tid: this.navId,\n\t\t\tstatus: this.status,\n\t\t});\n\t}\n\n\tget status() {\n\t\treturn this.loadingStatus;\n\t}\n\n\tset status(state) {\n\t\tthis.loadingStatus = state;\n\t}\n\n\tstoreElemId(elemId) {\n\t\t// only create it once\n\t\tif (this.elemId) return;\n\t\tthis.elemId = elemId;\n\t}\n\n\t// get necessary data for this display\n\tgetData(weatherParameters) {\n\t\t// clear current data\n\t\tthis.data = undefined;\n\n\t\t// store weatherParameters locally in case we need them later\n\t\tif (weatherParameters) this.weatherParameters = weatherParameters;\n\n\t\t// set status\n\t\tif (this.enabled) {\n\t\t\tthis.setStatus(STATUS.loading);\n\t\t} else {\n\t\t\tthis.setStatus(STATUS.disabled);\n\t\t\treturn false;\n\t\t}\n\n\t\t// recalculate navigation timing (in case it was modified in the constructor)\n\t\tthis.calcNavTiming();\n\t\treturn true;\n\t}\n\n\t// return any data requested before it was available\n\tgetDataCallback() {\n\t\t// call each callback\n\t\tthis.getDataCallbacks.forEach((fxn) => fxn(this.data));\n\t\t// clear the callbacks\n\t\tthis.getDataCallbacks = [];\n\t}\n\n\tdrawCanvas() {\n\t\t// clean up the first-run flag in screen index\n\t\tif (this.screenIndex < 0) this.screenIndex = 0;\n\t}\n\n\tfinishDraw() {\n\t\t// draw date and time\n\t\tif (this.okToDrawCurrentDateTime) {\n\t\t\tthis.drawCurrentDateTime();\n\t\t\t// auto clock refresh\n\t\t\tif (!this.dateTimeInterval) {\n\t\t\t\tsetInterval(() => this.drawCurrentDateTime(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tdrawCurrentDateTime() {\n\t\t// only draw if canvas is active to conserve battery\n\t\tif (!this.isActive()) return;\n\t\t// Get the current date and time.\n\t\tconst now = DateTime.local();\n\n\t\t// time = \"11:35:08 PM\";\n\t\tconst time = now.toLocaleString(DateTime.TIME_WITH_SECONDS).padStart(11, ' ');\n\n\t\tif (this.lastTime !== time) {\n\t\t\telemForEach('.date-time.time', (elem) => { elem.innerHTML = time.toUpperCase(); });\n\t\t}\n\t\tthis.lastTime = time;\n\n\t\tconst date = now.toFormat(' ccc LLL ') + now.day.toString().padStart(2, ' ');\n\n\t\tif (this.lastDate !== date) {\n\t\t\telemForEach('.date-time.date', (elem) => { elem.innerHTML = date.toUpperCase(); });\n\t\t}\n\t\tthis.lastDate = date;\n\t}\n\n\t// show/hide the canvas and start/stop the navigation timer\n\tshowCanvas(navCmd) {\n\t\t// reset timing if enabled\n\t\t// if a nav command is present call it to set the screen index\n\t\tif (navCmd === msg.command.firstFrame) this.navNext(navCmd);\n\t\tif (navCmd === msg.command.lastFrame) this.navPrev(navCmd);\n\n\t\tthis.startNavCount();\n\n\t\tthis.elem.classList.add('show');\n\t}\n\n\thideCanvas() {\n\t\tthis.resetNavBaseCount();\n\t\tthis.elem.classList.remove('show');\n\t}\n\n\tisActive() {\n\t\treturn this.elem.offsetHeight !== 0;\n\t}\n\n\tisEnabled() {\n\t\treturn this.enabled;\n\t}\n\n\t// navigation timings\n\t// totalScreens = total number of screens that are available\n\t// baseDelay = ms to delay before re-evaluating screenIndex\n\t// delay: three options\n\t//\tinteger = each screen will display for this number of baseDelays\n\t//\t[integer, integer, ...] = screenIndex 0 displays for integer[0]*baseDelay, etc.\n\t//\t[{time, si}, ...] = time as above, si is specific screen index to display during this interval\n\t//\tif the array forms are used totalScreens is overwritten by the size of the array\n\tnavBaseTime() {\n\t\t// see if play is active and screen is active\n\t\tif (!isPlaying() || !this.isActive()) return;\n\t\t// increment the base count\n\t\tthis.navBaseCount += 1;\n\n\t\t// call base count change if available for this function\n\t\tif (this.baseCountChange) this.baseCountChange(this.navBaseCount);\n\n\t\t// handle base count/screen index changes\n\t\tthis.updateScreenFromBaseCount();\n\t}\n\n\tasync updateScreenFromBaseCount() {\n\t\t// get the next screen index\n\t\tconst nextScreenIndex = this.screenIndexFromBaseCount();\n\n\t\t// special cases for first and last frame\n\t\t// must compare with false as nextScreenIndex could be 0 which is valid\n\t\tif (nextScreenIndex === false) {\n\t\t\tthis.sendNavDisplayMessage(msg.response.next);\n\t\t\treturn;\n\t\t}\n\n\t\t// test for no change and exit early\n\t\tif (nextScreenIndex === this.screenIndex) return;\n\n\t\t// test for -1 (no screen displayed yet)\n\t\tif (nextScreenIndex === -1) {\n\t\t\tthis.screenIndex = 0;\n\t\t} else {\n\t\t\tthis.screenIndex = nextScreenIndex;\n\t\t}\n\n\t\t// call the appropriate screen index change method\n\t\tif (!this.screenIndexChange) {\n\t\t\tawait this.drawCanvas();\n\t\t\tthis.showCanvas();\n\t\t} else {\n\t\t\tthis.screenIndexChange(this.screenIndex);\n\t\t}\n\t}\n\n\t// take the three timing formats shown above and break them into arrays for consistent usage in navigation functions\n\t// this.timing.fullDelay = [end of screen index 0 in base counts, end of screen index 1...]\n\t// this.timing.screenIndexes = [screen index to use during this.timing.fullDelay[0], screen index to use during this.timing.fullDelay[1], ...]\n\tcalcNavTiming() {\n\t\tif (this.timing === false) return;\n\t\t// update total screens\n\t\tif (Array.isArray(this.timing.delay)) this.timing.totalScreens = this.timing.delay.length;\n\n\t\t// if the delay is provided as a single value, expand it to a series of the same value\n\t\tlet intermediateDelay = [];\n\t\tif (typeof this.timing.delay === 'number') {\n\t\t\tfor (let i = 0; i < this.timing.totalScreens; i += 1) intermediateDelay.push(this.timing.delay);\n\t\t} else {\n\t\t\t// map just the delays to the intermediate block\n\t\t\tintermediateDelay = this.timing.delay.map((delay) => {\n\t\t\t\tif (typeof delay === 'object') return delay.time;\n\t\t\t\treturn delay;\n\t\t\t});\n\t\t}\n\n\t\t// calculate the cumulative end point of each delay\n\t\tlet sum = 0;\n\t\tthis.timing.fullDelay = intermediateDelay.map((val) => {\n\t\t\tconst calc = sum + val;\n\t\t\tsum += val;\n\t\t\treturn calc;\n\t\t});\n\n\t\t// generate a list of screen either sequentially if not provided in an object or from the object\n\t\tif (Array.isArray(this.timing.delay) && typeof this.timing.delay[0] === 'object') {\n\t\t\t// extract screen indexes from objects\n\t\t\tthis.timing.screenIndexes = this.timing.delay.map((delay) => delay.si);\n\t\t} else {\n\t\t\t// generate sequential screen indexes\n\t\t\tthis.timing.screenIndexes = [];\n\t\t\tfor (let i = 0; i < this.timing.totalScreens; i += 1) this.timing.screenIndexes.push(i);\n\t\t}\n\t}\n\n\t// navigate to next screen\n\tnavNext(command) {\n\t\t// check for special 'first frame' command\n\t\tif (command === msg.command.firstFrame) {\n\t\t\tthis.resetNavBaseCount();\n\t\t} else {\n\t\t\t// set the base count to the next available frame\n\t\t\tconst newBaseCount = this.timing.fullDelay.find((delay) => delay > this.navBaseCount);\n\t\t\tthis.navBaseCount = newBaseCount;\n\t\t}\n\t\tthis.updateScreenFromBaseCount();\n\t}\n\n\t// navigate to previous screen\n\tnavPrev(command) {\n\t\t// check for special 'last frame' command\n\t\tif (command === msg.command.lastFrame) {\n\t\t\tthis.navBaseCount = this.timing.fullDelay[this.timing.totalScreens - 1] - 1;\n\t\t} else {\n\t\t\t// find the highest fullDelay that is less than the current base count\n\t\t\tconst newBaseCount = this.timing.fullDelay.reduce((acc, delay) => {\n\t\t\t\tif (delay < this.navBaseCount) return delay;\n\t\t\t\treturn acc;\n\t\t\t}, 0);\n\t\t\t// if the new base count is zero then we're already at the first screen\n\t\t\tif (newBaseCount === 0 && this.navBaseCount === 0) {\n\t\t\t\tthis.sendNavDisplayMessage(msg.response.previous);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.navBaseCount = newBaseCount;\n\t\t}\n\t\tthis.updateScreenFromBaseCount();\n\t}\n\n\t// get the screen index for the current base count, returns false if past end of timing array (go to next screen, stop timing)\n\tscreenIndexFromBaseCount() {\n\t\t// test for timing enabled\n\t\tif (!this.timing) return 0;\n\t\t// find the first timing in the timing array that is greater than the base count\n\t\tif (this.timing && !this.timing.fullDelay) this.calcNavTiming();\n\t\tconst timingIndex = this.timing.fullDelay.findIndex((delay) => delay > this.navBaseCount);\n\t\tif (timingIndex === -1) return false;\n\t\treturn this.timing.screenIndexes[timingIndex];\n\t}\n\n\t// start and stop base counter\n\tstartNavCount() {\n\t\tif (!this.navInterval) this.navInterval = setInterval(() => this.navBaseTime(), this.timing.baseDelay);\n\t}\n\n\tresetNavBaseCount() {\n\t\tthis.navBaseCount = 0;\n\t\tthis.screenIndex = -1;\n\t\t// reset the timing so we don't short-change the first screen\n\t\tif (this.navInterval) {\n\t\t\tclearInterval(this.navInterval);\n\t\t\tthis.navInterval = undefined;\n\t\t}\n\t}\n\n\tsendNavDisplayMessage(message) {\n\t\tdisplayNavMessage({\n\t\t\tid: this.navId,\n\t\t\ttype: message,\n\t\t});\n\t}\n\n\tloadTemplates() {\n\t\tthis.templates = {};\n\t\tthis.elem = document.getElementById(`${this.elemId}-html`);\n\t\tif (!this.elem) return;\n\t\tconst templates = this.elem.querySelectorAll('.template');\n\t\ttemplates.forEach((template) => {\n\t\t\tconst className = template.classList[0];\n\t\t\tconst node = template.cloneNode(true);\n\t\t\tnode.classList.remove('template');\n\t\t\tthis.templates[className] = node;\n\t\t\ttemplate.remove();\n\t\t});\n\t}\n\n\tfillTemplate(name, fillValues) {\n\t\t// get the template\n\t\tconst templateNode = this.templates[name];\n\t\tif (!templateNode) return false;\n\n\t\t// clone it\n\t\tconst template = templateNode.cloneNode(true);\n\n\t\tObject.entries(fillValues).forEach(([key, value]) => {\n\t\t\t// get the specified element\n\t\t\tconst elem = template.querySelector(`.${key}`);\n\t\t\tif (!elem) return;\n\n\t\t\t// fill based on type provided\n\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t// string and number fill the first found selector\n\t\t\t\telem.innerHTML = value;\n\t\t\t} else if (value?.type === 'img') {\n\t\t\t\t// fill the image source\n\t\t\t\telem.querySelector('img').src = value.src;\n\t\t\t}\n\t\t});\n\n\t\treturn template;\n\t}\n}\n\nexport default WeatherDisplay;\n","// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nclass InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nclass InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nclass ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n\n/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nconst DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nconst DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nconst DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nconst DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nconst DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nconst TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nconst TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nconst TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nconst TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nconst TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nconst TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nconst TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nconst TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nconst DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nconst DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nconst DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nconst DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nconst DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nconst DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\n/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\n/**\n * @private\n */\n\n// TYPES\n\nfunction isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nfunction isNumber(o) {\n return typeof o === \"number\";\n}\n\nfunction isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nfunction isString(o) {\n return typeof o === \"string\";\n}\n\nfunction isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nfunction hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nfunction maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nfunction bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nfunction pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n// NUMBERS AND STRINGS\n\nfunction integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nfunction floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nfunction padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nfunction parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nfunction parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nfunction parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nfunction roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nfunction isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nfunction daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nfunction daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// covert a calendar object to a local timestamp (epoch, but with the offset baked in)\nfunction objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n return +d;\n}\n\nfunction weeksInWeekYear(weekYear) {\n const p1 =\n (weekYear +\n Math.floor(weekYear / 4) -\n Math.floor(weekYear / 100) +\n Math.floor(weekYear / 400)) %\n 7,\n last = weekYear - 1,\n p2 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n}\n\nfunction untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > 60 ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nfunction parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nfunction signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nfunction asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nfunction normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nfunction formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nfunction timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n\nconst ianaRegex =\n /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\n/**\n * @private\n */\n\nconst monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nconst monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nfunction months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nconst weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nconst weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nconst weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nfunction weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nconst meridiems = [\"AM\", \"PM\"];\n\nconst erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nconst erasShort = [\"BC\", \"AD\"];\n\nconst erasNarrow = [\"B\", \"A\"];\n\nfunction eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nfunction meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nfunction weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nfunction monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nfunction eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nfunction formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: DATE_SHORT,\n DD: DATE_MED,\n DDD: DATE_FULL,\n DDDD: DATE_HUGE,\n t: TIME_SIMPLE,\n tt: TIME_WITH_SECONDS,\n ttt: TIME_WITH_SHORT_OFFSET,\n tttt: TIME_WITH_LONG_OFFSET,\n T: TIME_24_SIMPLE,\n TT: TIME_24_WITH_SECONDS,\n TTT: TIME_24_WITH_SHORT_OFFSET,\n TTTT: TIME_24_WITH_LONG_OFFSET,\n f: DATETIME_SHORT,\n ff: DATETIME_MED,\n fff: DATETIME_FULL,\n ffff: DATETIME_HUGE,\n F: DATETIME_SHORT_WITH_SECONDS,\n FF: DATETIME_MED_WITH_SECONDS,\n FFF: DATETIME_FULL_WITH_SECONDS,\n FFFF: DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nclass Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed, val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: false, val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed, val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n formatDateTime(dt, opts = {}) {\n const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n formatDateTimeParts(dt, opts = {}) {\n const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.formatToParts();\n }\n\n resolvedOptions(dt, opts = {}) {\n const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n\nclass Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n\n/**\n * @interface\n */\nclass Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n\nlet singleton$1 = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nclass SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton$1 === null) {\n singleton$1 = new SystemZone();\n }\n return singleton$1;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nclass IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nclass FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nclass InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n\n/**\n * @private\n */\n\nfunction normalizeZone(input, defaultZone) {\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && input.offset && typeof input.offset === \"number\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n throwOnInvalid;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nclass Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n const smaller = localeStr.substring(0, uIndex);\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n } catch (e) {\n options = getCachedDTF(smaller).resolvedOptions();\n }\n\n const { numberingSystem, calendar } = options;\n // return the smaller one so that we can append the calendar and numbering overrides to it\n return [smaller, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n localeStr += \"-u\";\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2016, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, defaultOK, englishFn, intlFn) {\n const mode = loc.listingMode(defaultOK);\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n\n let z;\n if (dt.zone.isUniversal) {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata.\n // So we have to make do. Two cases:\n // 1. The format options tell us to show the zone. We can't do that, so the best\n // we can do is format the date in UTC.\n // 2. The format options don't tell us to show the zone. Then we can adjust them\n // the time and tell the formatter to show it to us in UTC, so that the time is right\n // and the bad zone doesn't show up.\n z = \"UTC\";\n if (opts.timeZoneName) {\n this.dt = dt;\n } else {\n this.dt = dt.offset === 0 ? dt : DateTime.fromMillis(dt.ts + dt.offset * 60 * 1000);\n }\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else {\n this.dt = dt;\n z = dt.zone.name;\n }\n\n const intlOpts = { ...this.opts };\n if (z) {\n intlOpts.timeZone = z;\n }\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n return this.dtf.formatToParts(this.dt.toJSDate());\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\n/**\n * @private\n */\n\nclass Locale {\n static fromOpts(opts) {\n return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN);\n }\n\n static create(locale, numberingSystem, outputCalendar, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar);\n }\n\n constructor(locale, numbering, outputCalendar, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false, defaultOK = true) {\n return listStuff(this, length, defaultOK, months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false, defaultOK = true) {\n return listStuff(this, length, defaultOK, weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems(defaultOK = true) {\n return listStuff(\n this,\n undefined,\n defaultOK,\n () => meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length, defaultOK = true) {\n return listStuff(this, length, defaultOK, eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?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)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? weekdaysLong.indexOf(weekdayStr) + 1\n : weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(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)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^)]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(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$/,\n rfc850 =\n /^(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$/,\n ascii =\n /^(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})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nfunction parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nfunction parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nfunction parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nfunction parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nfunction parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nfunction parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n\nconst INVALID$2 = \"Invalid Duration\";\n\n// unit conversion constants\nconst lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits$1 = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits$1.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone$1(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction antiTrunc(n) {\n return n < 0 ? Math.floor(n) : Math.ceil(n);\n}\n\n// NB: mutates parameters\nfunction convert(matrix, fromMap, fromUnit, toMap, toUnit) {\n const conv = matrix[toUnit][fromUnit],\n raw = fromMap[fromUnit] / conv,\n sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]),\n // ok, so this is wild, but see the matrix in the tests\n added =\n !sameSign && toMap[toUnit] !== 0 && Math.abs(raw) <= 1 ? antiTrunc(raw) : Math.trunc(raw);\n toMap[toUnit] += added;\n fromMap[fromUnit] -= added * conv;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n reverseUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n convert(matrix, vals, previous, vals, current);\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nclass Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID$2;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat\n * @param opts - On option object to override the formatting. Accepts the same keys as the options parameter of the native `Int.NumberFormat` constructor, as well as `listStyle`.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n const l = orderedUnits$1\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n };\n\n const value = this.shiftTo(\"hours\", \"minutes\", \"seconds\", \"milliseconds\");\n\n let fmt = opts.format === \"basic\" ? \"hhmm\" : \"hh:mm\";\n\n if (!opts.suppressSeconds || value.seconds !== 0 || value.milliseconds !== 0) {\n fmt += opts.format === \"basic\" ? \"ss\" : \":ss\";\n if (!opts.suppressMilliseconds || value.milliseconds !== 0) {\n fmt += \".SSS\";\n }\n }\n\n let str = value.toFormat(fmt);\n\n if (opts.includePrefix) {\n str = \"T\" + str;\n }\n\n return str;\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n return this.as(\"milliseconds\");\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits$1) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone$1(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone$1(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone$1(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone$1(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone$1(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone$1(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits$1) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // plus anything further down the chain that should be rolled up in to this\n for (const down in vals) {\n if (orderedUnits$1.indexOf(down) > orderedUnits$1.indexOf(k)) {\n convert(this.matrix, vals, down, built, k);\n }\n }\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n return clone$1(this, { values: built }, true).normalize();\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone$1(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits$1) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n\nconst INVALID$1 = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nclass Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @return {number}\n */\n count(unit = \"milliseconds\") {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit),\n end = this.end.startOf(unit);\n return Math.floor(end.diff(start, unit).get(unit)) + 1;\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort(),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID$1;\n return `[${this.s.toISO()} ${this.e.toISO()})`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format string.\n * @param {string} dateFormat - the format string. This string formats the start and end time. See {@link DateTime#toFormat} for details.\n * @param {Object} opts - options\n * @param {string} [opts.separator = ' '] - a separator to place between the start and end representations\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" \" } = {}) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nclass Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * @example Info.features() //=> { relative: false }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative() };\n }\n}\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n let lowestOrder, highWater;\n\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n let delta = differ(cursor, later);\n highWater = cursor.plus({ [unit]: delta });\n\n if (highWater > later) {\n cursor = cursor.plus({ [unit]: delta - 1 });\n delta -= 1;\n } else {\n cursor = highWater;\n }\n\n results[unit] = delta;\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nfunction diff (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n\nconst numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nfunction parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nfunction digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\", false), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\", false), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true, false), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true, false), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false, false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false, false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false, false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false, false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true, false), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true, false), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, locale, formatOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n return {\n literal: true,\n val: value,\n };\n }\n\n const style = formatOpts[type];\n\n let val = partTypeStyleToTokenVal[type];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nfunction expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nfunction explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nfunction parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nfunction formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const parts = formatter.formatDateTimeParts(getDummyDateTime());\n return parts.map((p) => tokenForPart(p, locale, formatOpts));\n}\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nfunction dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\n/**\n * @private\n */\n\nfunction gregorianToWeek(gregObj) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = dayOfWeek(year, month, day);\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear);\n } else if (weekNumber > weeksInWeekYear(year)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nfunction weekToGregorian(weekData) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = dayOfWeek(weekYear, 1, 4),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nfunction gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nfunction ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\nfunction hasInvalidWeekData(obj) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.week);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nfunction hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nfunction hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nfunction hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if (parsed && Object.keys(parsed).length !== 0) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nclass DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n normalized = normalizeObject(obj, normalizeUnit),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber,\n loc = Locale.fromObject(opts);\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {DateTime} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnit),\n settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian({ ...gregorianToWeek(this.c), ...normalized });\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit) {\n if (!this.isValid) return this;\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n o.weekday = 1;\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit);\n }\n\n /**\n * Equality check\n * Two DateTimes are equal iff they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nfunction friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n\nconst VERSION = \"3.1.0\";\n\nexport { DateTime, Duration, FixedOffsetZone, IANAZone, Info, Interval, InvalidZone, Settings, SystemZone, VERSION, Zone };\n//# sourceMappingURL=luxon.js.map\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n__webpack_require__(\"./server/scripts/modules/currentweatherscroll.mjs\");\n// This entry module is referenced by other modules so it can't be inlined\n__webpack_require__(\"./server/scripts/modules/currentweather.mjs\");\n__webpack_require__(\"./server/scripts/modules/almanac.mjs\");\n__webpack_require__(\"./server/scripts/modules/icons.mjs\");\n__webpack_require__(\"./server/scripts/modules/extendedforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/hourly.mjs\");\n__webpack_require__(\"./server/scripts/modules/latestobservations.mjs\");\n__webpack_require__(\"./server/scripts/modules/localforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/radar.mjs\");\n__webpack_require__(\"./server/scripts/modules/regionalforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/travelforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/progress.mjs\");\nvar __webpack_exports__ = __webpack_require__(\"./server/scripts/index.mjs\");\n"],"names":["document","addEventListener","init","overrides","AutoSelectQuery","FullScreenOverride","cats","join","getElementById","e","target","select","registerRefreshData","LoadTwcData","btnNavigateMenuClick","btnNavigateRefreshClick","btnNavigateNextClick","btnNavigatePreviousClick","btnNavigatePlayClick","btnFullScreenClick","btnGetGpsClick","fullscreenElement","UpdateFullScreenNavigate","documentKeydown","preventDefault","$","devbridgeAutocomplete","serviceUrl","deferRequestBy","paramName","params","f","countryCode","category","maxSuggestions","dataType","transformResult","response","window","setTimeout","ac","suggestionsContainer","children","click","suggestions","map","i","value","text","data","magicKey","minChars","showNoSuggestionNotice","noSuggestionNotice","onSelect","suggestion","autocompleteOnSelect","this","width","on","TwcQuery","localStorage","getItem","txtAddress","blur","focus","TwcPlay","postMessage","innerHTML","removeItem","checked","swipeCallBack","async","elem","previousSuggestionValue","doRedirectToGeometry","loc","json","locations","feature","geometry","console","error","geom","latLon","lat","Math","round2","y","lon","x","setItem","ExitFullscreen","EnterFullScreen","isPlaying","element","requestMethod","requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen","call","navigationUI","scrollTo","resize","title","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","_latLon","stopAutoRefreshTimer","latLonReceived","direction","resetStatuses","NavigateFadeIntervalId","activeElement","classList","remove","add","clearTimeout","code","keyCode","which","Date","now","lastButton","body","decimals","Number","round","type","myMessage","message","navigator","geolocation","position","Promise","resolve","getCurrentPosition","latitude","longitude","coords","location","distance","status","responseJSONe","ZipCode","address","Postal","City","states","getTwoDigitCode","Region","CountryCode","Almanac","constructor","navId","elemId","super","backgroundImage0","loadImg","preloadImg","timing","totalScreens","_weatherParameters","getData","weatherParameters","sun","moon","calcSunMoonData","setStatus","getDataCallback","SunCalc","getTimes","DateTime","plus","days","toJSDate","moonDate","minus","phase","getMoonIllumination","iterations","lastPhase","push","getMoonTransition","length","threshold","phaseName","start","iteration","step","hours","minutes","seconds","milliseconds","test","testPhase","date","drawCanvas","info","Today","Tomorrow","querySelector","toLocaleString","weekday","sunrise","toLowerCase","sunset","MoonPhase","fill","month","day","icon","src","imageName","Phase","fillTemplate","daysContainer","append","finishDraw","static","getDataCallbacks","display","registerDisplay","getSun","bind","CurrentWeather","backgroundImage","observations","station","stationNum","stations","id","cors","limit","features","properties","temperature","windSpeed","textDescription","undefined","Error","stationIdentifier","getWeatherIconFromIconLink","parseData","Temperature","TemperatureUnit","DewPoint","dewpoint","Ceiling","cloudLayers","base","CeilingUnit","Visibility","visibility","VisibilityUnit","WindSpeed","WindDirection","directionToNSEW","windDirection","Pressure","barometricPressure","HeatIndex","heatIndex","WindChill","windChill","WindGust","windGust","WindUnit","Humidity","relativeHumidity","Icon","PressureDirection","TextConditions","pressureDiff","celsiusToFahrenheit","metersToFeet","kilometersToMiles","kphToMph","pascalToInHg","toFixed","temp","String","fromCharCode","Conditions","shortConditions","condition","wind","padEnd","toString","padStart","locationCleanup","name","substr","humidity","ceiling","pressure","area","_condition","replace","getCurrentWeather","degree","interval","screenIndex","incrementInterval","currentDisplay","okToDrawCurrentConditions","screens","drawScreen","drawCondition","elemForEach","setInterval","ExtendedForecast","forecast","units","responseJSON","parse","periods","fullForecast","dates","shift","startOf","destIndex","forEach","period","dayName","low","high","fDay","shortenExtendedForecastText","shortForecast","isDaytime","long","short","reduce","working","regex","conditions","split","indexOf","short1","short2","endsWith","result","slice","Day","dayContainer","Hourly","defaultActive","baseDelay","delay","forecastGridData","parseForecast","drawLongCanvas","expand","values","apparentTemperature","skyCover","weather","iceAccumulation","probabilityOfPrecipitation","snowfallAmount","icons","determineIcon","val","idx","startOfHour","sunTimes","overnight","Interval","tomorrowOvernight","hour","isNight","contains","getHourlyIcon","toMillis","item","startTime","validTime","endTime","Duration","shiftTo","list","startingHour","lines","index","fillValues","formattedHour","feelsLike","like","Array","showCanvas","screenIndexChange","baseCountChange","navBaseCount","count","offsetY","min","getBoundingClientRect","height","cities","city","getWeatherRegionalIconFromIconLink","link","_isNightTime","isNightTime","addPath","conditionName","match","log","thunder","snow","ice","fog","phenomenon","includes","LatestObservations","MaximumRegionalStations","regionalStations","Object","keys","StationInfo","key","sort","a","b","actualConditions","all","StationId","filter","sortedConditions","Name","shortenCurrentConditions","linesContainer","LocalForecast","rawData","getRawData","screenTexts","DayName","toUpperCase","Text","templates","forecastsElem","pageHeight","parentNode","newHeight","ceil","scrollHeight","style","calcNavTiming","top","detailedForecast","displays","progress","playing","AUTO_REFRESH_TIME_MS","AutoRefreshIntervalId","AutoRefreshCountMs","TwcAutoRefresh","autoRefreshChange","generateCheckboxes","handleNavButton","updateStatus","countLoadedCanvases","navTo","msg","command","firstFrame","AssignLastUpdate","acc","hideAllCanvases","hideCanvas","previous","Symbol","inProgress","next","previousFrame","nextFrame","lastFrame","displayNavMessage","loadDisplay","current","navNext","navPrev","firstDisplay","displayCount","totalDisplays","curIdx","currentDisplayIndex","wrap","refreshCheck","newDisplay","findIndex","isActive","setPlaying","newValue","playButton","button","getDisplay","widthZoomPercent","innerWidth","heightZoomPercent","innerHeight","scale","zoom","availableDisplays","checkboxes","d","generateCheckbox","registerProgress","_progress","populateWeatherParameters","state","stationId","radarId","zoneId","startAutoRefreshTimer","year","minute","second","timeZoneName","point","getPoint","observationStations","relativeLocation","forecastZone","radarStation","weatherOffice","cwa","timeZone","getWeather","AutoRefreshTimer","RemainingMs","dt","getMinutes","getSeconds","loadTwcData","clearInterval","callback","Progress","version","lineClick","loadedCount","progressCover","statusClass","line","links","dataset","container","loadedPercent","indexRaw","Radar","okToDrawCurrentDateTime","dopplerRadarImageMax","time","si","State","baseMap","baseUrls","toFormat","pngs","url","html","htmlIdx","xmlDoc","DOMParser","parseFromString","createElement","href","head","anchors","getElementsByTagName","urls","from","flat","offsetX","sourceXY","getXYFromLatitudeLongitudeMap","workingCanvas","workingContext","getContext","imageSmoothingEnabled","radarSourceXY","getXYFromLatitudeLongitudeDoppler","radarSourceX","radarSourceY","radarInfo","canvas","context","fetch","rewriteUrl","ok","statusText","blob","timeMatch","zone","setZone","headers","get","imgBlob","clearRect","drawImage","cropCanvas","cropContext","willReadFrequently","removeDopplerRadarImageNoise","mergeDopplerRadarImage","toDataURL","scrollArea","r","radar","times","timePadded","pos","RadarContext","RadarImageData","getImageData","R","G","B","A","putImageData","mapContext","radarContext","mapImageData","radarImageData","RegionalForecast","offsetXY","getXYFromLatitudeLongitude","minMaxLatLon","getMinMaxLatitudeLongitude","targetDistance","stationInfoArray","combinedCities","RegionalCities","regionalCities","minLat","maxLat","minLon","maxLon","targetDist","testCity","regionalData","observationPromise","getRegionalObservation","wfo","cityXY","getXYForCity","observation","regionalObservation","daytime","formatCity","buildForecast","Latitude","Longitude","OffsetX","OffsetY","getXYFromLatitudeLongitudeAK","getXYFromLatitudeLongitudeHI","X","Y","getMinMaxLatitudeLongitudeAK","getMinMaxLatitudeLongitudeHI","MaxLatitude","MinLongitude","getXYForCityAK","getXYForCityHI","titleTop","titleBottom","left","locationContainer","loading","loaded","failed","noData","disabled","TravelForecast","pagesFloat","TravelCities","pages","floor","extra","cityHeight","forecastPromises","todayShift","today","forecasts","lowString","highString","getTravelCitiesDayName","getLongCanvas","longCanvas","T","TD","exp","RelativeHumidity","RH","ADJUSTMENT","HI","sqrt","abs","V","Direction","x1","y1","x2","y2","m","_url","selector","querySelectorAll","fetchAsync","raw","responseType","_params","method","mode","corsUrl","URL","origin","protocol","hostname","searchParams","imgData","img","Image","onload","Blob","createObjectURL","cachedImages","wakeLock","noSleep","enable","controller","NoSleep","disable","input","Kph","Celsius","Kilometers","Meters","Pascal","defaultEnabled","gifs","loadingStatus","storeElemId","enabled","startNavCount","loadTemplates","savedStatus","checkbox","content","firstChild","checkboxChange","fxn","drawCurrentDateTime","dateTimeInterval","lastTime","lastDate","navCmd","resetNavBaseCount","offsetHeight","isEnabled","navBaseTime","updateScreenFromBaseCount","nextScreenIndex","screenIndexFromBaseCount","sendNavDisplayMessage","isArray","intermediateDelay","sum","fullDelay","calc","screenIndexes","newBaseCount","find","timingIndex","navInterval","template","className","node","cloneNode","templateNode","entries","LuxonError","InvalidDateTimeError","reason","toMessage","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","n","s","l","DATE_SHORT","DATE_MED","DATE_MED_WITH_WEEKDAY","DATE_FULL","DATE_HUGE","TIME_SIMPLE","TIME_WITH_SECONDS","TIME_WITH_SHORT_OFFSET","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","isUndefined","o","isNumber","isInteger","hasRelative","Intl","RelativeTimeFormat","bestBy","arr","by","compare","best","pair","hasOwnProperty","obj","prop","prototype","integerBetween","thing","bottom","padded","parseInteger","string","parseInt","parseFloating","parseFloat","parseMillis","fraction","roundTo","number","digits","towardZero","factor","trunc","isLeapYear","daysInYear","daysInMonth","modMonth","floorMod","objToLocalTS","UTC","millisecond","setUTCFullYear","getUTCFullYear","weeksInWeekYear","weekYear","p1","last","p2","untruncateYear","parseZoneInfo","ts","offsetFormat","locale","intlOpts","modified","parsed","DateTimeFormat","formatToParts","signedOffset","offHourStr","offMinuteStr","offHour","isNaN","offMin","is","asNumber","numericValue","normalizeObject","normalizer","normalized","u","v","formatOffset","offset","format","sign","RangeError","timeObject","k","pick","ianaRegex","monthsLong","monthsShort","monthsNarrow","months","weekdaysLong","weekdaysShort","weekdaysNarrow","weekdays","meridiems","erasLong","erasShort","erasNarrow","eras","stringifyTokens","splits","tokenToString","token","literal","macroTokenToFormatOpts","D","DD","DDD","DDDD","t","tt","ttt","tttt","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","opts","fmt","currentFull","bracketed","c","charAt","formatOpts","systemLoc","formatWithSystemDefault","redefaultToSystem","dtFormatter","formatDateTime","formatDateTimeParts","resolvedOptions","num","p","forceSimple","padTo","numberFormatter","formatDateTimeFromString","knownEnglish","listingMode","useDateTimeFormatter","outputCalendar","extract","isOffsetFixed","allowZ","isValid","meridiem","meridiemForDateTime","standalone","monthForDateTime","weekdayForDateTime","maybeMacro","era","eraForDateTime","parseFormat","offsetName","zoneName","weekNumber","ordinal","quarter","formatDurationFromString","dur","tokenToField","tokens","realTokens","found","concat","lildur","mapped","Invalid","explanation","Zone","ianaName","isUniversal","equals","otherZone","singleton$1","SystemZone","instance","getTimezoneOffset","dtfCache","typeToPos","ianaZoneCache","IANAZone","isValidZone","valid","NaN","dtf","hour12","adOrBc","formatted","filled","partsOffset","exec","fMonth","fYear","fadOrBc","fHour","fMinute","fSecond","hackyOffset","asTS","over","singleton","FixedOffsetZone","utcInstance","fixed","InvalidZone","normalizeZone","defaultZone","lowered","parseSpecifier","create","throwOnInvalid","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","Settings","numberingSystem","Locale","resetCache","intlLFCache","intlDTCache","getCachedDTF","locString","JSON","stringify","intlNumCache","intlRelCache","sysLocaleCache","listStuff","defaultOK","englishFn","intlFn","PolyNumberFormatter","intl","otherOpts","useGrouping","minimumIntegerDigits","inf","NumberFormat","getCachedINF","PolyDateFormatter","z","gmtOffset","offsetZ","fromMillis","PolyRelFormatter","isEnglish","rtf","cacheKeyOpts","getCachedRTF","numeric","narrow","years","quarters","weeks","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","formatRelativeTime","defaultToEN","specifiedLocale","localeR","numberingSystemR","outputCalendarR","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","localeStr","uIndex","options","smaller","substring","calendar","parseLocaleString","intlConfigString","weekdaysCache","monthsCache","meridiemCache","eraCache","fastNumbersCached","fastNumbers","startsWith","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","formatStr","ms","utc","mapMonths","mapWeekdays","field","matching","relFormatter","listFormatter","ListFormat","getCachedLF","other","combineRegexes","regexes","full","source","RegExp","combineExtractors","extractors","mergedVals","mergedZone","cursor","ex","patterns","extractor","simpleParse","ret","offsetRegex","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","extractISOWeekData","extractISOOrdinalData","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOTime","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","rfc2822","extractRFC2822","obsOffset","milOffset","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","extractISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits$1","reverseUnits","reverse","clone$1","clear","conf","conversionAccuracy","matrix","convert","fromMap","fromUnit","toMap","toUnit","conv","added","antiTrunc","config","accurate","invalid","isLuxonDuration","fromObject","normalizeUnit","durationLike","isDuration","parseISODuration","parseISOTimeOnly","week","fmtOpts","toHuman","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","suppressMilliseconds","suppressSeconds","includePrefix","str","toJSON","as","valueOf","duration","fromDurationLike","negate","mapUnits","fn","set","reconfigure","normalize","vals","normalizeValues","rescale","newVals","removeZeroes","shiftToAll","built","accumulated","lastUnit","own","ak","down","negated","invalidReason","invalidExplanation","v1","v2","INVALID$1","end","isLuxonInterval","builtStart","friendlyDateTime","builtEnd","validateError","validateStartEnd","fromDateTimes","startIsValid","endIsValid","fromISO","after","before","toDuration","diff","hasSame","isEmpty","isAfter","dateTime","isBefore","splitAt","dateTimes","sorted","results","splitBy","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","intervals","final","sofar","currentCount","ends","merge","difference","xor","toISODate","dateFormat","separator","mapEndpoints","mapFn","Info","proto","locObj","relative","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highWater","lowestOrder","differs","differ","delta","highOrderDiffs","remainingMillis","lowerOrderUnits","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","digitRegex","intUnit","post","deser","charCodeAt","search","max","parseDigits","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","partTypeStyleToTokenVal","dayperiod","dayPeriod","dummyDateTimeCache","expandMacroTokens","formatOptsToTokens","maybeExpandMacroToken","explainFromTokens","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","unitForToken","disqualifyingUnit","regexString","handlers","buildRegex","rawMatches","matches","matchIndex","specificOffset","Z","q","M","S","toField","dateTimeFromMatches","part","tokenForPart","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","js","getUTCDay","computeOrdinal","uncomputeOrdinal","table","month0","gregorianToWeek","gregObj","weekToGregorian","weekData","weekdayOfJan4","yearInDays","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","hasInvalidGregorianData","validYear","validMonth","validDay","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","INVALID","MAX_DATE","unsupportedZone","possiblyCachedWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","longFormat","includeOffset","extendedZone","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedUnits","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","quickDT","tsNow","offsetProvis","diffRelative","calendary","lastOpts","argList","args","ot","_zone","isLuxonDateTime","arguments","zoneToUse","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","validWeek","validWeekday","hasInvalidWeekData","validOrdinal","hasInvalidOrdinalData","gregorian","tsFinal","offsetFinal","parseISODate","trim","preprocessRFC2822","parseRFC2822Date","parseHTTPDate","localeToUse","fromOpts","parseFromTokens","fromFormat","parseSQL","localeOpts","tokenList","monthShort","monthLong","weekdayShort","weekdayLong","offsetNameShort","offsetNameLong","isInDST","isInLeapYear","resolvedLocaleOptions","toLocal","keepCalendarTime","newTS","offsetGuess","asObj","setLocale","settingWeekStuff","mixed","normalizedUnit","endOf","toLocaleParts","ext","toISOWeekDate","toRFC2822","toHTTP","toSQLDate","toSQLTime","includeZone","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","isDateTime","fromFormatExplain","dateTimeish","fromJSDate","VERSION","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","definition","defineProperty","enumerable","toStringTag"],"sourceRoot":""}