exports.ids = [33,28,30,31,32];
exports.modules = {

/***/ 100:
/***/ (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__(107);
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("52122ee5", content, true, context)
};

/***/ }),

/***/ 101:
/***/ (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/Editor.vue?vue&type=template&id=d9da8166&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"editor",class:_vm.focused},[_vm._ssrNode("<div class=\"label\">"+_vm._ssrEscape(_vm._s(_vm.label))+"</div>"),_c('editor-menu-bar',{staticClass:"menubar is-hidden",attrs:{"editor":_vm.editor,"keep-in-bounds":true},scopedSlots:_vm._u([{key:"default",fn:function(ref){
var commands = ref.commands;
var isActive = ref.isActive;
var getMarkAttrs = ref.getMarkAttrs;
var focused = ref.focused;
return [_c('v-btn-toggle',{attrs:{"dense":""}},[_c('v-btn',{class:{ primary: isActive.bold() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":commands.bold}},[_c('v-icon',[_vm._v("mdi-format-bold")])],1),_c('v-btn',{class:{ primary: isActive.underline() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":commands.underline}},[_c('v-icon',[_vm._v("mdi-format-underline")])],1),_c('v-btn',{class:{ primary: isActive.strike() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":commands.strike}},[_c('v-icon',[_vm._v("mdi-format-strikethrough-variant")])],1),_c('v-btn',{class:{ primary: isActive.italic() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":commands.italic}},[_c('v-icon',[_vm._v("mdi-format-italic")])],1),_c('v-btn',{class:{ primary: isActive.heading({level: 1}) },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":function($event){return commands.heading({level: 1})}}},[_c('v-icon',[_vm._v("mdi-format-header-1")])],1),_c('v-btn',{class:{ primary: isActive.heading({level: 2}) },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":function($event){return commands.heading({level: 2})}}},[_c('v-icon',[_vm._v("mdi-format-header-2")])],1),_c('v-btn',{class:{ primary: isActive.heading({level: 3}) },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":function($event){return commands.heading({level: 3})}}},[_c('v-icon',[_vm._v("mdi-format-header-3")])],1),_c('v-btn',{class:{ primary: isActive.code() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":commands.code}},[_c('v-icon',[_vm._v("mdi-code-tags")])],1),_c('v-btn',{class:{ primary: isActive.blockquote() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":commands.blockquote}},[_c('v-icon',[_vm._v("mdi-format-quote-open")])],1),_c('v-btn',{class:{ primary: isActive.bullet_list() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":commands.bullet_list}},[_c('v-icon',[_vm._v("mdi-format-list-bulleted")])],1),_c('v-btn',{class:{ primary: isActive.link() },attrs:{"icon":"","text":"","tabindex":"-1"},on:{"click":function($event){commands.link({href: getMarkAttrs("link") && getMarkAttrs("link").href ? "" : "https://"}); _vm.$refs.link.focus();}}},[_c('v-icon',[_vm._v("mdi-link")])],1),_c('v-text-field',{directives:[{name:"show",rawName:"v-show",value:(isActive.link()),expression:"isActive.link()"}],ref:"link",staticClass:"pt-0 ml-1",attrs:{"hide-details":"","value":isActive.link() && getMarkAttrs("link") && getMarkAttrs("link").href || ""},on:{"focus":_vm.focus,"blur":_vm.blur,"keypress":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }commands.link({ href: $event.target.value}); _vm.editor.focus()}}})],1)]}}])}),_c('editor-content',{staticClass:"content",style:({ 'max-height': _vm.maxHeight }),attrs:{"editor":_vm.editor,"spellcheck":"false"}})],2)}
var staticRenderFns = []


// CONCATENATED MODULE: ./components/Editor.vue?vue&type=template&id=d9da8166&lang=pug&

// EXTERNAL MODULE: external "lodash/debounce"
var debounce_ = __webpack_require__(15);
var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);

// EXTERNAL MODULE: external "tiptap"
var external_tiptap_ = __webpack_require__(60);

// EXTERNAL MODULE: external "tiptap-extensions"
var external_tiptap_extensions_ = __webpack_require__(61);

// 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/Editor.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



/* harmony default export */ var Editorvue_type_script_lang_js_ = ({
  name: 'Editor',
  components: {
    EditorContent: external_tiptap_["EditorContent"],
    EditorMenuBar: external_tiptap_["EditorMenuBar"],
    EditorMenuBubble: external_tiptap_["EditorMenuBubble"]
  },
  props: {
    label: {
      type: String,
      default: 'Editor'
    },
    value: {
      type: String,
      default: ''
    },
    border: {
      type: Boolean,
      default: false
    },
    noSave: {
      type: Boolean,
      default: false
    },
    maxHeight: {
      type: String,
      Number,
      default: ''
    },
    placeholder: {
      type: String,
      default: ''
    }
  },

  data() {
    return {
      options: [],
      linkActive: false,
      editor: null,
      blurring: false,
      update: false,
      focused: ''
    };
  },

  watch: {
    value() {
      if (this.update) {
        this.update = false;
        return;
      }

      this.editor.setContent(this.value);
    }

  },

  mounted() {
    this.editor = new external_tiptap_["Editor"]({
      onFocus: () => this.focus(),
      onBlur: () => this.blur(),
      onUpdate: debounce_default()(({
        getHTML
      }) => {
        this.update = true;
        this.$emit('input', getHTML());
      }, 1000),
      content: this.value,
      extensions: [new external_tiptap_extensions_["Blockquote"](), new external_tiptap_extensions_["BulletList"](), new external_tiptap_extensions_["CodeBlock"](), new external_tiptap_extensions_["HardBreak"](), new external_tiptap_extensions_["Heading"]({
        levels: [1, 2, 3, 4, 5, 6]
      }), new external_tiptap_extensions_["OrderedList"](), new external_tiptap_extensions_["ListItem"](), new external_tiptap_extensions_["Code"](), new external_tiptap_extensions_["History"](), new external_tiptap_extensions_["Link"]({
        openOnClick: false,
        target: '_blank'
      }), new external_tiptap_extensions_["Bold"](), new external_tiptap_extensions_["Italic"](), new external_tiptap_extensions_["Strike"](), new external_tiptap_extensions_["Underline"](), new external_tiptap_extensions_["Placeholder"]({
        emptyEditorClass: 'is-editor-empty',
        emptyNodeClass: 'is-empty',
        emptyNodeText: this.placeholder,
        showOnlyWhenEditable: true,
        showOnlyCurrent: true
      })]
    });
  },

  beforeDestroy() {
    if (this.editor) {
      this.editor.destroy();
    }
  },

  methods: {
    blur() {
      this.blurring = true;
      window.setTimeout(() => {
        if (this.blurring) {
          this.focused = '';
          this.blurring = false;
        }
      }, 200);
    },

    focus() {
      this.focused = 'editor--focused';
      this.$nextTick(() => {
        this.blurring = false;
      });
    }

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

// CONCATENATED MODULE: ./components/Editor.vue



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

}

/* normalize component */

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

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

/***/ }),

/***/ 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___;


/***/ }),

/***/ 106:
/***/ (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_MediaInput_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(100);
/* 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_MediaInput_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_MediaInput_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_MediaInput_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_MediaInput_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 107:
/***/ (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, ".cursorPointer{cursor:crosshair}.img{width:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:top;object-position:top;aspect-ratio:1.7778}#focalPointSelector{position:relative;cursor:move;overflow:hidden;display:flex;height:100%;justify-self:center;align-items:center}#focalPointSelector img{width:100%}.focalPoint{position:absolute;width:50px;height:50px;top:100px;left:100px;transform:translate(-25px,-25px);border-radius:50%;border:1px solid rgba(255,109,64,.55686);box-shadow:0 0 0 9999em rgba(0,0,0,.65)}", ""]);
// 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);

/***/ }),

/***/ 117:
/***/ (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/ImportDialog.vue?vue&type=template&id=0fb47312&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-card',[_c('v-card-title',[_vm._v(_vm._s(_vm.$t('common.import')))]),_c('v-card-text',[_c('p',{domProps:{"innerHTML":_vm._s(_vm.$t('event.import_description'))}}),_c('v-form',{ref:"form",attrs:{"lazy-validation":""},on:{"submit":function($event){$event.preventDefault();return _vm.importGeneric.apply(null, arguments)}},model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:"valid"}},[_c('v-row',[_c('div',{staticClass:"col-xl-5 col-lg-5 col-md-7 col-sm-12 col-xs-12"},[_c('v-text-field',{attrs:{"label":_vm.$t('common.url'),"hint":_vm.$t('event.import_URL'),"persistent-hint":"","loading":_vm.loading,"error":_vm.error,"error-messages":_vm.errorMessage},model:{value:(_vm.URL),callback:function ($$v) {_vm.URL=$$v},expression:"URL"}})],1),_c('div',{staticClass:"col"},[_c('v-file-input',{attrs:{"accept":".ics","label":_vm.$t('event.ics'),"hint":_vm.$t('event.import_ICS'),"persistent-hint":""},model:{value:(_vm.file),callback:function ($$v) {_vm.file=$$v},expression:"file"}})],1)])],1)],1),_c('v-card-actions',[_c('v-spacer'),_c('v-btn',{attrs:{"text":"","color":"warning"},on:{"click":function($event){return _vm.$emit("close")}}},[_vm._v(_vm._s(_vm.$t('common.cancel')))]),_c('v-btn',{attrs:{"text":"","loading":_vm.loading,"disabled":_vm.loading,"color":"primary"},on:{"click":_vm.importGeneric}},[_vm._v(_vm._s(_vm.$t('common.import')))])],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/add/ImportDialog.vue?vue&type=template&id=0fb47312&lang=pug&

// EXTERNAL MODULE: external "ical.js"
var external_ical_js_ = __webpack_require__(64);
var external_ical_js_default = /*#__PURE__*/__webpack_require__.n(external_ical_js_);

// EXTERNAL MODULE: external "lodash/get"
var get_ = __webpack_require__(59);
var get_default = /*#__PURE__*/__webpack_require__.n(get_);

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

// 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/ImportDialog.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



/* harmony default export */ var ImportDialogvue_type_script_lang_js_ = ({
  name: 'ImportDialog',

  data() {
    return {
      file: null,
      errorMessage: '',
      error: false,
      loading: false,
      valid: false,
      URL: '',
      event: {}
    };
  },

  computed: Object(external_vuex_["mapState"])(['places']),
  methods: {
    importGeneric() {
      if (this.file) {
        this.importICS();
      } else {
        this.importURL();
      }
    },

    importICS() {
      const reader = new FileReader();
      reader.readAsText(this.file);

      reader.onload = () => {
        const ret = external_ical_js_default.a.parse(reader.result);
        const component = new external_ical_js_default.a.Component(ret);
        const events = component.getAllSubcomponents('vevent');
        const event = new external_ical_js_default.a.Event(events[0]);
        this.event = {
          title: get_default()(event, 'summary', ''),
          description: get_default()(event, 'description', ''),
          place: {
            name: get_default()(event, 'location', '')
          },
          start_datetime: get_default()(event, 'startDate', '').toUnixTime(),
          end_datetime: get_default()(event, 'endDate', '').toUnixTime()
        };
        this.$emit('imported', this.event);
      };
    },

    async importURL() {
      if (!this.URL) {
        this.errorMessage = this.$validators.required('common.url')('');
        this.error = true;
        return;
      }

      if (!this.URL.match(/^https?:\/\//)) {
        this.URL = `https://${this.URL}`;
      }

      this.error = false;
      this.errorMessage = '';
      this.loading = true;

      try {
        const ret = await this.$axios.$get('/event/import', {
          params: {
            URL: this.URL
          }
        });
        this.events = ret; // check if contain an h-event

        this.$emit('imported', ret[0]);
      } catch (e) {
        this.error = true;
        this.errorMessage = String(e);
      }

      this.loading = false;
    }

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

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





/* normalize component */

var ImportDialog_component = Object(componentNormalizer["a" /* default */])(
  add_ImportDialogvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "700b9782"
  
)

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

/***/ }),

/***/ 118:
/***/ (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/WhereInput.vue?vue&type=template&id=a089215e&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-row',[_c('v-col',{attrs:{"cols":"12","md":"6"}},[_c('v-combobox',{ref:"place",attrs:{"rules":[_vm.$validators.required('common.where')],"label":_vm.$t('common.where'),"hint":_vm.$t('event.where_description'),"search-input":_vm.placeName,"prepend-icon":"mdi-map-marker","persistent-hint":"","value":_vm.value.name,"items":_vm.filteredPlaces,"no-filter":"","item-text":"name"},on:{"update:searchInput":function($event){_vm.placeName=$event},"update:search-input":function($event){_vm.placeName=$event},"change":_vm.selectPlace},scopedSlots:_vm._u([{key:"item",fn:function(ref){
var item = ref.item;
return [(item.create)?_c('v-list-item-content',{attrs:{"two-line":""}},[_c('v-list-item-title',[_c('v-icon',{attrs:{"color":"primary"}},[_vm._v("mdi-plus")]),_vm._v(" "+_vm._s(item.name))],1)],1):_c('v-list-item-content',{attrs:{"two-line":""}},[_c('v-list-item-title',[_vm._v(_vm._s(item.name))]),_c('v-list-item-subtitle',[_vm._v(_vm._s(item.address))])],1)]}}])})],1),_c('v-col',{attrs:{"cols":"12","md":"6"}},[_c('v-text-field',{ref:"address",attrs:{"prepend-icon":"mdi-map","disabled":_vm.disableAddress,"rules":[ function (v) { return _vm.disableAddress ? true : _vm.$validators.required('common.address')(v); }],"label":_vm.$t('common.address'),"value":_vm.value.address},on:{"change":_vm.changeAddress}})],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/add/WhereInput.vue?vue&type=template&id=a089215e&lang=pug&

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

// 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/WhereInput.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/* harmony default export */ var WhereInputvue_type_script_lang_js_ = ({
  name: 'WhereInput',
  props: {
    value: {
      type: Object,
      default: () => {}
    }
  },

  data() {
    return {
      place: {},
      placeName: '',
      disableAddress: true
    };
  },

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

    filteredPlaces() {
      if (!this.placeName) {
        return this.places;
      }

      const placeName = this.placeName.toLowerCase();
      let nameMatch = false;
      const matches = this.places.filter(p => {
        const tmpName = p.name.toLowerCase();
        const tmpAddress = p.address.toLowerCase();

        if (tmpName.includes(placeName)) {
          if (tmpName === placeName) {
            nameMatch = true;
          }

          return true;
        }

        if (tmpAddress.includes(placeName)) {
          return true;
        }

        return false;
      });

      if (!nameMatch) {
        matches.unshift({
          create: true,
          name: this.placeName
        });
      }

      return matches;
    }

  },
  methods: {
    selectPlace(p) {
      if (!p) {
        return;
      }

      if (typeof p === 'object' && !p.create) {
        this.place.name = p.name;
        this.place.address = p.address;
        this.disableAddress = true;
      } else {
        // this is a new place
        this.place.name = p.name || p; // search for a place with the same name

        const place = this.places.find(p => p.name === this.place.name);

        if (place) {
          this.place.address = place.address;
          this.disableAddress = true;
        } else {
          this.place.address = '';
          this.disableAddress = false;
          this.$refs.place.blur();
          this.$refs.address.focus();
        }
      }

      this.$emit('input', { ...this.place
      });
    },

    changeAddress(v) {
      this.place.address = v;
      this.$emit('input', { ...this.place
      });
    }

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

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





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  add_WhereInputvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "726b9d95"
  
)

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

/***/ }),

/***/ 123:
/***/ (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/MediaInput.vue?vue&type=template&id=c3476064&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',[_c('v-dialog',{attrs:{"fullscreen":_vm.$vuetify.breakpoint.xsOnly,"width":"1000px"},model:{value:(_vm.openMediaDetails),callback:function ($$v) {_vm.openMediaDetails=$$v},expression:"openMediaDetails"}},[_c('v-card',[_c('v-card-title',[_vm._v(_vm._s(_vm.$t('common.media')))]),_c('v-card-text',[_c('v-row',{staticClass:"mt-1"},[_c('v-col',{attrs:{"id":"focalPointSelector"},on:{"mousedown":_vm.handleStart,"touchstart":_vm.handleStart,"mousemove":_vm.handleMove,"touchmove":_vm.handleMove,"mouseup":_vm.handleStop,"touchend":_vm.handleStop}},[_c('div',{staticClass:"focalPoint",style:({ top: _vm.top, left: _vm.left })}),(_vm.mediaPreview)?_c('img',{attrs:{"src":_vm.mediaPreview}}):_vm._e()]),_c('v-col',{staticClass:"col-12 col-sm-4"},[_c('p',[_vm._v(_vm._s(_vm.$t('event.choose_focal_point')))]),(_vm.mediaPreview)?_c('img',{staticClass:"img d-none d-sm-block",style:({ 'object-position': _vm.position }),attrs:{"src":_vm.mediaPreview}}):_vm._e(),_c('v-textarea',{staticClass:"mt-4",attrs:{"type":"text","label":"Alternative text","persistent-hint":"","value":_vm.value.name,"filled":"","hint":_vm.$t("event.alt_text_description")},on:{"input":function (v) { return _vm.name=v; }}}),_c('br'),_c('v-card-actions',{staticClass:"justify-space-between"},[_c('v-btn',{attrs:{"text":"","color":"warning"},on:{"click":function($event){_vm.openMediaDetails=false}}},[_vm._v("Cancel")]),_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":_vm.save}},[_vm._v("Save")])],1)],1)],1)],1)],1)],1),_vm._ssrNode(((_vm.mediaPreview)?("<h3 class=\"mb-3 font-weight-regular\">"+_vm._ssrEscape(_vm._s(_vm.$t('common.media')))+"</h3>"):"<!---->")),(_vm.mediaPreview)?_c('v-card-actions',[_c('v-spacer'),_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){_vm.openMediaDetails = true}}},[_vm._v(_vm._s(_vm.$t('common.edit')))]),_c('v-btn',{attrs:{"text":"","color":"error"},on:{"click":_vm.remove}},[_vm._v(_vm._s(_vm.$t('common.remove')))])],1):_vm._e(),(_vm.mediaPreview)?_vm._ssrNode("<div>","</div>",[_vm._ssrNode("<img"+(_vm._ssrAttr("src",_vm.mediaPreview))+" class=\"img col-12 ml-3\""+(_vm._ssrStyle(null,{ 'object-position': _vm.savedPosition }, null))+"><span class=\"float-right\">"+_vm._ssrEscape(_vm._s(_vm.event.media[0].name))+"</span>")],2):_c('v-file-input',{attrs:{"label":_vm.$t('common.media'),"hint":_vm.$t('event.media_description'),"prepend-icon":"mdi-camera","value":_vm.value.image,"persistent-hint":"","accept":"image/*"},on:{"change":_vm.selectMedia}})],2)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/add/MediaInput.vue?vue&type=template&id=c3476064&lang=pug&

// EXTERNAL 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/MediaInput.vue?vue&type=script&lang=js&
var MediaInputvue_type_script_lang_js_ = __webpack_require__(95);

// CONCATENATED MODULE: ./pages/add/MediaInput.vue?vue&type=script&lang=js&
 /* harmony default export */ var add_MediaInputvue_type_script_lang_js_ = (MediaInputvue_type_script_lang_js_["a" /* default */]); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

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



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

}

/* normalize component */

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

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

/***/ }),

/***/ 143:
/***/ (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/_edit.vue?vue&type=template&id=2bc047c4&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',{staticClass:"container px-0 px-md-3"},[_c('v-card',[_c('v-card-title',[_c('h4',[_vm._v(_vm._s(_vm.edit?_vm.$t('common.edit_event'):_vm.$t('common.add_event')))]),_c('v-spacer'),_c('v-btn',{attrs:{"link":"","text":"","color":"primary"},on:{"click":function($event){_vm.openImportDialog=true}}},[_c('v-icon',[_vm._v("mdi-file-import")]),_vm._v(" "+_vm._s(_vm.$t('common.import')))],1)],1),_c('v-dialog',{attrs:{"fullscreen":_vm.$vuetify.breakpoint.xsOnly},model:{value:(_vm.openImportDialog),callback:function ($$v) {_vm.openImportDialog=$$v},expression:"openImportDialog"}},[_c('ImportDialog',{on:{"close":function($event){_vm.openImportDialog=false},"imported":_vm.eventImported}})],1),_c('v-card-text',{staticClass:"px-0 px-xs-2"},[_c('v-form',{ref:"form",attrs:{"lazy-validation":""},model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:"valid"}},[_c('v-container',[_c('v-row',[(!_vm.$auth.loggedIn)?_c('v-col',{attrs:{"cols":"12"}},[_c('p',{domProps:{"innerHTML":_vm._s(_vm.$t('event.anon_description'))}})]):_vm._e(),_c('v-col',{attrs:{"cols":"12"}},[_c('v-text-field',{ref:"title",attrs:{"value":_vm.event.title,"rules":[_vm.$validators.required('common.title')],"prepend-icon":"mdi-format-title","label":_vm.$t('common.title'),"autofocus":""},on:{"change":function (v) { return _vm.event.title = v; }}})],1),_c('v-col',{attrs:{"cols":"12"}},[_c('WhereInput',{ref:"where",model:{value:(_vm.event.place),callback:function ($$v) {_vm.$set(_vm.event, "place", $$v)},expression:"event.place"}})],1),_c('DateInput',{attrs:{"event":_vm.event},model:{value:(_vm.date),callback:function ($$v) {_vm.date=$$v},expression:"date"}}),_c('v-col',{staticClass:"px-0",attrs:{"cols":"12"}},[_c('Editor',{staticClass:"px-3 ma-0",attrs:{"label":_vm.$t('event.description_description'),"placeholder":_vm.$t('event.description_description'),"max-height":"400px"},model:{value:(_vm.event.description),callback:function ($$v) {_vm.$set(_vm.event, "description", $$v)},expression:"event.description"}})],1),_c('v-col',{attrs:{"cols":"12","md":"6"}},[_c('MediaInput',{attrs:{"event":_vm.event},on:{"remove":function($event){_vm.event.media=[]}},model:{value:(_vm.event.media[0]),callback:function ($$v) {_vm.$set(_vm.event.media, 0, $$v)},expression:"event.media[0]"}})],1),_c('v-col',{attrs:{"cols":"12","md":"6"}},[_c('v-combobox',{attrs:{"prepend-icon":"mdi-tag-multiple","chips":"","small-chips":"","multiple":"","deletable-chips":"","hide-no-data":"","hide-selected":"","persistent-hint":"","delimiters":[',', ' '],"items":_vm.tags.map(function (t) { return t.tag; }),"label":_vm.$t('common.tags')},model:{value:(_vm.event.tags),callback:function ($$v) {_vm.$set(_vm.event, "tags", $$v)},expression:"event.tags"}})],1)],1)],1)],1)],1),_c('v-card-actions',[_c('v-spacer'),_c('v-btn',{attrs:{"loading":_vm.loading,"disabled":!_vm.valid || _vm.loading,"color":"primary"},on:{"click":_vm.done}},[_vm._v(_vm._s(_vm.edit?_vm.$t('common.save'):_vm.$t('common.send')))])],1)],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/add/_edit.vue?vue&type=template&id=2bc047c4&lang=pug&

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

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

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

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

// EXTERNAL MODULE: ./pages/add/ImportDialog.vue + 4 modules
var ImportDialog = __webpack_require__(117);

// EXTERNAL MODULE: ./pages/add/DateInput.vue + 4 modules
var DateInput = __webpack_require__(116);

// EXTERNAL MODULE: ./pages/add/WhereInput.vue + 4 modules
var WhereInput = __webpack_require__(118);

// EXTERNAL MODULE: ./pages/add/MediaInput.vue + 3 modules
var MediaInput = __webpack_require__(123);

// 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/_edit.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//








/* harmony default export */ var _editvue_type_script_lang_js_ = ({
  name: 'NewEvent',
  components: {
    List: List["a" /* default */],
    Editor: Editor["a" /* default */],
    ImportDialog: ImportDialog["default"],
    MediaInput: MediaInput["default"],
    WhereInput: WhereInput["default"],
    DateInput: DateInput["default"]
  },

  validate({
    store
  }) {
    return store.state.auth.loggedIn || store.state.settings.allow_anon_event;
  },

  async asyncData({
    params,
    $axios,
    error,
    store
  }) {
    if (params.edit) {
      const data = {
        event: {
          place: {},
          media: []
        }
      };
      data.id = params.edit;
      data.edit = true;
      let event;

      try {
        event = await $axios.$get('/event/' + data.id);
      } catch (e) {
        error({
          statusCode: 404,
          message: 'Event not found!'
        });
        return {};
      }

      data.event.place.name = event.place.name;
      data.event.place.address = event.place.address || '';
      data.date = {
        recurrent: event.recurrent,
        from: new Date(external_dayjs_default.a.unix(event.start_datetime)),
        due: new Date(external_dayjs_default.a.unix(event.end_datetime)),
        multidate: event.multidate,
        fromHour: true,
        dueHour: true
      };
      data.event.title = event.title;
      data.event.description = event.description;
      data.event.id = event.id;
      data.event.tags = event.tags;
      data.event.media = event.media || [];
      return data;
    }

    return {};
  },

  data() {
    const month = external_dayjs_default()().month() + 1;
    const year = external_dayjs_default()().year();
    return {
      valid: false,
      openImportDialog: false,
      event: {
        place: {
          name: '',
          address: ''
        },
        title: '',
        description: '',
        tags: [],
        media: []
      },
      page: {
        month,
        year
      },
      fileList: [],
      id: null,
      date: {
        from: null,
        due: null,
        recurrent: null
      },
      edit: false,
      loading: false,
      disableAddress: false
    };
  },

  head() {
    return {
      title: `${this.settings.title} - ${this.$t('common.add_event')}`
    };
  },

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

    eventImported(event) {
      this.event = Object.assign(this.event, event);
      this.$refs.where.selectPlace({
        name: event.place.name,
        create: true
      });
      this.date = {
        recurrent: this.event.recurrent || null,
        from: new Date(external_dayjs_default.a.unix(this.event.start_datetime)),
        due: new Date(external_dayjs_default.a.unix(this.event.end_datetime)),
        multidate: event.multidate,
        fromHour: true,
        dueHour: true
      };
      this.openImportDialog = false;
    },

    async done() {
      if (!this.$refs.form.validate()) {
        this.$nextTick(() => {
          const el = document.querySelector('.v-input.error--text:first-of-type');
          el.scrollIntoView();
        });
        return;
      }

      this.loading = true;
      const formData = new FormData();
      formData.append('recurrent', JSON.stringify(this.date.recurrent));

      if (this.event.media.length) {
        formData.append('image', this.event.media[0].image);
        formData.append('image_url', this.event.media[0].url);
        formData.append('image_name', this.event.media[0].name);
        formData.append('image_focalpoint', this.event.media[0].focalpoint);
      }

      formData.append('title', this.event.title);
      formData.append('place_name', this.event.place.name);
      formData.append('place_address', this.event.place.address);
      formData.append('description', this.event.description);
      formData.append('multidate', !!this.date.multidate);
      formData.append('start_datetime', external_dayjs_default()(this.date.from).unix());
      formData.append('end_datetime', this.date.due ? external_dayjs_default()(this.date.due).unix() : this.date.from.add(2, 'hour').unix());

      if (this.edit) {
        formData.append('id', this.event.id);
      }

      if (this.event.tags) {
        this.event.tags.forEach(tag => formData.append('tags[]', tag.tag || tag));
      }

      try {
        if (this.edit) {
          await this.$axios.$put('/event', formData);
        } else {
          await this.$axios.$post('/event', formData);
        }

        this.updateMeta();
        this.$router.push('/');
        this.$nextTick(() => {
          this.$root.$message(this.$auth.loggedIn ? this.edit ? 'event.saved' : 'event.added' : 'event.added_anon', {
            color: 'success'
          });
        });
      } catch (e) {
        switch (e.request.status) {
          case 413:
            this.$root.$message('event.image_too_big', {
              color: 'error'
            });
            break;

          default:
            this.$root.$message(e.response ? e.response.data : e, {
              color: 'error'
            });
        }

        this.loading = false;
      }
    }

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

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





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  add_editvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "ce4ac8f2"
  
)

/* harmony default export */ var _edit = __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)
};

/***/ }),

/***/ 91:
/***/ (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__(97);
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("7e7f3321", 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___;


/***/ }),

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

"use strict";
/* WEBPACK VAR INJECTION */(function(URL) {//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["a"] = ({
  name: 'MediaInput',
  props: {
    value: {
      type: Object,
      default: () => ({
        image: null
      })
    },
    event: {
      type: Object,
      default: () => {}
    }
  },

  data() {
    return {
      openMediaDetails: false,
      name: this.value.name || '',
      focalpoint: this.value.focalpoint || [0, 0],
      dragging: false
    };
  },

  computed: {
    mediaPreview() {
      if (!this.value.url && !this.value.image) {
        return false;
      }

      const url = this.value.image ? URL.createObjectURL(this.value.image) : /^https?:\/\//.test(this.value.url) ? this.value.url : `/media/thumb/${this.value.url}`;
      return url;
    },

    top() {
      return (this.focalpoint[1] + 1) * 50 + '%';
    },

    left() {
      return (this.focalpoint[0] + 1) * 50 + '%';
    },

    savedPosition() {
      const focalpoint = this.value.focalpoint || [0, 0];
      return `${(focalpoint[0] + 1) * 50}% ${(focalpoint[1] + 1) * 50}%`;
    },

    position() {
      const focalpoint = this.focalpoint || [0, 0];
      return `${(focalpoint[0] + 1) * 50}% ${(focalpoint[1] + 1) * 50}%`;
    }

  },
  methods: {
    save() {
      this.$emit('input', {
        url: this.value.url,
        image: this.value.image,
        name: this.name || this.value.image && this.value.image.name || '',
        focalpoint: [...this.focalpoint]
      });
      this.openMediaDetails = false;
    },

    async remove() {
      const ret = await this.$root.$confirm('event.remove_media_confirmation');

      if (!ret) {
        return;
      }

      this.$emit('remove');
    },

    selectMedia(v) {
      this.$emit('input', {
        image: v,
        name: v.name,
        focalpoint: [0, 0]
      });
    },

    handleStart(ev) {
      ev.preventDefault();
      this.dragging = true;
      this.handleMove(ev, true);
      return false;
    },

    handleStop(ev) {
      this.dragging = false;
    },

    handleMove(ev, manual = false) {
      if (!this.dragging && !manual) return;
      ev.stopPropagation();
      const boundingClientRect = document.getElementById('focalPointSelector').getBoundingClientRect();
      const clientX = ev.changedTouches ? ev.changedTouches[0].clientX : ev.clientX;
      const clientY = ev.changedTouches ? ev.changedTouches[0].clientY : ev.clientY; // get relative coordinate

      let x = Math.ceil(clientX - boundingClientRect.left);
      let y = Math.ceil(clientY - boundingClientRect.top); // snap to border

      x = x < 30 ? 0 : x > boundingClientRect.width - 30 ? boundingClientRect.width : x;
      y = y < 30 ? 0 : y > boundingClientRect.height - 30 ? boundingClientRect.height : y; // this.relativeFocalpoint = [x + 'px', y + 'px']
      // map to real image coordinate

      const posY = -1 + y / boundingClientRect.height * 2;
      const posX = -1 + x / boundingClientRect.width * 2;
      this.focalpoint = [posX, posY];
      return false;
    }

  }
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(62)["URL"]))

/***/ }),

/***/ 96:
/***/ (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_Editor_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91);
/* 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_Editor_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_Editor_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_Editor_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_Editor_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 97:
/***/ (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, ".editor{margin-top:4px;padding-top:12px;padding-bottom:22px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#ff4500 transparent;scroll-behavior:smooth;font-family:sans-serif;font-size:1.1em}.editor .editor p.is-editor-empty:first-child:before{content:attr(data-empty-text);float:left;color:#aaa;pointer-events:none;height:0;font-style:italic}.editor .label{left:0;position:relative;transform-origin:top left;transition:transform .3s,scale .3s,color .3s;transform:translateY(20px)}.editor.editor--focused .label{color:#ff4500;transform:translateY(0) scale(.75)}.editor.editor--focused .menubar{visibility:visible;opacity:1!important}.editor.editor--focused .ProseMirror:after{width:100%!important;transform:scaleX(1)!important}.editor .menubar{transition:opacity .5s;opacity:0;visibility:hidden}.editor .focused .ProseMirror:after{width:100%}.editor .ProseMirror{padding:15px;outline:0}.editor .ProseMirror:before{border:solid hsla(0,0%,100%,.7);border-width:thin 0 0}.editor .ProseMirror:after,.editor .ProseMirror:before{bottom:0;content:\"\";left:0;position:absolute;transition:.3s cubic-bezier(.25,.8,.5,1);width:100%;height:0}.editor .ProseMirror:after{border:solid #ff4500;border-width:2px 0 0;transform:scaleX(0)}", ""]);
// 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=_edit.js.map