(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[118],{VjoN:function(t,e,a){"use strict";a.d(e,"b",(function(){return s})),a.d(e,"a",(function(){return i}));var n=a("7yoQ");function s(t){return encodeURIComponent(Object(n.b)(JSON.stringify(t)))}const i={created(){for(const t of this.$options.urlState)this.restoreStateFromUrl(t),this.$watch(t,e=>this.saveStateToUrl(t,e),{deep:!0})},methods:{saveStateToUrl(t,e=this[t]){const a=Object.assign({},this.$route.query);a[t]=s(e),this.$router.push({name:this.$route.name,query:a}).catch(t=>{if(!(""+t.message).includes("redundant navigation"))throw t})},restoreStateFromUrl(t){if(!this.$route.query[t])return null;try{const e=function(t){return JSON.parse(Object(n.a)(decodeURIComponent(t)))}(this.$route.query[t]);return this.$set(this,t,e),e}catch(e){return console.warn(`Could not restore state ${t} from URL parameter ${t}`,e),null}}}}},s3mq:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tb-w-events-at-this-location"},[t.loading?a("tb-w-loader"):t.eventsAtThisLocation.length?a("tb-w-section",{scopedSlots:t._u([{key:"content",fn:function(){return[a("tb-w-slider",[t._l(t.eventsAtThisLocation.slice(0,6),(function(e){return a("tb-w-slider-item",{key:e.id},[a("tb-w-teaser-card",{attrs:{background:t.buildImageUri(e.event.id,"event",[null,376]),href:t.buildUrl({name:"eventDate.detail",params:{id:e.id}}),type:"stacked"},scopedSlots:t._u([{key:"labels",fn:function(){return[a("span",{class:{"line-through":e.event.canceled||e.isCancelled}},[t._v("\n                                "+t._s(t.getDatesToDisplay(e.event,e.date))+"\n                            ")]),t._v(" "),e.event.canceled||e.isCancelled?a("span",{staticClass:"text-negative-500 font-bold"},[t._v("\n                                "+t._s(t.$t("message.canceled"))+"\n                            ")]):t._e()]},proxy:!0},{key:"topline",fn:function(){return[t._v("\n                            "+t._s(e.event.category.name)+"\n                        ")]},proxy:!0}],null,!0)},[t._v(" "),t._v("\n\n                        "+t._s(e.event.name)+"\n                    ")])],1)})),t._v(" "),t.eventsAtThisLocation.length>6?a("tb-w-show-all",{attrs:{href:t.buildUrl({name:"event.list",query:{params:t.getEventLocationFilterParams(t.article.id)}})}},[t._v("\n                    "+t._s(t.$t("message.allEvents"))+"\n                ")]):t._e()],2)]},proxy:!0}])},[t._v("\n        "+t._s(t.$t("message.events"))+"\n\n        ")]):t._e()],1)};n._withStripped=!0;var s=a("g8pp"),i=a("VjoN"),o=a("vqf1"),r=a("6dQ1"),l={name:"TbWArticleDetailEventsAtThisLocation",props:{article:{type:Object,required:!0}},mixins:[o.a],data:()=>({loading:!0,eventsAtThisLocation:[],today:Object(s.a)(new Date,"y-M-d")}),async created(){if(!Object(r.a)()){const t=await this.eventDateRepository.listMerged({filter:{clientIncludingManaged:"current",location:this.article.id,date:{after:this.today}},language:this.$store.state.language});this.eventsAtThisLocation=t.payload,this.loading=!1}},methods:{getEventLocationFilterParams:t=>Object(i.b)({filter:{location:[t]}})}},c=a("KHd+"),d=Object(c.a)(l,n,[],!1,null,null,null);d.options.__file="node_modules/@newland/toubiz-widget/src/components/article-detail/tb-w-article-detail-events-at-this-location.vue";e.default=d.exports},vqf1:function(t,e,a){"use strict";var n=a("g8pp"),s=a("N8I4"),i=a("sdSa");e.a={methods:{getDatesToDisplay:(t,e)=>t.firstDate.id===t.lastDate.id?Object(n.a)(new Date(t.firstDate.date),"d.M.Y"):function(t,e){Object(i.a)(2,arguments);var a=Object(s.a)(t),n=Object(s.a)(e);return a.getFullYear()===n.getFullYear()}(new Date(e||t.firstDate.date),new Date(t.lastDate.date))?`${Object(n.a)(new Date(e||t.firstDate.date),"d.M.")} - ${Object(n.a)(new Date(t.lastDate.date),"d.M.Y")}`:`${Object(n.a)(new Date(e||t.firstDate.date),"d.M.Y")} - ${Object(n.a)(new Date(t.lastDate.date),"d.M.Y")}`}}}}]);