(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[5],{28:function(e,n,t){"use strict";t.r(n);var i=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("span",[e.resolvedOpeningTimes?e._t("render",[e.resolvedOpeningTimes?t("button",{staticClass:"tb-hours-now text-grey-darkest",attrs:{type:"button"},on:{click:function(n){return e.$emit("click",n)}}},[e._t("label_"+e.view,[e.languageLabels[e.view]?[e._v("\n                    "+e._s(e.languageLabels[e.view])+"\n                ")]:[e._v("\n                    either language label "),t("code",[e._v(e._s(e.view))]),e._v(" or one of the following slots must be implemented:\n                    "),t("ul",[e._m(0),e._v(" "),t("li",[t("code",[e._v("label_"+e._s(e.view))])])])]],{openingTimes:e.resolvedOpeningTimes,nextOpenDate:e.nextOpenDate}),e._v(" "),e._t("additional_label")],2):e._e()],{openingTimes:e.resolvedOpeningTimes,view:e.view}):e._e(),e._v(" "),e._t("additional_information",null,{openingTimes:e.openingTimes,upcomingOpeningTimes:e.upcomingOpeningTimes,nextOpenDate:e.nextOpenDate})],2)};i._withStripped=!0;var o=t(24),s=t(6),r=t.n(s),a=Object.freeze({NONE:"none",OPEN:"open",OPEN_CLOSING_SOON_REOPENS_TODAY:"open_closing_soon_reopens_today",OPEN_CLOSING_SOON:"open_closing_soon",OPEN_REOPENS_TODAY:"open_reopens_today",CLOSED_OPENS_SOON:"closed_opens_soon",CLOSED_OPENS_TODAY:"closed_opens_today",CLOSED_OPENS_TOMORROW:"closed_opens_tomorrow",CLOSED_OPENS_DAY_AFTER_TOMORROW:"closed_opens_day_after_tomorrow",CLOSED_OPENS_WITHIN_NEXT_WEEK:"closed_opens_within_next_week",CLOSED_OPENS_ON_DATE:"closed_opens_on_date",CLOSED:"closed"}),_={legacy:o.f,toubizV1:o.g},O={props:{openingTimesDefinition:{type:Object,required:!0},openingTimesFormat:{type:String,required:!0,validator:function(e){return-1!==Object.keys(_).indexOf(e)||(console.warn("openingTimesFormat must be one of ".concat(Object.keys(_).join(", "),". ").concat(e," is not allowed.")),!1)}},languageLabels:{type:Object,default:function(){return{}}},dateFormat:{type:String,default:"YYYY-MM-DD"}},data:function(){return{openingTimes:null,resolvedOpeningTimes:null,nextOpenDate:null}},mounted:function(){this.update()},methods:{getNextDates:function(e){for(var n=[],t=0;t<e;t++){var i=new Date;i.setDate(i.getDate()+t),n.push(i)}return n},update:function(){var e=this.parse(this.openingTimesDefinition,this.openingTimesFormat);if(e){this.openingTimes=e,this.resolvedOpeningTimes=e.timesAt(new Date);var n=new Date(this.resolvedOpeningTimes.nextOpenDate);this.resolvedOpeningTimes.nextOpenWeekday=n.getDay(),this.nextOpenDate=r()(n,this.dateFormat)}},parse:function(){if(!this.openingTimesDefinition)return null;var e=(new(0,_[this.openingTimesFormat])).parse(this.openingTimesDefinition);return e&&0!==e.times.length?e:null}},computed:{upcomingOpeningTimes:function(){var e=[],n=!0,t=!1,i=void 0;try{for(var o,s=this.getNextDates(7)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var r=o.value;e.push({weekday:r.getDay(),times:this.openingTimes?this.openingTimes.openingTimesForDate(r):null})}}catch(e){t=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(t)throw i}}return e},view:function(){var e=this.resolvedOpeningTimes;if(!e)return a.NONE;if(e.isOpen)return e.minutesUntilClosing<=60?0===e.daysUntilNextOpen?a.OPEN_CLOSING_SOON_REOPENS_TODAY:a.OPEN_CLOSING_SOON:0===e.daysUntilNextOpen?a.OPEN_REOPENS_TODAY:a.OPEN;if(null===e.openingTimes)return a.CLOSED;if(e.minutesUntilNextOpen<=60)return a.CLOSED_OPENS_SOON;switch(e.daysUntilNextOpen){case 0:return a.CLOSED_OPENS_TODAY;case 1:return a.CLOSED_OPENS_TOMORROW;case 2:return a.CLOSED_OPENS_DAY_AFTER_TOMORROW;case 3:case 4:case 5:case 6:case 7:return a.CLOSED_OPENS_WITHIN_NEXT_WEEK}return e.daysUntilNextOpen?a.CLOSED_OPENS_ON_DATE:a.CLOSED}}},l=t(20),p=Object(l.a)(O,i,[function(){var e=this.$createElement,n=this._self._c||e;return n("li",[n("code",[this._v("render")])])}],!1,null,null,null);p.options.__file="DistributionPackages/Newland.Toubiz.Poi.Neos/Resources/Private/Scripts/components/opening-times-line-preview.vue";n.default=p.exports}}]);