(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[328],{xyEF:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("tb-w-loader",{directives:[{name:"show",rawName:"v-show",value:!this.loaderSuspense,expression:"!loaderSuspense"}],attrs:{colibri:""}}),this._v(" "),t("transition",{attrs:{name:"fade"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:this.loaderSuspense,expression:"loaderSuspense"}]},[this.mergedSnowReports.length?t("tb-w-article-detail-snow-reports",{attrs:{"snow-reports":this.mergedSnowReports,"hide-headline":""}}):this._e()],1)])],1)};i._withStripped=!0;var r=s("m5nq"),o={props:{id:{type:String,required:!0},type:{type:String,required:!0}},data:()=>({article:null,snowReports:[],snowReportsInherited:[],loaderSuspense:!1}),computed:{visibleInheritedSnowReports(){var e,t;let s=this.snowReportsInherited;return s.length?(null!==(e=this.article)&&void 0!==e&&null!==(t=e.snowReportsHidden)&&void 0!==t&&t.length&&(s=s.filter(e=>!this.article.snowReportsHidden.includes(e.id))),s):[]},mergedSnowReports(){return[...this.snowReports,...this.visibleInheritedSnowReports]}},methods:{async fetchArticle(e,t){this.article=null;try{const s=await this.articleRepository.fetch(e,{language:this.$store.state.language},t);this.article=s.payload}catch(e){console.error(e)}},async fetchSnowReports(e,t){try{const s=await this.articleRepository.snowReports(e,t);this.snowReports=s.payload}catch(e){console.error(e)}},async fetchSnowReportsInherited(e,t){try{const s=await this.articleRepository.snowReportsInherited(e,t);this.snowReportsInherited=s.payload}catch(e){console.error(e)}},async fetchArticleAndSnowReports(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;const t="skiArea"===this.type?r.a.VERSION_2:r.a.VERSION_1,s=[];this.articleRepository&&s.push(this.fetchArticle(e,t)),this.articleRepository&&t===r.a.VERSION_2?s.push(this.fetchSnowReports(e,t)):this.articleRepository&&s.push(this.fetchSnowReports(e,t),this.fetchSnowReportsInherited(e,t)),await Promise.all(s)}},watch:{article(){this.article&&setTimeout(()=>{this.loaderSuspense=!0},300)},id:{immediate:!0,handler(e){this.fetchArticleAndSnowReports(e)}}}},n=s("KHd+"),a=Object(n.a)(o,i,[],!1,null,null,null);a.options.__file="node_modules/@newland/toubiz-widget/src/routes/snow-report.vue";t.default=a.exports}}]);