exports.ids = [28];
exports.modules = {

/***/ 104:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_DateInput_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_DateInput_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_DateInput_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_DateInput_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_DateInput_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 105:
/***/ (function(module, exports, __webpack_require__) {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(5);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".datePicker{max-width:500px!important;margin:0 auto}", ""]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___;


/***/ }),

/***/ 116:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/add/DateInput.vue?vue&type=template&id=346fb145&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-col',{attrs:{"cols":"12"}},[_c('div',{staticClass:"text-center"},[_c('v-btn-toggle',{staticClass:"v-col-6 flex-column flex-sm-row",attrs:{"color":"primary"},on:{"change":function (type) { return _vm.change("type", type); }},model:{value:(_vm.type),callback:function ($$v) {_vm.type=$$v},expression:"type"}},[_c('v-btn',{attrs:{"value":"normal","label":"normal"}},[_vm._v(_vm._s(_vm.$t('event.normal')))]),_c('v-btn',{attrs:{"value":"multidate","label":"multidate"}},[_vm._v(_vm._s(_vm.$t('event.multidate')))]),(_vm.settings.allow_recurrent_event)?_c('v-btn',{attrs:{"value":"recurrent","label":"recurrent"}},[_vm._v(_vm._s(_vm.$t('event.recurrent')))]):_vm._e()],1),_c('p',[_vm._v(_vm._s(_vm.$t(("event." + _vm.type + "_description"))))]),(_vm.type === "recurrent")?_c('v-btn-toggle',{staticClass:"v-col-6 flex-column flex-sm-row",attrs:{"color":"primary","value":_vm.value.recurrent.frequency},on:{"change":function (fq) { return _vm.change("frequency", fq); }}},_vm._l((_vm.frequencies),function(f){return _c('v-btn',{key:f.value,attrs:{"value":f.value}},[_vm._v(_vm._s(f.text))])}),1):_vm._e(),_c('client-only',[_c('div',{staticClass:"datePicker mt-3"},[_c('v-input',{attrs:{"value":_vm.fromDate,"rules":[_vm.$validators.required('common.when')]}},[_c('vc-date-picker',{attrs:{"value":_vm.fromDate,"is-range":_vm.type === "multidate","attributes":_vm.attributes,"locale":_vm.$i18n.locale,"from-page":_vm.page,"is-dark":_vm.settings['theme.is_dark'],"is-inline":"","is-expanded":"","min-date":_vm.type !== "recurrent" && new Date()},on:{"input":function (date) { return _vm.change('date', date); },"update:fromPage":function($event){_vm.page=$event},"update:from-page":function($event){_vm.page=$event}}})],1)],1)])],1),(_vm.type === "recurrent")?_c('div',{staticClass:"text-center mb-2"},[(_vm.value.recurrent.frequency !== "1m" && _vm.value.recurrent.frequency !== "2m")?_c('span',[_vm._v(_vm._s(_vm.whenPatterns))]):_c('v-btn-toggle',{staticClass:"mt-1 flex-column flex-sm-row",attrs:{"value":_vm.value.recurrent.type,"color":"primary"},on:{"change":function (fq) { return _vm.change("recurrentType", fq); }}},_vm._l((_vm.whenPatterns),function(whenPattern){return _c('v-btn',{key:_vm.whenPatterns.key,attrs:{"value":whenPattern.key,"small":""}},[_vm._v(_vm._s(whenPattern.label))])}),1)],1):_vm._e(),_c('v-row',{staticClass:"mt-3 col-md-6 mx-auto"},[_c('v-col',{staticClass:"col-12 col-sm-6"},[_c('v-select',{attrs:{"dense":"","label":_vm.$t('event.from'),"value":_vm.fromHour,"clearable":"","disabled":!_vm.value.from,"rules":[_vm.$validators.required('event.from')],"items":_vm.hourList},on:{"change":function (hr) { return _vm.change("fromHour", hr); }}})],1),_c('v-col',{staticClass:"col-12 col-sm-6"},[_c('v-select',{attrs:{"dense":"","label":_vm.$t('event.due'),"disabled":!_vm.fromHour,"value":_vm.dueHour,"clearable":"","items":_vm.hourList},on:{"change":function (hr) { return _vm.change("dueHour", hr); }}})],1)],1),(_vm.type==="normal" && _vm.todayEvents.length)?_c('List',{attrs:{"events":_vm.todayEvents,"title":_vm.$t("event.same_day")}}):_vm._e()],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/add/DateInput.vue?vue&type=template&id=346fb145&lang=pug&

// EXTERNAL MODULE: external "dayjs"
var external_dayjs_ = __webpack_require__(2);
var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_);

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(3);

// EXTERNAL MODULE: ./components/List.vue + 4 modules
var List = __webpack_require__(92);

// EXTERNAL MODULE: ./assets/helper.js
var helper = __webpack_require__(98);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./pages/add/DateInput.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//




/* harmony default export */ var DateInputvue_type_script_lang_js_ = ({
  name: 'DateInput',
  components: {
    List: List["a" /* default */]
  },
  props: {
    value: {
      type: Object,
      default: () => ({
        from: null,
        due: null,
        recurrent: null
      })
    },
    event: {
      type: Object,
      default: () => null
    }
  },

  data() {
    return {
      type: 'normal',
      page: null,
      events: [],
      frequencies: [{
        value: '1w',
        text: this.$t('event.each_week')
      }, {
        value: '2w',
        text: this.$t('event.each_2w')
      }, {
        value: '1m',
        text: this.$t('event.each_month')
      }]
    };
  },

  computed: { ...Object(external_vuex_["mapState"])(['settings', 'tags']),

    todayEvents() {
      const start = external_dayjs_default()(this.value.from).startOf('day').unix();
      const end = external_dayjs_default()(this.value.from).endOf('day').unix();
      const events = this.events.filter(e => this.event.id && e.id !== this.event.id && e.start_datetime >= start && e.start_datetime <= end);
      return events;
    },

    attributes() {
      return Object(helper["a" /* attributesFromEvents */])(this.events, this.tags);
    },

    fromDate() {
      if (this.value.multidate) {
        return {
          start: external_dayjs_default()(this.value.from).toDate(),
          end: external_dayjs_default()(this.value.due).toDate()
        };
      }

      return this.value.from ? external_dayjs_default()(this.value.from).toDate() : null;
    },

    fromHour() {
      return this.value.from && this.value.fromHour ? external_dayjs_default()(this.value.from).format('HH:mm') : null;
    },

    dueHour() {
      return this.value.due && this.value.dueHour ? external_dayjs_default()(this.value.due).format('HH:mm') : null;
    },

    hourList() {
      const hourList = [];

      const leftPad = h => ('00' + h).slice(-2);

      for (let h = 0; h < 24; h++) {
        const textHour = leftPad(h < 13 ? h : h - 12);
        hourList.push({
          text: textHour + ':00 ' + (h <= 12 ? 'AM' : 'PM'),
          value: leftPad(h) + ':00'
        });
        hourList.push({
          text: textHour + ':30 ' + (h <= 12 ? 'AM' : 'PM'),
          value: leftPad(h) + ':30'
        });
      }

      return hourList;
    },

    whenPatterns() {
      if (!this.value.from) {
        return;
      }

      const date = external_dayjs_default()(this.value.from);
      const freq = this.value.recurrent.frequency;
      const weekDay = date.format('dddd');

      if (freq === '1w' || freq === '2w') {
        return this.$t(`event.recurrent_${freq}_days`, {
          days: weekDay
        }).toUpperCase();
      } else if (freq === '1m' || freq === '2m') {
        const monthDay = date.format('D');
        const n = Math.floor((monthDay - 1) / 7) + 1;
        const patterns = [{
          label: this.$t(`event.recurrent_${freq}_days`, {
            days: monthDay
          }),
          key: 'ordinal'
        } // { label: this.$tc(`event.recurrent_${freq}_ordinal`, { n, days: weekDay }), key: 'weekday' }
        ];

        if (n < 5) {
          patterns.push({
            label: this.$t(`event.recurrent_${freq}_ordinal`, {
              n: this.$t(`ordinal.${n}`),
              days: weekDay
            }),
            key: n
          });
        } // if selected day is in last week, propose also this type of selection


        const lastWeek = date.daysInMonth() - monthDay < 7;

        if (lastWeek) {
          patterns.push({
            label: this.$t(`event.recurrent_${freq}_ordinal`, {
              n: this.$t('ordinal.-1'),
              days: weekDay
            }),
            key: -1
          });
        }

        return patterns;
      } else if (freq === '1d') {
        return this.$t('event.recurrent_each_day');
      }

      return '';
    }

  },

  async mounted() {
    if (this.value.multidate) {
      this.type = 'multidate';
    } else if (this.value.recurrent) {
      this.type = 'recurrent';
    } else {
      this.type = 'normal';
    }

    this.events = await this.$api.getEvents({
      start: external_dayjs_default()().unix()
    });
  },

  methods: {
    updateRecurrent(value) {
      this.$emit('input', { ...this.value,
        recurrent: value || null
      });
    },

    change(what, value) {
      // change event's type
      if (what === 'type') {
        if (typeof value === 'undefined') {
          this.type = 'normal';
        }

        if (value === 'recurrent') {
          this.$emit('input', { ...this.value,
            recurrent: {
              frequency: '1w'
            },
            multidate: false
          });
        } else if (value === 'multidate') {
          this.$emit('input', { ...this.value,
            recurrent: null,
            multidate: true
          });
        } else {
          let from = this.value.from;

          if (from && from.start) {
            from = from.start;
          }

          let due = this.value.due;

          if (due && due.start) {
            due = due.start;
          }

          this.$emit('input', { ...this.value,
            from,
            due,
            recurrent: null,
            multidate: false
          });
        }
      } else if (what === 'frequency') {
        this.$emit('input', { ...this.value,
          recurrent: { ...this.value.recurrent,
            frequency: value
          }
        });
      } else if (what === 'recurrentType') {
        this.$emit('input', { ...this.value,
          recurrent: { ...this.value.recurrent,
            type: value
          }
        });
      } else if (what === 'fromHour') {
        if (value) {
          const [hour, minute] = value.split(':');
          const from = external_dayjs_default()(this.value.from).hour(hour).minute(minute);
          this.$emit('input', { ...this.value,
            from,
            fromHour: true
          });
        } else {
          this.$emit('input', { ...this.value,
            fromHour: false
          });
        }
      } else if (what === 'dueHour') {
        if (value) {
          const [hour, minute] = value.split(':');
          const fromHour = external_dayjs_default()(this.value.from).hour(); // add a day

          let due = external_dayjs_default()(this.value.from);

          if (fromHour > Number(hour) && !this.value.multidate) {
            due = due.add(1, 'day');
          }

          due = due.hour(hour).minute(minute);
          this.$emit('input', { ...this.value,
            due,
            dueHour: true
          });
        } else {
          this.$emit('input', { ...this.value,
            due: null,
            dueHour: false
          });
        } // change date in calendar (could be a range or a recurrent event...)

      } else if (what === 'date') {
        if (value === null) {
          this.$emit('input', { ...this.value,
            from: null,
            fromHour: false
          });
          return;
        }

        if (this.value.multidate) {
          let from = value.start;
          let due = value.end;

          if (this.value.fromHour) {
            from = external_dayjs_default()(value.start).hour(external_dayjs_default()(this.value.from).hour());
          }

          if (this.value.dueHour) {
            due = external_dayjs_default()(value.end).hour(external_dayjs_default()(this.value.due).hour());
          }

          this.$emit('input', { ...this.value,
            from,
            due
          });
        } else {
          let from = value;
          let due = this.value.due;

          if (this.value.fromHour) {
            from = external_dayjs_default()(value).hour(external_dayjs_default()(this.value.from).hour());
          }

          if (this.value.dueHour && this.value.due) {
            due = external_dayjs_default()(value).hour(external_dayjs_default()(this.value.due).hour());
          }

          this.$emit('input', { ...this.value,
            from,
            due
          });
        }
      }
    }

  }
});
// CONCATENATED MODULE: ./pages/add/DateInput.vue?vue&type=script&lang=js&
 /* harmony default export */ var add_DateInputvue_type_script_lang_js_ = (DateInputvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./pages/add/DateInput.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(104)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  add_DateInputvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  injectStyles,
  null,
  "3661e4ba"
  
)

/* harmony default export */ var DateInput = __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 90:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(94);
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add CSS to SSR context
var add = __webpack_require__(6).default
module.exports.__inject__ = function (context) {
  add("2659ca03", content, true, context)
};

/***/ }),

/***/ 92:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/List.vue?vue&type=template&id=0ec1754e&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"list"}},[_c('v-list',{attrs:{"dense":""}},[_c('v-list-item',[(_vm.title)?_c('h3',[_vm._v(_vm._s(_vm.title))]):_vm._e()]),_vm._l((_vm.computedEvents),function(event){return _c('v-list-item',{key:((event.id) + "_" + (event.start_datetime)),attrs:{"target":"_blank","to":("/event/" + (event.slug || event.id)),"small":""}},[_c('v-list-item-content',[_c('v-list-item-subtitle',[(event.parentId)?_c('v-icon',{attrs:{"small":"","color":"success"}},[_vm._v("mdi-repeat")]):_vm._e(),_vm._v(" "+_vm._s(_vm._f("when")(event))),_c('span',{staticClass:"primary--text ml-1"},[_vm._v("@"+_vm._s(event.place.name))])],1),_c('v-list-item-title',{domProps:{"textContent":_vm._s(event.title)}})],1)],1)})],2)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./components/List.vue?vue&type=template&id=0ec1754e&lang=pug&

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./components/List.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Listvue_type_script_lang_js_ = ({
  name: 'List',
  props: {
    title: {
      type: String,
      default: ''
    },
    events: {
      type: Array,
      default: () => {
        return [];
      }
    },
    maxEvents: {
      type: Number,
      default: 0
    },
    minimal: {
      type: Boolean,
      default: false
    },
    showTags: {
      type: Boolean,
      default: true
    },
    showImage: {
      type: Boolean,
      default: true
    },
    showDescription: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    computedEvents() {
      if (!this.maxEvents) {
        return this.events;
      }

      return this.events.slice(0, this.maxEvents);
    }

  }
});
// CONCATENATED MODULE: ./components/List.vue?vue&type=script&lang=js&
 /* harmony default export */ var components_Listvue_type_script_lang_js_ = (Listvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./components/List.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(93)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_Listvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  injectStyles,
  null,
  "0b1be8ae"
  
)

/* harmony default export */ var List = __webpack_exports__["a"] = (component.exports);

/***/ }),

/***/ 93:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_5_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_5_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_5_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_5_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_5_oneOf_1_4_node_modules_vue_loader_lib_index_js_vue_loader_options_List_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_5_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_5_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_5_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_5_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_5_oneOf_1_4_node_modules_vue_loader_lib_index_js_vue_loader_options_List_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_cache_loader_dist_cjs_js_ref_5_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_5_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_5_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_5_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_5_oneOf_1_4_node_modules_vue_loader_lib_index_js_vue_loader_options_List_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_cache_loader_dist_cjs_js_ref_5_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_5_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_5_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_5_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_5_oneOf_1_4_node_modules_vue_loader_lib_index_js_vue_loader_options_List_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_cache_loader_dist_cjs_js_ref_5_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_5_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_5_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_5_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_5_oneOf_1_4_node_modules_vue_loader_lib_index_js_vue_loader_options_List_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 94:
/***/ (function(module, exports, __webpack_require__) {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(5);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
// Module
___CSS_LOADER_EXPORT___.push([module.i, "#list{max-width:500px;margin:0 auto}#list .v-list-item__title{white-space:normal!important}", ""]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___;


/***/ }),

/***/ 98:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return attributesFromEvents; });
/* harmony import */ var lodash_take__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63);
/* harmony import */ var lodash_take__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_take__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59);
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_2__);



function attributesFromEvents(_events, _tags) {
  const colors = ['blue', 'orange', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray'];
  const tags = lodash_take__WEBPACK_IMPORTED_MODULE_0___default()(_tags, 10).map(t => t.tag);
  let attributes = [];
  attributes.push({
    key: 'today',
    dates: new Date(),
    bar: {
      color: 'green',
      fillMode: 'outline'
    }
  });
  const now = dayjs__WEBPACK_IMPORTED_MODULE_2___default()().unix();

  function getColor(event, where) {
    const color = {
      class: 'vc-rounded-full',
      color: 'blue',
      fillMode: where === 'base' ? 'light' : 'solid'
    };
    const tag = lodash_get__WEBPACK_IMPORTED_MODULE_1___default()(event, 'tags[0]');

    if (event.start_datetime < now) {
      if (event.multidate) {
        color.fillMode = where === 'base' ? 'light' : 'outline';

        if (where === 'base') {
          color.class += ' vc-past';
        }
      } else {
        color.class += ' vc-past';
      }
    }

    if (!tag) {
      return color;
    }

    const idx = tags.indexOf(tag);

    if (idx < 0) {
      return color;
    }

    color.color = colors[idx]; // if (event.start_datetime < now) { color.class += ' vc-past' }

    return color;
  }

  attributes = attributes.concat(_events.filter(e => !e.multidate).map(e => {
    return {
      key: e.id,
      dot: getColor(e),
      dates: new Date(e.start_datetime * 1000)
    };
  }));
  attributes = attributes.concat(_events.filter(e => e.multidate).map(e => ({
    key: e.id,
    highlight: {
      start: getColor(e),
      base: getColor(e, 'base'),
      end: getColor(e)
    },
    dates: {
      start: new Date(e.start_datetime * 1000),
      end: new Date(e.end_datetime * 1000)
    }
  })));
  return attributes;
}

/***/ }),

/***/ 99:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(105);
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add CSS to SSR context
var add = __webpack_require__(6).default
module.exports.__inject__ = function (context) {
  add("26fcc303", content, true, context)
};

/***/ })

};;
//# sourceMappingURL=DateInput.js.map