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

/***/ 120:
/***/ (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/event/eventAdmin.vue?vue&type=template&id=0fb969f7&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.event.is_visible)?_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){return _vm.toggle(false)}}},[_vm._v(_vm._s(_vm.$t(("common." + (_vm.event.parentId?'skip':'hide')))))]):_c('v-btn',{attrs:{"text":"","color":"success"},on:{"click":function($event){return _vm.toggle(false)}}},[_c('v-icon',{attrs:{"color":"yellow"}},[_vm._v("mdi-alert")]),_vm._v(" "+_vm._s(_vm.$t('common.confirm')))],1),_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){return _vm.$router.push(("/add/" + (_vm.event.id)))}}},[_vm._v(_vm._s(_vm.$t('common.edit')))]),(!_vm.event.parentId)?_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){return _vm.remove(false)}}},[_vm._v(_vm._s(_vm.$t('common.remove')))]):_vm._e(),(_vm.event.parentId)?[_c('v-divider'),_vm._ssrNode("<span class=\"mr-1\">","</span>",[_c('v-icon',[_vm._v("mdi-repeat")]),_vm._ssrNode(_vm._ssrEscape(" "+_vm._s(_vm.$t('event.edit_recurrent'))))],2),(_vm.event.parent.is_visible)?_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){return _vm.toggle(true)}}},[_vm._v(_vm._s(_vm.$t('common.pause')))]):_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){return _vm.toggle(true)}}},[_vm._v(_vm._s(_vm.$t('common.start')))]),_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){return _vm.$router.push(("/add/" + (_vm.event.parentId)))}}},[_vm._v(_vm._s(_vm.$t('common.edit')))]),_c('v-btn',{attrs:{"text":"","color":"primary"},on:{"click":function($event){return _vm.remove(true)}}},[_vm._v(_vm._s(_vm.$t('common.remove')))])]:_vm._e()],2)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/event/eventAdmin.vue?vue&type=template&id=0fb969f7&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!./pages/event/eventAdmin.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var eventAdminvue_type_script_lang_js_ = ({
  name: 'EventAdmin',
  props: {
    event: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    async remove(parent = false) {
      const ret = await this.$root.$confirm(`event.remove_${parent ? 'recurrent_' : ''}confirmation`);

      if (!ret) {
        return;
      }

      const id = parent ? this.event.parentId : this.event.id;
      await this.$axios.delete(`/event/${id}`);
      this.$router.replace('/');
    },

    async toggle(parent = false) {
      const id = parent ? this.event.parentId : this.event.id;
      const is_visible = parent ? this.event.parent.is_visible : this.event.is_visible;
      const method = is_visible ? 'unconfirm' : 'confirm';

      try {
        await this.$axios.$put(`/event/${method}/${id}`);

        if (parent) {
          this.event.parent.is_visible = !is_visible;
        } else {
          this.event.is_visible = !is_visible;
        }
      } catch (e) {
        console.error(e);
      }
    }

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

// CONCATENATED MODULE: ./pages/event/eventAdmin.vue





/* normalize component */

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

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

/***/ })

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