(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&&"none"!==e.view?t("button",{staticClass:"tb-hours-now text-grey-darkest",class:{"cursor-default":!e.toggleEnabled},on:{click:function(n){return e.toggleAdditional(e.resolvedOpeningTimes)}}},[e._t("label_"+e.view,[e.languageLabels[e.view]?[e._v("\n                    "+e._s(e.additionalActive)+"\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.toggleEnabled?e._t("additional_label",null,{additionalActive:e.additionalActive}):e._e()],2):e._e()],{openingTimes:e.resolvedOpeningTimes,view:e.view}):e._e(),e._v(" "),e.toggleEnabled?e._t("additional_information",null,{openingTimes:e.openingTimes,upcomingOpeningTimes:e.upcomingOpeningTimes,nextOpenDate:e.nextOpenDate,additionalActive:e.additionalActive}):e._e()],2)};i._withStripped=!0;var o=t(24),s=t(6),a=t.n(s),l=Object.freeze({NONE:"none",OPEN:"open",ALWAYS_OPEN:"always_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"}),r={legacy:o.g,"legacy-attraction":o.f,toubizV1:o.h},O={props:{openingTimesDefinition:{type:Object,required:!0},openingTimesFormat:{type:String,required:!0,validator:function(e){return-1!==Object.keys(r).indexOf(e)||(console.warn("openingTimesFormat must be one of ".concat(Object.keys(r).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,toggleEnabled:!1,additionalActive:!1}},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;var n=e.timesAt(new Date);this.toggleEnabled=n&&!n.defaultsToAlwaysOpen&&n.daysUntilNextOpen<=7,this.resolvedOpeningTimes=n;var t=new Date(this.resolvedOpeningTimes.nextOpenDate);this.resolvedOpeningTimes.nextOpenWeekday=t.getDay(),this.nextOpenDate=a()(t,this.dateFormat)}},parse:function(){if(!this.openingTimesDefinition)return null;var e=(new(0,r[this.openingTimesFormat])).parse(this.openingTimesDefinition);return e&&0!==e.times.length?e:null},toggleAdditional:function(e){this.toggleEnabled&&(this.additionalActive=!this.additionalActive)}},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 a=o.value,l=this.openingTimes?this.openingTimes.openingTimesForDate(a):null;e.push({weekday:a.getDay(),times:l})}}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||!e.isOpen&&!e.nextOpenDate)return l.NONE;if(e.defaultsToAlwaysOpen)return l.ALWAYS_OPEN;if(e.isOpen)return null!==e.minutesUntilClosing&&e.minutesUntilClosing>0&&e.minutesUntilClosing<=60?0===e.daysUntilNextOpen?l.OPEN_CLOSING_SOON_REOPENS_TODAY:l.OPEN_CLOSING_SOON:0===e.daysUntilNextOpen&&e.timeRange.end.hour<e.nextTimeRange.beginning.hour?l.OPEN_REOPENS_TODAY:l.OPEN;if(e.daysUntilNextOpen<=1&&null!==e.minutesUntilNextOpen&&e.minutesUntilNextOpen<=60)return l.CLOSED_OPENS_SOON;switch(e.daysUntilNextOpen){case 0:return l.CLOSED_OPENS_TODAY;case 1:return l.CLOSED_OPENS_TOMORROW;case 2:return l.CLOSED_OPENS_DAY_AFTER_TOMORROW;case 3:case 4:case 5:case 6:return l.CLOSED_OPENS_WITHIN_NEXT_WEEK}return e.daysUntilNextOpen?l.CLOSED_OPENS_ON_DATE:l.CLOSED}}},_=t(20),p=Object(_.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}}]);