{"version":3,"sources":["webpack:///src/components/Reservations/ModalRevertRevision.vue","webpack:///./src/components/Reservations/ModalRevertRevision.vue","webpack:///./src/components/Reservations/ModalRevertRevision.vue?dbf3","webpack:///./src/components/Reservations/ModalRevertRevision.vue?a394","webpack:///./src/components/Reservations/ModalRevertRevision.vue?e602"],"names":["BaseCheckbox","components","props","showModal","type","Boolean","default","onClickCancel","Function","required","revision","Object","data","changeAllInSet","isConfirmed","isSaving","isSavingError","responseMessage","computed","_objectSpread","mapState","created","methods","mapMutations","revertReservation","_this","self","reservationProvider","revertReservationRevision","ReservationId","Id","then","response","status","setReservation","$emit","EventBus","message","$t","catch","error","Value","finally","render","_vm","_c","_self","attrs","modalTitle","hideFooterButtons","disableSaveButton","onClickSave","savingErrorMessage","on","closeModal","scopedSlots","_u","key","fn","staticClass","_v","_s","label","model","value","callback","$$v","expression","proxy","slot","staticRenderFns","_withStripped"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoCA;AACA;AACA;AAEA,IAAAA,YAAA,YAAAA,aAAA;EAAA,OACA,sXAEA;AAAA;AAEe;EACfC,UAAA;IACAD,YAAA,EAAAA;EACA;EAEAE,KAAA;IACAC,SAAA;MACAC,IAAA,EAAAC,OAAA;MACAC,OAAA;IACA;IAEAC,aAAA;MACAH,IAAA,EAAAI,QAAA;MACAC,QAAA;IACA;IAEAC,QAAA;MACAN,IAAA,EAAAO,MAAA;MACAL,OAAA;IACA;EACA;EAEAM,IAAA,WAAAA,KAAA;IACA;MACAC,cAAA;MACAC,WAAA;MACAC,QAAA;MACAC,aAAA;MACAC,eAAA;IACA;EACA;EAEAC,QAAA,EAAAC,iIAAA,KACAC,6DAAA,sCACA;EAEAC,OAAA,WAAAA,QAAA;EAEAC,OAAA,EAAAH,iIAAA,CAAAA,iIAAA,KACAI,iEAAA;IAEAC,iBAAA,WAAAA,kBAAA;MAAA,IAAAC,KAAA;MACA,IAAAC,IAAA;MAEA,KAAAA,IAAA,CAAAX,QAAA;QACAW,IA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AAiG;AAC3B;AACL;;;AAGjE;AAC6F;AAC7F,gBAAgB,mHAAU;AAC1B,EAAE,gGAAM;AACR,EAAE,qGAAM;AACR,EAAE,8GAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;;ACtCf;AAA2S,CAAgB,qVAAG,EAAC,C;;;;;;;;;;;;;ACA/T;AAAA;AAAA;AAAA;AAAA","file":"js/396.js?id=e7ba472abb4c3c7a6dda","sourcesContent":["<template>\n  <ui-component-modal\n    :modalTitle=\"$t('Components.Reservations.ModalRevertRevision.Modal_Title')\"\n    :isSaving=\"isSaving\"\n    :isSavingError=\"isSavingError\"\n    :hideFooterButtons=\"isSavingError\"\n    :disableSaveButton=\"!isConfirmed\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"revertReservation\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n    :savingErrorMessage=\"\n      $t('Components.Reservations.ModalRevertRevision.Message_Error', {\n        responseMessage: responseMessage,\n      })\n    \"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div class=\"has-margin-bottom is-size-5 has-text-centered\">\n        {{\n          $t('Components.Reservations.ModalRevertRevision.Article_AreYouSure')\n        }}\n      </div>\n      <div class=\"has-text-centered\">\n        <BaseCheckbox\n          v-model=\"isConfirmed\"\n          class=\"has-text-left\"\n          :label=\"$t('Components.Options.ModalDeleteOption.Text_YesSure')\"\n        />\n      </div>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport { mapState, mapMutations } from 'vuex'\nimport { EventBus } from '@/eventbus/event-bus'\nimport reservationProvider from '@/providers/reservation'\n\nconst BaseCheckbox = () =>\n  import(\n    /* webpackChunkName: \"settings-options\" */ '@/components/UI/Form/BaseCheckbox'\n  )\n\nexport default {\n  components: {\n    BaseCheckbox,\n  },\n\n  props: {\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n\n    revision: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      changeAllInSet: false,\n      isConfirmed: false,\n      isSaving: false,\n      isSavingError: false,\n      responseMessage: '',\n    }\n  },\n\n  computed: {\n    ...mapState('reservationStore', ['reservation']),\n  },\n\n  created() {},\n\n  methods: {\n    ...mapMutations('reservationStore', ['setReservation']),\n\n    revertReservation() {\n      let self = this\n\n      if (!self.isSaving) {\n        self.isSaving = true\n\n        reservationProvider.methods\n          .revertReservationRevision(\n            self.revision.ReservationId,\n            self.revision.Id\n          )\n          .then((response) => {\n            if (response.status === 200) {\n              // Update reservation store\n              self.setReservation(response.data)\n\n              self.$emit('reservationReverted', self.revision)\n\n              // Send message to be shown as toast on page\n              EventBus.$emit('showToast', {\n                type: 'info',\n                message: this.$t('General.Toast_ReservationUpdated'),\n              })\n\n              self.onClickCancel()\n            }\n          })\n          .catch((error) => {\n            self.isSavingError = true\n            self.responseMessage = error.response.data.Value\n          })\n          .finally(() => {\n            self.isSaving = false\n          })\n      }\n    },\n  },\n}\n</script>\n","var render = function render() {\n  var _vm = this,\n    _c = _vm._self._c\n  return _c(\n    \"ui-component-modal\",\n    {\n      attrs: {\n        modalTitle: _vm.$t(\n          \"Components.Reservations.ModalRevertRevision.Modal_Title\"\n        ),\n        isSaving: _vm.isSaving,\n        isSavingError: _vm.isSavingError,\n        hideFooterButtons: _vm.isSavingError,\n        disableSaveButton: !_vm.isConfirmed,\n        onClickCancel: _vm.onClickCancel,\n        onClickSave: _vm.revertReservation,\n        showModal: _vm.showModal,\n        savingErrorMessage: _vm.$t(\n          \"Components.Reservations.ModalRevertRevision.Message_Error\",\n          {\n            responseMessage: _vm.responseMessage,\n          }\n        ),\n      },\n      on: { closeModal: _vm.onClickCancel },\n      scopedSlots: _vm._u([\n        {\n          key: \"content\",\n          fn: function () {\n            return [\n              _c(\n                \"div\",\n                {\n                  staticClass: \"has-margin-bottom is-size-5 has-text-centered\",\n                },\n                [\n                  _vm._v(\n                    \" \" +\n                      _vm._s(\n                        _vm.$t(\n                          \"Components.Reservations.ModalRevertRevision.Article_AreYouSure\"\n                        )\n                      ) +\n                      \" \"\n                  ),\n                ]\n              ),\n              _c(\n                \"div\",\n                { staticClass: \"has-text-centered\" },\n                [\n                  _c(\"BaseCheckbox\", {\n                    staticClass: \"has-text-left\",\n                    attrs: {\n                      label: _vm.$t(\n                        \"Components.Options.ModalDeleteOption.Text_YesSure\"\n                      ),\n                    },\n                    model: {\n                      value: _vm.isConfirmed,\n                      callback: function ($$v) {\n                        _vm.isConfirmed = $$v\n                      },\n                      expression: \"isConfirmed\",\n                    },\n                  }),\n                ],\n                1\n              ),\n            ]\n          },\n          proxy: true,\n        },\n      ]),\n    },\n    [_c(\"template\", { slot: \"modalTitle\" })],\n    2\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./ModalRevertRevision.vue?vue&type=template&id=5fc8fc14\"\nimport script from \"./ModalRevertRevision.vue?vue&type=script&lang=js\"\nexport * from \"./ModalRevertRevision.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\n/* hot reload */\nif (module.hot) {\n  var api = require(\"/github/workspace/node_modules/vue-hot-reload-api/dist/index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('5fc8fc14')) {\n      api.createRecord('5fc8fc14', component.options)\n    } else {\n      api.reload('5fc8fc14', component.options)\n    }\n    module.hot.accept(\"./ModalRevertRevision.vue?vue&type=template&id=5fc8fc14\", function () {\n      api.rerender('5fc8fc14', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"src/components/Reservations/ModalRevertRevision.vue\"\nexport default component.exports","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalRevertRevision.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalRevertRevision.vue?vue&type=script&lang=js\"","export * from \"-!../../../node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"d2a26fb4-vue-loader-template\\\"}!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalRevertRevision.vue?vue&type=template&id=5fc8fc14\""],"sourceRoot":""}