{"version":3,"sources":["webpack:///./src/components/Vouchers/ModalDeleteVoucher.vue","webpack:///src/components/Vouchers/ModalDeleteVoucher.vue","webpack:///./src/components/Vouchers/ModalDeleteVoucher.vue?69eb","webpack:///./src/components/Vouchers/ModalDeleteVoucher.vue?2027"],"names":["render","_vm","this","_c","_self","attrs","$t","isDeleting","isDeletingSuccess","isDeletingError","isDeleteConfirmed","onClickCancel","deleteVoucher","showModal","on","scopedSlots","_u","key","fn","staticClass","_v","_s","name","voucher","Name","model","value","callback","$$v","expression","proxy","slot","staticRenderFns","BaseCheckbox","components","props","type","Boolean","default","Function","required","Object","data","locationId","Number","$route","params","mVoucher","computed","created","JSON","parse","stringify","methods","_this","self","voucherProvider","deleteVoucherLocation","Id","then","response","status","setTimeout","$emit","catch","error","finally","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAAG,iDAAiD,sBAAwB,YAAY,mBAAqBL,EAAIK,GAAG,uBAAuB,SAAWL,EAAIM,WAAW,gBAAkBN,EAAIO,kBAAkB,cAAgBP,EAAIQ,gBAAgB,kBAAoBR,EAAIQ,iBAAmBR,EAAIO,kBAAkB,mBAAqBP,EAAIS,kBAAkB,cAAgBT,EAAIU,cAAc,YAAcV,EAAIW,cAAc,UAAYX,EAAIY,UAAU,qBAAuBZ,EAAIK,GAAG,8DAA8DQ,GAAG,CAAC,WAAab,EAAIU,eAAeI,YAAYd,EAAIe,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CAACf,EAAG,MAAM,CAACgB,YAAY,iDAAiD,CAAClB,EAAImB,GAAG,IAAInB,EAAIoB,GAAGpB,EAAIK,GAAG,oEAAsE,CAAEgB,KAAMrB,EAAIsB,QAAQC,QAAU,OAAOrB,EAAG,MAAM,CAACgB,YAAY,qBAAqB,CAAChB,EAAG,eAAe,CAACgB,YAAY,gBAAgBd,MAAM,CAAC,MAAQJ,EAAIK,GAAG,gEAAgEmB,MAAM,CAACC,MAAOzB,EAAIS,kBAAmBiB,SAAS,SAAUC,GAAM3B,EAAIS,kBAAkBkB,GAAKC,WAAW,wBAAwB,KAAKC,OAAM,MAAS,CAAC3B,EAAG,WAAW,CAAC4B,KAAK,gBAAgB,IAEpxCC,EAAkB,G,oFC2CtBC,EAAA,kBACA,8GAIe,GACfC,WAAA,CACAD,gBAGAE,MAAA,CACAtB,UAAA,CACAuB,KAAAC,QACAC,SAAA,GAGA3B,cAAA,CACAyB,KAAAG,SACAC,UAAA,GAGAjB,QAAA,CACAa,KAAAK,OACAH,QAAA,OAIAI,KAAA,WACA,OACAnC,YAAA,EACAC,mBAAA,EACAC,iBAAA,EACAC,mBAAA,EACAiC,WAAAC,OAAA,KAAAC,OAAAC,OAAAH,YACAI,SAAA,OAIAC,SAAA,GAEAC,QAAA,WACA,KAAAF,SAAAG,KAAAC,MAAAD,KAAAE,UAAA,KAAA7B,WAGA8B,QAAA,CACAzC,cAAA,eAAA0C,EAAA,KACAC,EAAA,KAEAA,EAAAhD,aACAgD,EAAAhD,YAAA,EAEAiD,OAAAH,QACAI,sBAAA,KAAAV,SAAAW,GAAA,KAAAf,YACAgB,MAAA,SAAAC,GACAN,EAAA9C,mBAAA,EAEA,MAAAoD,EAAAC,QACAC,YAAA,WACAR,EAAAS,MAAA,iBAAAH,EAAAlB,MACAY,EAAA3C,kBACA,SAGAqD,OAAA,SAAAC,GACAX,EAAA7C,iBAAA,KAEAyD,SAAA,WACAZ,EAAA/C,YAAA,SChH0W,I,YCOtW4D,EAAY,eACd,EACAnE,EACAgC,GACA,EACA,KACA,KACA,MAIa,aAAAmC,E","file":"js/chunk-2d0bdd6c.js?id=dada5286f5f4b0d41475","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t('Components.Vouchers.DeleteVoucher.Modal_Title'),\"confirmButtonCssClass\":\"is-danger\",\"buttonLabelConfirm\":_vm.$t('Form.Control.Delete'),\"isSaving\":_vm.isDeleting,\"isSavingSuccess\":_vm.isDeletingSuccess,\"isSavingError\":_vm.isDeletingError,\"hideFooterButtons\":_vm.isDeletingError || _vm.isDeletingSuccess,\"disableSaveButton\":!_vm.isDeleteConfirmed,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.deleteVoucher,\"showModal\":_vm.showModal,\"savingSuccessMessage\":_vm.$t(`Components.Vouchers.DeleteVoucher.Message_DeletingSuccess`)},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',{staticClass:\"has-margin-bottom is-size-5 has-text-centered\"},[_vm._v(\" \"+_vm._s(_vm.$t( `Components.Vouchers.DeleteVoucher.Message_AreYouSureVoucherDelete`, { name: _vm.voucher.Name } ))+\" \")]),_c('div',{staticClass:\"has-text-centered\"},[_c('BaseCheckbox',{staticClass:\"has-text-left\",attrs:{\"label\":_vm.$t(`Components.Vouchers.DeleteVoucher.Checkbox_Option_YesImSure`)},model:{value:(_vm.isDeleteConfirmed),callback:function ($$v) {_vm.isDeleteConfirmed=$$v},expression:\"isDeleteConfirmed\"}})],1)]},proxy:true}])},[_c('template',{slot:\"modalTitle\"})],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    :modalTitle=\"$t('Components.Vouchers.DeleteVoucher.Modal_Title')\"\n    confirmButtonCssClass=\"is-danger\"\n    :buttonLabelConfirm=\"$t('Form.Control.Delete')\"\n    :isSaving=\"isDeleting\"\n    :isSavingSuccess=\"isDeletingSuccess\"\n    :isSavingError=\"isDeletingError\"\n    :hideFooterButtons=\"isDeletingError || isDeletingSuccess\"\n    :disableSaveButton=\"!isDeleteConfirmed\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"deleteVoucher\"\n    :showModal=\"showModal\"\n    :savingSuccessMessage=\"$t(`Components.Vouchers.DeleteVoucher.Message_DeletingSuccess`)\"\n    @closeModal=\"onClickCancel\"\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(\n            `Components.Vouchers.DeleteVoucher.Message_AreYouSureVoucherDelete`, { name: voucher.Name }\n          )\n        }}\n      </div>\n\n      <div class=\"has-text-centered\">\n        <BaseCheckbox\n          v-model=\"isDeleteConfirmed\"\n          class=\"has-text-left\"\n          :label=\"\n            $t(`Components.Vouchers.DeleteVoucher.Checkbox_Option_YesImSure`)\n          \"\n        />\n      </div>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport Vue from 'vue'\nimport { mapState, mapMutations } from 'vuex'\nimport { EventBus } from '@/eventbus/event-bus'\nimport voucherProvider from '@/providers/voucher'\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    voucher: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      isDeleting: false,\n      isDeletingSuccess: false,\n      isDeletingError: false,\n      isDeleteConfirmed: false,\n      locationId: Number(this.$route.params.locationId),\n      mVoucher: null,\n    }\n  },\n\n  computed: {},\n\n  created() {\n    this.mVoucher = JSON.parse(JSON.stringify(this.voucher))\n  },\n\n  methods: {\n    deleteVoucher() {\n      let self = this\n\n      if (!self.isDeleting) {\n        self.isDeleting = true\n\n        voucherProvider.methods\n          .deleteVoucherLocation(this.mVoucher.Id, this.locationId)\n          .then((response) => {\n            this.isDeletingSuccess = true\n\n            if (response.status === 200) {\n              setTimeout(() => {\n                this.$emit('voucherDeleted', response.data)\n                this.onClickCancel()\n              }, 1500)\n            }\n          })\n          .catch((error) => {\n            this.isDeletingError = true\n          })\n          .finally(() => {\n            this.isDeleting = false\n          })\n      }\n    },\n  },\n}\n</script>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../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!./ModalDeleteVoucher.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../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!./ModalDeleteVoucher.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalDeleteVoucher.vue?vue&type=template&id=484d941f\"\nimport script from \"./ModalDeleteVoucher.vue?vue&type=script&lang=js\"\nexport * from \"./ModalDeleteVoucher.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\nexport default component.exports"],"sourceRoot":""}