{"version":3,"sources":["webpack:///./src/eventbus/event-bus.js","webpack:///./src/components/Settings/Invoice/ModalDeleteInvoiceMailText.vue","webpack:///src/components/Settings/Invoice/ModalDeleteInvoiceMailText.vue","webpack:///./src/components/Settings/Invoice/ModalDeleteInvoiceMailText.vue?918d","webpack:///./src/components/Settings/Invoice/ModalDeleteInvoiceMailText.vue?e448"],"names":["EventBus","Vue","render","_vm","this","_c","_self","attrs","$t","isDeleting","isDeletingSuccess","isDeletingError","onClickCancel","deleteInvoiceMailText","showModal","isDeleteConfirmed","on","scopedSlots","_u","key","fn","staticClass","_v","_s","mailTypeTexts","mailtexts","Name","model","value","callback","$$v","expression","proxy","slot","staticRenderFns","BaseCheckbox","components","props","type","Boolean","default","Function","required","Object","data","isSavingError","mMailTypeTexts","computed","_objectSpread","mapState","created","JSON","parse","stringify","methods","mapMutations","_this","self","mMailTexts","invoiceMailTexts","_loop","mt","i","textIndex","findIndex","t","Id","LanguageId","splice","length","mailProvider","saveLocationInvoiceMailTexts","locationState","then","response","status","setInvoiceMailTexts","$emit","message","catch","e","finally","component"],"mappings":"oJAAA,kDACaA,EAAW,IAAIC,aAEbD,U,2CCHf,IAAIE,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAC9G,+EACA,sBAAwB,YAAY,SAAWL,EAAIM,WAAW,gBAAkBN,EAAIO,kBAAkB,cAAgBP,EAAIQ,gBAAgB,cAAgBR,EAAIS,cAAc,YAAcT,EAAIU,sBAAsB,UAAYV,EAAIW,UAAU,mBAAqBX,EAAIY,mBAAqBZ,EAAIM,WAAW,kBAAoBN,EAAIQ,iBAAmBR,EAAIO,kBAAkB,mBAAqBP,EAAIK,GAAG,uBAAuB,qBAAuBL,EAAIK,GAC1b,mFACA,mBAAqB,qGAAqGQ,GAAG,CAAC,WAAab,EAAIS,eAAeK,YAAYd,EAAIe,GAAG,CAA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EAAAU,OAAAL,EAAA,IAPAD,EAAA,EAAAA,EAAAL,EAAAX,eAAArB,UAAA4C,OAAAP,IAAAF,IAWAU,OAAAhB,QACAiB,6BAAAd,EAAAe,cAAAN,GAAAR,GACAe,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAlB,EAAAmB,oBAAAF,EAAA9B,MAEA5C,OAAA6E,MAAA,aACAvC,KAAA,OACAwC,QAAAtB,EAAAhD,GACA,qDAIAiD,EAAA7C,oBAGAmE,OAAA,SAAAC,GACAvB,EAAA9C,iBAAA,KAEAsE,SAAA,WACAxB,EAAAhD,YAAA,UC7IiY,I,YCO7XyE,EAAY,eACd,EACAhF,EACAgC,GACA,EACA,KACA,KACA,MAIa,aAAAgD,E","file":"js/chunk-677b1466.js?id=e579e961a1c2457b7081","sourcesContent":["import Vue from 'vue'\nexport const EventBus = new Vue()\n\nexport default EventBus\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t(\n      'Components.Settings.Reservations.ModalDeleteReservationMailText.Modal_Title'\n    ),\"confirmButtonCssClass\":\"is-danger\",\"isSaving\":_vm.isDeleting,\"isSavingSuccess\":_vm.isDeletingSuccess,\"isSavingError\":_vm.isDeletingError,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.deleteInvoiceMailText,\"showModal\":_vm.showModal,\"disableSaveButton\":!_vm.isDeleteConfirmed || _vm.isDeleting,\"hideFooterButtons\":_vm.isDeletingError || _vm.isDeletingSuccess,\"buttonLabelConfirm\":_vm.$t('Form.Control.Delete'),\"savingSuccessMessage\":_vm.$t(\n      'Components.Settings.Reservations.ModalDeleteReservationMailText.Message_Success'\n    ),\"savingErrorMessage\":\"$t(\\n      'Components.Settings.Reservations.ModalDeleteReservationMailText.Message_Error'\\n    )\"},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',{staticClass:\"has-text-weight-bold has-text-centered has-margin-bottom\"},[_vm._v(\" \"+_vm._s(_vm.mailTypeTexts.mailtexts[0].Name)+\" \")]),_c('div',{staticClass:\"has-text-centered\"},[_c('BaseCheckbox',{staticClass:\"has-text-left\",attrs:{\"label\":_vm.$t(\n            'Components.Settings.Reservations.ModalDeleteReservationMailText.Text_AreYouSure'\n          )},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=\"\n      $t(\n        'Components.Settings.Reservations.ModalDeleteReservationMailText.Modal_Title'\n      )\n    \"\n    confirmButtonCssClass=\"is-danger\"\n    :isSaving=\"isDeleting\"\n    :isSavingSuccess=\"isDeletingSuccess\"\n    :isSavingError=\"isDeletingError\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"deleteInvoiceMailText\"\n    :showModal=\"showModal\"\n    :disableSaveButton=\"!isDeleteConfirmed || isDeleting\"\n    :hideFooterButtons=\"isDeletingError || isDeletingSuccess\"\n    :buttonLabelConfirm=\"$t('Form.Control.Delete')\"\n    :savingSuccessMessage=\"\n      $t(\n        'Components.Settings.Reservations.ModalDeleteReservationMailText.Message_Success'\n      )\n    \"\n    savingErrorMessage=\"$t(\n        'Components.Settings.Reservations.ModalDeleteReservationMailText.Message_Error'\n      )\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div class=\"has-text-weight-bold has-text-centered has-margin-bottom\">\n        {{ mailTypeTexts.mailtexts[0].Name }}\n      </div>\n      <div class=\"has-text-centered\">\n        <BaseCheckbox\n          v-model=\"isDeleteConfirmed\"\n          class=\"has-text-left\"\n          :label=\"\n            $t(\n              'Components.Settings.Reservations.ModalDeleteReservationMailText.Text_AreYouSure'\n            )\n          \"\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 mailProvider from '@/providers/mail'\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    mailTypeTexts: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      isDeleting: false,\n      isDeletingSuccess: false,\n      isDeletingError: false,\n      isSavingError: false,\n      isDeleteConfirmed: false,\n      mMailTypeTexts: null,\n    }\n  },\n\n  computed: {\n    ...mapState('locationStore', ['locationState']),\n    ...mapState('settingsStore', ['invoiceMailTexts']),\n  },\n\n  created() {\n    this.mMailTypeTexts = JSON.parse(JSON.stringify(this.mailTypeTexts))\n  },\n\n  methods: {\n    ...mapMutations('settingsStore', ['setInvoiceMailTexts']),\n\n    deleteInvoiceMailText() {\n      let self = this\n\n      if (!self.isDeletingSuccess) {\n        self.isDeleting = true\n\n        let mMailTexts = JSON.parse(JSON.stringify(self.invoiceMailTexts))\n\n        for (let i = 0; i < self.mMailTypeTexts.mailtexts.length; i++) {\n          let mt = self.mMailTypeTexts.mailtexts[i]\n          let textIndex = mMailTexts.findIndex(\n            (t) => t.Id === mt.Id && t.LanguageId === mt.LanguageId\n          )\n\n          if (textIndex > -1) {\n            mMailTexts.splice(textIndex, 1)\n          }\n        }\n\n        mailProvider.methods\n          .saveLocationInvoiceMailTexts(self.locationState.Id, mMailTexts)\n          .then((response) => {\n            if (response.status === 200) {\n              self.setInvoiceMailTexts(response.data)\n\n              EventBus.$emit('showToast', {\n                type: 'info',\n                message: this.$t(\n                  'Components.Settings.MailTexts.Toast_MailDeleted'\n                ),\n              })\n\n              self.onClickCancel()\n            }\n          })\n          .catch((e) => {\n            self.isDeletingError = true\n          })\n          .finally(() => {\n            self.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!./ModalDeleteInvoiceMailText.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!./ModalDeleteInvoiceMailText.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalDeleteInvoiceMailText.vue?vue&type=template&id=9a2e994a\"\nimport script from \"./ModalDeleteInvoiceMailText.vue?vue&type=script&lang=js\"\nexport * from \"./ModalDeleteInvoiceMailText.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":""}