(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[324],{"KHd+":function(e,t,n){"use strict";function o(e,t,n,o,a,r,s,i){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):a&&(l=i?function(){a.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:a),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return o}))},XgdU:function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.weather?n("div",{staticClass:"tb-w-detail-weather"},[n("tb-w-section",{attrs:{"no-container":e.noSectionSpacing,"no-spacing":e.noSectionSpacing},scopedSlots:e._u([{key:"content",fn:function(){return[e.weatherResponse?n("tb-w-weather-overview",{attrs:{weather:e.weather}}):e._e()]},proxy:!0}],null,!1,1517762078)},[e._v("\n        "+e._s(e.$t("message.weatherForecast"))+"\n\n        ")])],1):n("div")};o._withStripped=!0;var a=n("ikAt"),r=n("xBaG"),s={name:"TbWDetailWeather",data:()=>({weatherResponse:null}),props:{article:{type:Object,required:!0},noSectionSpacing:{type:Boolean,default:!1}},computed:{...Object(r.c)(["toursprungApiKeyWithOverride"]),hasGeocoordinates(){var e,t;return(null===(e=this.article.geocoordinates)||void 0===e?void 0:e.latitude)&&(null===(t=this.article.geocoordinates)||void 0===t?void 0:t.longitude)},weather(){var e;return null===(e=this.weatherResponse)||void 0===e?void 0:e.data}},methods:{async getWeather(){this.hasGeocoordinates&&(this.weatherResponse=await Object(a.a)({store:this.$store,lat:this.article.geocoordinates.latitude,lon:this.article.geocoordinates.longitude,hours:"120",apiToken:this.toursprungApiKeyWithOverride}))}},watch:{article:{handler(){this.getWeather()},immediate:!0,deep:!0}},i18n:{fallbackLocale:"de",silentFallbackWarn:"undefined"==typeof window,messages:{de:{message:{weatherForecast:"Wetterprognose"}},en:{message:{weatherForecast:"Weather Forecast"}},fr:{message:{weatherForecast:"Prévision météorologiques"}},it:{message:{weatherForecast:"Previsioni meteo"}},es:{message:{weatherForecast:"Previsión meteorológica"}},nl:{message:{weatherForecast:"Weersvoorspelling"}},cs:{message:{weatherForecast:"Předpověď počasí"}}}}},i=n("KHd+"),l=Object(i.a)(s,o,[],!1,null,null,null);t.default=l.exports},ikAt:function(e,t,n){"use strict";function o(e,t){return`lat_${e}lon_${t}`}async function a({store:e=null,lat:t=null,lon:n=null,hours:a="120",apiToken:r=""}={}){var s,i;const l=o(t,n),c=null==e||null===(s=e.state)||void 0===s||null===(i=s.weather)||void 0===i?void 0:i.weatherData;return null!=c&&c[l]&&Date.now()<c[l].expires?c[l]:await async function({store:e,lat:t,lon:n,hours:a,apiToken:r}={}){const s=await async function({lat:e,lon:t,hours:n,apiToken:o}={}){const a=`https://weather.maptoolkit.net/forecast/icon?api_key=${o}&lat=${e}&lng=${t}&forecast=${n}`,r=await fetch(a,{method:"GET"});if(200!==r.status)return null;return r.json()}({lat:t,lon:n,hours:a,apiToken:r}),i=o(t,n);if(!s)return null;let l=Date.now()+18e5;const c={data:s,id:i,expires:l};return await e.dispatch("weather/setWeatherDataEntry",c),e.state.weather.weatherData[i]}({store:e,lat:t,lon:n,hours:a,apiToken:r})}n.d(t,"a",(function(){return a}))}}]);