Files
nextcloud-server/dist/weather_status-weather-status.js
nextcloud-command 78098c8325 chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-04-01 13:41:02 +00:00

2 lines
36 KiB
JavaScript

(()=>{"use strict";var e,r,a,s={87171(e,r,a){var s=a(21777),n=a(85471);const u='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-star-outline" viewBox="0 0 24 24"><path d="M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z" /></svg>';var i=a(11459),o=a(85168),h=a(53334),l=a(51651),d=a(63814),w=a(57505),p=a(61744),m=a(44131),c=a(57908),g=a(24764),_=a(15502),y=a(71711),v=a(6695),f=a(88289);const A=(0,a(35947).YK)().detectLogLevel().setApp("weather_status").build();var x=a(19051);async function T(t){const e=(0,d.KT)("apps/weather_status/api/v1/favorites");return(await x.Ay.put(e,{favorites:t})).data.ocs.data}const b={clearsky_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} clear sky later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} clear sky",{temperature:e,unit:r})},clearsky_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} clear sky later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} clear sky",{temperature:e,unit:r})},cloudy:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} cloudy later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} cloudy",{temperature:e,unit:r})},snowandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow and thunder",{temperature:e,unit:r})},snowshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow showers and thunder",{temperature:e,unit:r})},snowshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow showers and thunder",{temperature:e,unit:r})},snowshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow showers, thunder and polar twilight",{temperature:e,unit:r})},snowshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow showers",{temperature:e,unit:r})},snowshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow showers",{temperature:e,unit:r})},snowshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow showers and polar twilight",{temperature:e,unit:r})},snow:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} snow later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} snow",{temperature:e,unit:r})},fair_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} fair weather later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} fair weather",{temperature:e,unit:r})},fair_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} fair weather later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} fair weather",{temperature:e,unit:r})},partlycloudy_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} partly cloudy later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} partly cloudy",{temperature:e,unit:r})},partlycloudy_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} partly cloudy later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} partly cloudy",{temperature:e,unit:r})},fog:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} foggy later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} foggy",{temperature:e,unit:r})},lightrain:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rainfall later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rainfall",{temperature:e,unit:r})},rain:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rainfall later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rainfall",{temperature:e,unit:r})},heavyrain:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rainfall later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rainfall",{temperature:e,unit:r})},rainshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rainfall showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rainfall showers",{temperature:e,unit:r})},rainshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rainfall showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rainfall showers",{temperature:e,unit:r})},lightrainshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rainfall showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rainfall showers",{temperature:e,unit:r})},lightrainshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rainfall showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rainfall showers",{temperature:e,unit:r})},heavyrainshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rainfall showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rainfall showers",{temperature:e,unit:r})},heavyrainshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rainfall showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rainfall showers",{temperature:e,unit:r})},clearsky_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} clear sky and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} clear sky and polar twilight",{temperature:e,unit:r})},fair_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} fair weather and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} fair weather and polar twilight",{temperature:e,unit:r})},partlycloudy_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} partly cloudy and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} partly cloudy and polar twilight",{temperature:e,unit:r})},lightrainandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rain and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rain and thunder",{temperature:e,unit:r})},rainandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rain and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rain and thunder",{temperature:e,unit:r})},heavyrainandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rain and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rain and thunder",{temperature:e,unit:r})},lightrainshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rainfall showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rainfall showers and thunder",{temperature:e,unit:r})},lightrainshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rainfall showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rainfall showers and thunder",{temperature:e,unit:r})},lightrainshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rainfall showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rainfall showers, thunder and polar twilight",{temperature:e,unit:r})},rainshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rainfall showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rainfall showers and thunder",{temperature:e,unit:r})},rainshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rainfall showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rainfall showers and thunder",{temperature:e,unit:r})},rainshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rainfall showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rainfall showers, thunder and polar twilight",{temperature:e,unit:r})},heavyrainshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rainfall showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rainfall showers and thunder",{temperature:e,unit:r})},heavyrainshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rainfall showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rainfall showers and thunder",{temperature:e,unit:r})},heavyrainshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rainfall showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rainfall showers, thunder and polar twilight",{temperature:e,unit:r})},lightrainshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light rainfall showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light rainfall showers and polar twilight",{temperature:e,unit:r})},rainshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} rainfall showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} rainfall showers and polar twilight",{temperature:e,unit:r})},heavyrainshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy rainfall showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy rainfall showers and polar twilight",{temperature:e,unit:r})},lightsleet:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet",{temperature:e,unit:r})},sleet:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet",{temperature:e,unit:r})},heavysleet:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet",{temperature:e,unit:r})},lightsleetandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet and thunder",{temperature:e,unit:r})},sleetandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet and thunder",{temperature:e,unit:r})},heavysleetandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet and thunder",{temperature:e,unit:r})},lightsleetshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet showers",{temperature:e,unit:r})},lightsleetshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet showers",{temperature:e,unit:r})},lightsleetshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet showers and polar twilight",{temperature:e,unit:r})},sleetshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet showers",{temperature:e,unit:r})},sleetshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet showers",{temperature:e,unit:r})},sleetshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet showers and polar twilight",{temperature:e,unit:r})},heavysleetshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet showers",{temperature:e,unit:r})},heavysleetshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet showers",{temperature:e,unit:r})},heavysleetshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet showers and polar twilight",{temperature:e,unit:r})},lightssleetshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet showers and thunder",{temperature:e,unit:r})},lightssleetshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet showers and thunder",{temperature:e,unit:r})},lightssleetshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light sleet showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light sleet showers, thunder and polar twilight",{temperature:e,unit:r})},sleetshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet showers and thunder",{temperature:e,unit:r})},sleetshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet showers and thunder",{temperature:e,unit:r})},sleetshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} sleet showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} sleet showers, thunder and polar twilight",{temperature:e,unit:r})},heavysleetshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet showers and thunder",{temperature:e,unit:r})},heavysleetshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet showers and thunder",{temperature:e,unit:r})},heavysleetshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy sleet showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy sleet showers, thunder and polar twilight",{temperature:e,unit:r})},lightsnow:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow",{temperature:e,unit:r})},heavysnow:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow",{temperature:e,unit:r})},lightsnowandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow and thunder",{temperature:e,unit:r})},heavysnowandthunder:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow and thunder",{temperature:e,unit:r})},lightsnowshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow showers",{temperature:e,unit:r})},lightsnowshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow showers",{temperature:e,unit:r})},lightsnowshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow showers and polar twilight",{temperature:e,unit:r})},heavysnowshowers_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow showers",{temperature:e,unit:r})},heavysnowshowers_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow showers later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow showers",{temperature:e,unit:r})},heavysnowshowers_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow showers and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow showers and polar twilight",{temperature:e,unit:r})},lightssnowshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow showers and thunder",{temperature:e,unit:r})},lightssnowshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow showers and thunder",{temperature:e,unit:r})},lightssnowshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} light snow showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} light snow showers, thunder and polar twilight",{temperature:e,unit:r})},heavysnowshowersandthunder_day:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow showers and thunder",{temperature:e,unit:r})},heavysnowshowersandthunder_night:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow showers and thunder later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow showers and thunder",{temperature:e,unit:r})},heavysnowshowersandthunder_polartwilight:{text:(e,r,a=!1)=>a?t("weather_status","{temperature} {unit} heavy snow showers, thunder and polar twilight later today",{temperature:e,unit:r}):t("weather_status","{temperature} {unit} heavy snow showers, thunder and polar twilight",{temperature:e,unit:r})}},M={name:"App",components:{NcActions:g.A,NcActionButton:w.A,NcActionCaption:p.A,NcActionInput:m.A,NcActionLink:c.A,NcActionSeparator:_.A,NcActionText:y.A,NcLoadingIcon:f.A,NcIconSvgWrapper:v.A},data:()=>({crosshairsSvg:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-crosshairs" viewBox="0 0 24 24"><path d="M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z" /></svg>',mapMarkerSvg:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-map-marker" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z" /></svg>',starSvg:i,starOutlineSvg:u,locale:(0,h.JK)(),loading:!0,errorMessage:"",mode:1,address:null,lat:null,lon:null,offset:5,forecasts:[],loop:null,favorites:[]}),computed:{useFahrenheitLocale(){return["en_US","en_MH","en_FM","en_PW","en_KY","en_LR"].includes(this.locale)},temperatureUnit(){return this.useFahrenheitLocale?"°F":"°C"},locationText(){return t("weather_status","More weather for {adr}",{adr:this.address})},temperature(){return this.getTemperature(this.forecasts,0)},futureTemperature(){return this.getTemperature(this.forecasts,this.offset)},weatherCode(){return this.getWeatherCode(this.forecasts,0)},futureWeatherCode(){return this.getWeatherCode(this.forecasts,this.offset)},weatherIconUrl(){return this.getWeatherIconUrl(this.weatherCode)},futureWeatherIconUrl(){return this.getWeatherIconUrl(this.futureWeatherCode)},currentWeatherMessage(){return this.loading?t("weather_status","Loading weather"):this.errorMessage?this.errorMessage:this.gotWeather?this.getWeatherMessage(this.weatherCode,this.temperature):t("weather_status","Set location for weather")},forecastMessage(){return this.loading?t("weather_status","Loading weather"):this.gotWeather?this.getWeatherMessage(this.futureWeatherCode,this.futureTemperature,!0):t("weather_status","Set location for weather")},weatherLinkTarget(){return"https://www.windy.com/-Rain-thunder-rain?rain,"+this.lat+","+this.lon+",11"},gotWeather(){return this.address&&!this.errorMessage},addRemoveFavoriteSvg(){return this.currentAddressIsFavorite?i:u},addRemoveFavoriteText(){return this.currentAddressIsFavorite?t("weather_status","Remove from favorites"):t("weather_status","Add as favorite")},currentAddressIsFavorite(){return this.favorites.find(t=>t===this.address)}},mounted(){this.initWeatherStatus()},methods:{async initWeatherStatus(){try{const t=await async function(){const t=(0,d.KT)("apps/weather_status/api/v1/location");return(await x.Ay.get(t)).data.ocs.data}();this.lat=t.lat,this.lon=t.lon,this.address=t.address,this.mode=t.mode,1===this.mode?this.askBrowserLocation():2===this.mode&&this.startLoop();const e=await async function(){const t=(0,d.KT)("apps/weather_status/api/v1/favorites");return(await x.Ay.get(t)).data.ocs.data}();this.favorites=e}catch(e){if("ECONNABORTED"===e?.code)return void A.info("The weather status request was cancelled because the user navigates.");e.response&&401===e.response.status?(0,o.Qg)(t("weather_status","You are not logged in.")):(0,o.Qg)(t("weather_status","There was an error getting the weather status information.")),A.error(e)}},startLoop(){clearInterval(this.loop),this.lat&&this.lon?(this.loop=setInterval(()=>this.getForecast(),36e5),this.getForecast()):this.loading=!1},askBrowserLocation(){this.loading=!0,this.errorMessage="",navigator.geolocation&&window.isSecureContext?navigator.geolocation.getCurrentPosition(t=>{A.debug("browser location success"),this.lat=t.coords.latitude,this.lon=t.coords.longitude,this.saveMode(1),this.mode=1,this.saveLocation(this.lat,this.lon)},t=>{A.debug("location permission refused"),A.debug(t),this.saveMode(2),this.mode=2,this.lat&&this.lon?this.startLoop():this.usePersonalAddress()}):(A.debug("no secure context!"),this.saveMode(2),this.mode=2,this.startLoop())},async getForecast(){try{this.forecasts=await async function(){const t=(0,d.KT)("apps/weather_status/api/v1/forecast");return(await x.Ay.get(t)).data.ocs.data}()}catch(e){this.errorMessage=t("weather_status","No weather information found"),A.debug(e)}this.loading=!1},async setAddress(e){this.loading=!0,this.errorMessage="";try{const r=await async function(t){const e=(0,d.KT)("apps/weather_status/api/v1/location");return(await x.Ay.put(e,{address:t,lat:null,lon:null})).data.ocs.data}(e);r.success?(this.lat=r.lat,this.lon=r.lon,this.address=r.address,this.mode=2,this.startLoop()):(this.errorMessage=t("weather_status","Location not found"),this.loading=!1)}catch(e){e.response&&401===e.response.status?(0,o.Qg)(t("weather_status","You are not logged in.")):(0,o.Qg)(t("weather_status","There was an error setting the location address.")),this.loading=!1}},async saveLocation(e,r){try{const t=await async function(t,e){const r=(0,d.KT)("apps/weather_status/api/v1/location");return(await x.Ay.put(r,{address:"",lat:t,lon:e})).data.ocs.data}(e,r);this.address=t.address,this.startLoop()}catch(e){e.response&&401===e.response.status?(0,o.Qg)(t("weather_status","You are not logged in.")):(0,o.Qg)(t("weather_status","There was an error setting the location.")),A.debug(e)}},async saveMode(e){try{await async function(t){const e=(0,d.KT)("apps/weather_status/api/v1/mode");return(await x.Ay.put(e,{mode:t})).data.ocs.data}(e)}catch(e){e.response&&401===e.response.status?(0,o.Qg)(t("weather_status","You are not logged in.")):(0,o.Qg)(t("weather_status","There was an error saving the mode.")),A.debug(e)}},onBrowserLocationClick(){this.askBrowserLocation()},async usePersonalAddress(){this.loading=!0;try{const t=await async function(){const t=(0,d.KT)("apps/weather_status/api/v1/use-personal");return(await x.Ay.put(t)).data.ocs.data}();this.lat=t.lat,this.lon=t.lon,this.address=t.address,this.mode=2,this.startLoop()}catch(e){e.response&&401===e.response.status?(0,o.Qg)(t("weather_status","You are not logged in.")):(0,o.Qg)(t("weather_status","There was an error using personal address.")),A.debug(e),this.loading=!1}},onAddressSubmit(){const t=this.$refs.addressInput.$el.querySelector('input[type="text"]').value;this.setAddress(t)},getLocalizedTemperature(t){return this.useFahrenheitLocale?1.8*t+32:t},onAddRemoveFavoriteClick(){const t=this.currentAddressIsFavorite;if(t){const e=this.favorites.indexOf(t);-1!==e&&this.favorites.splice(e,1)}else this.favorites.push(this.address);T(this.favorites)},onFavoriteClick(t,e){if(t.target.classList.contains("action-button__icon")){const t=this.favorites.indexOf(e);-1!==t&&this.favorites.splice(t,1),T(this.favorites)}else e!==this.address&&this.setAddress(e)},formatTime:t=>(0,l.A)(t).format("LT"),getTemperature:(t,e=0)=>t.length>e?t[e].data.instant.details.air_temperature:"",getWeatherCode:(t,e=0)=>t.length>e?t[e].data.next_1_hours.summary.symbol_code:"",getWeatherIconUrl:t=>t&&t in b?(0,d.d0)("weather_status","met.no.icons/"+t+".svg"):(0,d.d0)("weather_status","met.no.icons/fair_day.svg"),getWeatherMessage(e,r,a=!1){return e&&e in b?b[e].text(Math.round(this.getLocalizedTemperature(r)),this.temperatureUnit,a):t("weather_status","Unknown weather code")}}};var C=a(85072),L=a.n(C),N=a(97825),k=a.n(N),S=a(77659),I=a.n(S),W=a(55056),D=a.n(W),E=a(10540),O=a.n(E),B=a(41113),F=a.n(B),j=a(19254),Q={};Q.styleTagTransform=F(),Q.setAttributes=D(),Q.insert=I().bind(null,"head"),Q.domAPI=k(),Q.insertStyleElement=O(),L()(j.A,Q),j.A&&j.A.locals&&j.A.locals;const H=(0,a(14486).A)(M,function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"weather-status-menu-item"}},[e("NcActions",{staticClass:"weather-status-menu-item__subheader",attrs:{"aria-label":t.currentWeatherMessage,"menu-name":t.currentWeatherMessage},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("img",{staticClass:"weather-image",attrs:{src:t.weatherIconUrl,alt:""}})]},proxy:!0}])},[t._v(" "),t.gotWeather?e("NcActionText",{scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("div",{staticClass:"weather-action-image-container"},[e("img",{staticClass:"weather-image",attrs:{src:t.futureWeatherIconUrl,alt:""}})])]},proxy:!0}],null,!1,1876957744)},[t._v("\n\t\t\t"+t._s(t.forecastMessage)+"\n\t\t")]):t._e(),t._v(" "),t.gotWeather?e("NcActionLink",{attrs:{target:"_blank",href:t.weatherLinkTarget,"close-after-click":!0},scopedSlots:t._u([{key:"icon",fn:function(){return[e("NcIconSvgWrapper",{attrs:{name:"MapMarker",svg:t.mapMarkerSvg,size:20}})]},proxy:!0}],null,!1,2374361976)},[t._v("\n\t\t\t"+t._s(t.locationText)+"\n\t\t")]):t._e(),t._v(" "),t.gotWeather?e("NcActionButton",{on:{click:t.onAddRemoveFavoriteClick},scopedSlots:t._u([{key:"icon",fn:function(){return[e("NcIconSvgWrapper",{staticClass:"favorite-color",attrs:{name:"Star",svg:t.addRemoveFavoriteSvg,size:20}})]},proxy:!0}],null,!1,2760308411)},[t._v("\n\t\t\t"+t._s(t.addRemoveFavoriteText)+"\n\t\t")]):t._e(),t._v(" "),t.address&&!t.errorMessage?e("NcActionSeparator"):t._e(),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:t.onBrowserLocationClick},scopedSlots:t._u([{key:"icon",fn:function(){return[e("NcIconSvgWrapper",{attrs:{name:"Crosshairs",svg:t.crosshairsSvg,size:20}})]},proxy:!0}])},[t._v("\n\t\t\t"+t._s(t.t("weather_status","Detect location"))+"\n\t\t")]),t._v(" "),e("NcActionInput",{ref:"addressInput",attrs:{label:t.t("weather_status","Set custom address"),disabled:!1,icon:"icon-rename",type:"text","model-value":""},on:{submit:t.onAddressSubmit}}),t._v(" "),t.favorites.length>0?[e("NcActionCaption",{attrs:{name:t.t("weather_status","Favorites")}}),t._v(" "),t._l(t.favorites,function(r){return e("NcActionButton",{key:r,on:{click:function(e){return t.onFavoriteClick(e,r)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("NcIconSvgWrapper",{class:{"favorite-color":t.address===r},attrs:{name:"Star",svg:t.starSvg,size:20}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t"+t._s(r)+"\n\t\t\t")])})]:t._e()],2)],1)},[],!1,null,null,null).exports;a.nc=(0,s.aV)(),n.Ay.prototype.t=t,document.addEventListener("DOMContentLoaded",function(){OCA.Dashboard&&OCA.Dashboard.registerStatus("weather",t=>(new(n.Ay.extend(H))).$mount(t))})},19254(t,e,r){r.d(e,{A:()=>w});var a=r(71354),s=r.n(a),n=r(76314),u=r.n(n),i=r(4417),o=r.n(i),h=new URL(r(6315),r.b),l=u()(s()),d=o()(h);l.push([t.id,`.icon-weather-status{background-image:url(${d})}.weather-action-image-container{width:var(--default-clickable-area);height:var(--default-clickable-area);display:flex;align-items:center;justify-content:center}.weather-image{width:calc(var(--default-clickable-area) - 2*var(--default-grid-baseline))}.favorite-color{color:var(--color-favorite)}`,"",{version:3,sources:["webpack://./apps/weather_status/src/App.vue"],names:[],mappings:"AACA,qBACC,wDAAA,CAGD,gCACC,mCAAA,CACA,oCAAA,CACA,YAAA,CACA,kBAAA,CACA,sBAAA,CAGD,eACC,0EAAA,CAID,gBACC,2BAAA",sourcesContent:["\n.icon-weather-status {\n\tbackground-image: url('../img/app-dark.svg');\n}\n\n.weather-action-image-container {\n\twidth: var(--default-clickable-area);\n\theight: var(--default-clickable-area);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.weather-image {\n\twidth: calc(var(--default-clickable-area) - 2 * var(--default-grid-baseline));\n}\n\n// Set color to primary element for current / active favorite address\n.favorite-color {\n\tcolor: var(--color-favorite);\n}\n"],sourceRoot:""}]);const w=l},6315(t){t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjBweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyMHB4Ij48cGF0aCBkPSJNNDQ0LTc2OHYtMTQ0aDcydjE0NGgtNzJabTI2NSAxMTItNTQtNTIgMTA0LTEwMiA1MiA1MC0xMDIgMTA0Wm01OSAyMTJ2LTcyaDE0NHY3Mkg3NjhaTTQ0NC00OHYtMTQ0aDcydjE0NGgtNzJaTTI1MS02NTggMTQ3LTc2MGw1NC01MCAxMDEgMTAxLTUxIDUxWm01MDkgNTExTDY1OS0yNTJsNTAtNTAgMTA0IDEwMC01MyA1NVpNNDgtNDQ0di03MmgxNDR2NzJINDhabTE1MiAyOTctNTEtNTMgMTAyLTEwMCAyNSAyNCAyNCAyNS0xMDAgMTA0Wm0yODAtOTNxLTEwMCAwLTE3MC03MHQtNzAtMTcwcTAtMTAwIDcwLTE3MHQxNzAtNzBxMTAwIDAgMTcwIDcwdDcwIDE3MHEwIDEwMC03MCAxNzB0LTE3MCA3MFoiLz48L3N2Zz4="}},n={};function u(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={id:t,loaded:!1,exports:{}};return s[t].call(r.exports,r,r.exports,u),r.loaded=!0,r.exports}u.m=s,e=[],u.O=(t,r,a,s)=>{if(!r){var n=1/0;for(l=0;l<e.length;l++){for(var[r,a,s]=e[l],i=!0,o=0;o<r.length;o++)(!1&s||n>=s)&&Object.keys(u.O).every(t=>u.O[t](r[o]))?r.splice(o--,1):(i=!1,s<n&&(n=s));if(i){e.splice(l--,1);var h=a();void 0!==h&&(t=h)}}return t}s=s||0;for(var l=e.length;l>0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[r,a,s]},u.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return u.d(e,{a:e}),e},u.d=(t,e)=>{for(var r in e)u.o(e,r)&&!u.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},u.f={},u.e=t=>Promise.all(Object.keys(u.f).reduce((e,r)=>(u.f[r](t,e),e),[])),u.u=t=>t+"-"+t+".js?v="+{1140:"490e17ed9c8948d5a9e8",2221:"428c2ff62c4b8b3c97fc",5448:"71cfe268d6f1213c4735",6015:"ebcb6885c1fc8c461988",6798:"1a6cf42d93801a926a3d",7471:"b4ac70873a3ab192efd0",7859:"740587c0c8c350dad157",7910:"de857920f8beb5205bbc",8815:"9a5c507c75429c9c04e4"}[t],u.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r={},a="nextcloud-ui-legacy:",u.l=(t,e,s,n)=>{if(r[t])r[t].push(e);else{var i,o;if(void 0!==s)for(var h=document.getElementsByTagName("script"),l=0;l<h.length;l++){var d=h[l];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==a+s){i=d;break}}i||(o=!0,(i=document.createElement("script")).charset="utf-8",u.nc&&i.setAttribute("nonce",u.nc),i.setAttribute("data-webpack",a+s),i.src=t),r[t]=[e];var w=(e,a)=>{i.onerror=i.onload=null,clearTimeout(p);var s=r[t];if(delete r[t],i.parentNode&&i.parentNode.removeChild(i),s&&s.forEach(t=>t(a)),e)return e(a)},p=setTimeout(w.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=w.bind(null,i.onerror),i.onload=w.bind(null,i.onload),o&&document.head.appendChild(i)}},u.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),u.j=1848,(()=>{var t;globalThis.importScripts&&(t=globalThis.location+"");var e=globalThis.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var a=r.length-1;a>-1&&(!t||!/^http(s?):/.test(t));)t=r[a--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u.p=t})(),(()=>{u.b="undefined"!=typeof document&&document.baseURI||self.location.href;var t={1848:0};u.f.j=(e,r)=>{var a=u.o(t,e)?t[e]:void 0;if(0!==a)if(a)r.push(a[2]);else{var s=new Promise((r,s)=>a=t[e]=[r,s]);r.push(a[2]=s);var n=u.p+u.u(e),i=new Error;u.l(n,r=>{if(u.o(t,e)&&(0!==(a=t[e])&&(t[e]=void 0),a)){var s=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;i.message="Loading chunk "+e+" failed.\n("+s+": "+n+")",i.name="ChunkLoadError",i.type=s,i.request=n,a[1](i)}},"chunk-"+e,e)}},u.O.j=e=>0===t[e];var e=(e,r)=>{var a,s,[n,i,o]=r,h=0;if(n.some(e=>0!==t[e])){for(a in i)u.o(i,a)&&(u.m[a]=i[a]);if(o)var l=o(u)}for(e&&e(r);h<n.length;h++)s=n[h],u.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return u.O(l)},r=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),u.nc=void 0;var i=u.O(void 0,[4208],()=>u(87171));i=u.O(i)})();
//# sourceMappingURL=weather_status-weather-status.js.map?v=c45f2551109fd59b158b