(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[135],{DTD7:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"tb-w-nearby-articles"},[e.loading?i("tb-w-loader"):e.nearbyArticles.length?i("tb-w-section",{attrs:{wide:""},scopedSlots:e._u([{key:"content",fn:function(){return[i("tb-w-slider",[e._l(e.nearbyArticles.slice(0,6),(function(t){return i("tb-w-slider-item",{key:t.id},[i("tb-w-teaser-card",{attrs:{background:e.buildImageUri(t.id,"article",[null,376]),href:e.buildUrl({name:"article.detail",params:{id:t.id}}),type:"stacked","open-in-new-tab":""},scopedSlots:e._u([{key:"topline",fn:function(){return[e.displayCityName(t)?i("strong",[e._v("\n                                "+e._s(t.address.city)+"\n                                "),e.article.primaryCategory?i("span",{staticClass:"tracking-widest mx-1"},[e._v("•")]):e._e()]):e._e(),e._v(" "),t.primaryCategory?[e._v("\n                                "+e._s(t.primaryCategory.name)+"\n                            ")]:e._e()]},proxy:!0},e.$eq.medium&&t.openingTimes&&(t.openingTimes.definitions||[]).length?{key:"info",fn:function(){return[i("tb-w-opening-times-parser",{attrs:{"opening-times-format":"toubizV1","opening-times-definition":t.openingTimes},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.openingTimes;return[i("tb-w-opening-times-line-preview",{attrs:{"opening-times":t,"for-date-and-time":new Date}})]}}],null,!0)})]},proxy:!0}:null],null,!0)},[e._v("\n\n                        "+e._s(t.name)+"\n\n                        ")])],1)})),e._v(" "),e.nearbyArticles.length>6?i("tb-w-show-all",{attrs:{href:e.buildUrl({name:"article.list",query:{params:e.getLocationFilterParams()}})}},[e._v("\n                    "+e._s(e.$t("message.showAll"))+"\n                ")]):e._e()],2)]},proxy:!0}])},[e._v("\n        "+e._s(e.$t("message.discoveriesNearby"))+"\n\n        ")]):e._e()],1)};n._withStripped=!0;var r=i("VjoN"),a=i("6dQ1"),s=i("p3NV"),o={name:"TbWArticleDetailNearbyArticles",eq:{breakpoints:{medium:{minWidth:768}}},props:{article:{type:Object,required:!0}},data:()=>({nearbyArticles:[],loading:!0,categoriesToExclude:[]}),async created(){if(this.categoriesToExclude=["TRAFFIC_INFRASTRUCTURE","PARK","MOUNTAIN_RAILWAY","PUBLIC_TOILETS","OVERNIGHT_ACCOMODATION"].map(e=>s.a[e]),!Object(a.a)()){const e=await this.articleRepository.fetch(this.article.id+"/nearbyArticles",{filter:{clientIncludingManaged:"current",excludeCategory:this.categoriesToExclude},language:this.$store.state.language});this.nearbyArticles=e.payload,this.nearbyArticles.length&&(this.nearbyArticles.splice(8),await this.articleRepository.enrichListWithIncludes(this.nearbyArticles,["openingTimes"],{language:this.$store.state.language})),this.loading=!1}},methods:{getLocationFilterParams(){return this.article.geocoordinates?Object(r.b)({filter:{location:{latitude:this.article.geocoordinates.latitude,longitude:this.article.geocoordinates.longitude,radiusMeters:1e3},excludeCategory:this.categoriesToExclude},isSecondaryList:!0}):{}},displayCityName(e){var t;return"point"===e.type&&(null===(t=e.address)||void 0===t?void 0:t.city)}}},c=i("KHd+"),l=Object(c.a)(o,n,[],!1,null,null,null);l.options.__file="node_modules/@newland/toubiz-widget/src/components/article-detail/tb-w-article-detail-nearby-articles.vue";t.default=l.exports},VjoN:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return a}));var n=i("7yoQ");function r(e){return encodeURIComponent(Object(n.b)(JSON.stringify(e)))}const a={created(){for(const e of this.$options.urlState)this.restoreStateFromUrl(e),this.$watch(e,t=>this.saveStateToUrl(e,t),{deep:!0})},methods:{saveStateToUrl(e,t=this[e]){const i=Object.assign({},this.$route.query);i[e]=r(t),this.$router.push({name:this.$route.name,query:i}).catch(e=>{if(!(""+e.message).includes("redundant navigation"))throw e})},restoreStateFromUrl(e){if(!this.$route.query[e])return null;try{const t=function(e){return JSON.parse(Object(n.a)(decodeURIComponent(e)))}(this.$route.query[e]);return this.$set(this,e,t),t}catch(t){return console.warn(`Could not restore state ${e} from URL parameter ${e}`,t),null}}}}},p3NV:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));const n=Object.freeze({TRAFFIC_INFRASTRUCTURE:"fefb0db5-fe76-4207-b626-68bb3a9a0f7e",PARK:"88bc7347-096a-45c8-9d77-db1746115057",MOUNTAIN_RAILWAY:"79888b0c-b5ee-48c3-b0df-301617948ce8",PUBLIC_TOILETS:"8b30f31b-2e8b-4f75-a729-f6a0f27e834a",OVERNIGHT_ACCOMODATION:"32b05798-f54c-462d-9f58-a39899c85ef6",BIKE_TOUR:"86426242-7a34-3937-8ad2-94b5f4302a5c"})}}]);