{"version":3,"sources":["webpack:///./src/eventbus/event-bus.js","webpack:///./src/components/Settings/Reservations/ModalAddReservationMailText.vue","webpack:///src/components/Settings/Reservations/ModalAddReservationMailText.vue","webpack:///./src/components/Settings/Reservations/ModalAddReservationMailText.vue?521d","webpack:///./src/components/Settings/Reservations/ModalAddReservationMailText.vue?82f2"],"names":["EventBus","Vue","render","_vm","this","_c","_self","attrs","$t","isSaving","isSavingSuccess","isSavingError","onClickCancel","saveReservationMailText","showModal","on","scopedSlots","_u","key","fn","model","value","name","callback","$$v","expression","staticClass","_l","newMailTexts","newMailText","index","_v","_s","Language","directives","rawName","Subject","domProps","$event","target","composing","$set","Body","proxy","slot","staticRenderFns","baseInputField","components","props","type","Boolean","default","Function","required","meetingtypeId","Number","data","computed","_objectSpread","mapState","created","i","locationState","Languages","length","push","Id","TypeId","ItemId","MeetingtypeId","MailType","Name","methods","mapMutations","_this","self","mMailTexts","JSON","parse","stringify","reservationMailTexts","mailProvider","saveLocationReservationMailTexts","then","response","status","setReservationMailTexts","$emit","message","catch","e","finally","component"],"mappings":"oJAAA,kDACaA,EAAW,IAAIC,aAEbD,U,uDCHXE,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAC9G,4EACA,UAAY,QAAQ,SAAWL,EAAIM,SAAS,gBAAkBN,EAAIO,gBAAgB,cAAgBP,EAAIQ,cAAc,kBAAoBR,EAAIQ,eAAiBR,EAAIO,gBAAgB,cAAgBP,EAAIS,cAAc,YAAcT,EAAIU,wBAAwB,UAAYV,EAAIW,WAAWC,GAAG,CAAC,WAAaZ,EAAIS,eAAeI,YAAYb,EAAIc,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CAACd,EAAG,MAAM,CAACA,EAAG,mBAAmB,CAACE,MAAM,CAAC,MAAQJ,EAAIK,GACna,4EACCY,MAAM,CAACC,MAAOl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BAAA,EACAC,eAAA,EACAW,KAAA,GACAM,aAAA,KAIA6B,SAAAC,8BAAA,GACAC,eAAA,oCACAA,eAAA,2CAGAC,QAAA,WACA,QAAAC,EAAA,EAAAA,EAAA,KAAAC,cAAAC,UAAAC,OAAAH,IACA,KAAAjC,aAAAqC,KAAA,CACAC,GAAA,EACAC,OAAA,WACAC,OAAA,KAAAN,cAAAI,GACAG,cAAA,KAAAf,cACArB,SAAA,KAAA6B,cAAAC,UAAAF,GAAA5B,SACAqC,SAAA,4BACAC,KAAA,GACAnC,QAAA,GACAM,KAAA,MAKA8B,QAAAd,8BAAA,GACAe,eAAA,kDAEA5D,wBAAA,eAAA6D,EAAA,KACAC,EAAA,KAEA,IAAAA,EAAAjE,gBAAA,CACAiE,EAAAlE,UAAA,EAEA,QAAAoD,EAAA,EAAAA,EAAAc,EAAA/C,aAAAoC,OAAAH,IACAc,EAAA/C,aAAAiC,GAAAU,KAAAI,EAAArD,KAIA,IADA,IAAAsD,EAAAC,KAAAC,MAAAD,KAAAE,UAAAJ,EAAAK,uBACAnB,EAAA,EAAAA,EAAAc,EAAA/C,aAAAoC,OAAAH,IACAe,EAAAX,KAAAY,KAAAC,MAAAD,KAAAE,UAAAJ,EAAA/C,aAAAiC,MAEAoB,OAAAT,QACAU,iCAAAP,EAAAb,cAAAI,GAAAU,GACAO,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAV,EAAAW,wBAAAF,EAAA5B,MAEAxD,OAAAuF,MAAA,aACAtC,KAAA,OACAuC,QAAAd,EAAAlE,GACA,mDAIAmE,EAAA/D,oBAGA6E,OAAA,SAAAC,GAEAf,EAAAhE,eAAA,KAEAgF,SAAA,WACAhB,EAAAlE,UAAA,UClKkY,I,YCO9XmF,EAAY,eACd,EACA1F,EACA2C,GACA,EACA,KACA,KACA,MAIa,aAAA+C,E","file":"js/chunk-fd5b12b2.js?id=f847a9be6fe0f16ded94","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.ModalAddReservationMailText.Modal_Title'\n    ),\"modalSize\":\"large\",\"isSaving\":_vm.isSaving,\"isSavingSuccess\":_vm.isSavingSuccess,\"isSavingError\":_vm.isSavingError,\"hideFooterButtons\":_vm.isSavingError || _vm.isSavingSuccess,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.saveReservationMailText,\"showModal\":_vm.showModal},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',[_c('base-input-field',{attrs:{\"label\":_vm.$t(\n            'Components.Settings.Reservations.ModalAddReservationMailText.Label_Name'\n          )},model:{value:(_vm.name),callback:function ($$v) {_vm.name=$$v},expression:\"name\"}}),_c('div',{staticClass:\"columns is-multiline\"},_vm._l((_vm.newMailTexts),function(newMailText,index){return _c('div',{key:'column' + index,staticClass:\"column is-half\"},[_c('p',[_vm._v(_vm._s(newMailText.Language))]),_c('div',{staticClass:\"field\"},[_c('div',{staticClass:\"control\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(newMailText.Subject),expression:\"newMailText.Subject\"}],staticClass:\"input\",attrs:{\"type\":\"text\",\"placeholder\":\"Subject\"},domProps:{\"value\":(newMailText.Subject)},on:{\"input\":function($event){if($event.target.composing)return;_vm.$set(newMailText, \"Subject\", $event.target.value)}}})])]),_c('div',{staticClass:\"field\"},[_c('div',{staticClass:\"control\"},[_c('ui-text-editor',{attrs:{\"id\":'editor' + index},model:{value:(newMailText.Body),callback:function ($$v) {_vm.$set(newMailText, \"Body\", $$v)},expression:\"newMailText.Body\"}})],1)])])}),0)],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.ModalAddReservationMailText.Modal_Title'\n      )\n    \"\n    modalSize=\"large\"\n    :isSaving=\"isSaving\"\n    :isSavingSuccess=\"isSavingSuccess\"\n    :isSavingError=\"isSavingError\"\n    :hideFooterButtons=\"isSavingError || isSavingSuccess\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"saveReservationMailText\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div>\n        <base-input-field\n          :label=\"\n            $t(\n              'Components.Settings.Reservations.ModalAddReservationMailText.Label_Name'\n            )\n          \"\n          v-model=\"name\"\n        />\n\n        <div class=\"columns is-multiline\">\n          <div\n            v-for=\"(newMailText, index) in newMailTexts\"\n            :key=\"'column' + index\"\n            class=\"column is-half\"\n          >\n            <p>{{ newMailText.Language }}</p>\n            <div class=\"field\">\n              <div class=\"control\">\n                <input\n                  class=\"input\"\n                  type=\"text\"\n                  placeholder=\"Subject\"\n                  v-model=\"newMailText.Subject\"\n                />\n              </div>\n            </div>\n            <div class=\"field\">\n              <div class=\"control\">\n                <ui-text-editor\n                  :id=\"'editor' + index\"\n                  v-model=\"newMailText.Body\"\n                ></ui-text-editor>\n              </div>\n            </div>\n          </div>\n        </div>\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 mailProvider from '@/providers/mail'\n\nconst baseInputField = () => import('@/components/UI/Form/BaseInputField')\n//const Message = () => import('@/components/UI/Message')\n\nexport default {\n  components: {\n    'base-input-field': baseInputField,\n    //message: Message\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    meetingtypeId: {\n      type: Number,\n      default: 0,\n    },\n  },\n\n  data() {\n    return {\n      isSaving: false,\n      isSavingSuccess: false,\n      isSavingError: false,\n      name: '',\n      newMailTexts: [],\n    }\n  },\n\n  computed: {\n    ...mapState('locationStore', ['locationState']),\n    ...mapState('settingsStore', ['reservationMailTexts']),\n  },\n\n  created() {\n    for (let i = 0; i < this.locationState.Languages.length; i++) {\n      this.newMailTexts.push({\n        Id: 0,\n        TypeId: 'Location',\n        ItemId: this.locationState.Id,\n        MeetingtypeId: this.meetingtypeId,\n        Language: this.locationState.Languages[i].Language,\n        MailType: 'LocationReservationCustom',\n        Name: '',\n        Subject: '',\n        Body: '',\n      })\n    }\n  },\n\n  methods: {\n    ...mapMutations('settingsStore', ['setReservationMailTexts']),\n\n    saveReservationMailText() {\n      let self = this\n\n      if (!self.isSavingSuccess) {\n        self.isSaving = true\n\n        for (let i = 0; i < self.newMailTexts.length; i++) {\n          self.newMailTexts[i].Name = self.name\n        }\n\n        let mMailTexts = JSON.parse(JSON.stringify(self.reservationMailTexts))\n        for (let i = 0; i < self.newMailTexts.length; i++) {\n          mMailTexts.push(JSON.parse(JSON.stringify(self.newMailTexts[i])))\n        }\n        mailProvider.methods\n          .saveLocationReservationMailTexts(self.locationState.Id, mMailTexts)\n          .then((response) => {\n            if (response.status === 200) {\n              self.setReservationMailTexts(response.data)\n\n              EventBus.$emit('showToast', {\n                type: 'info',\n                message: this.$t(\n                  'Components.Settings.MailTexts.Toast_MailAdded'\n                ),\n              })\n\n              self.onClickCancel()\n            }\n          })\n          .catch((e) => {\n            //console.log(error.response)\n            self.isSavingError = true\n          })\n          .finally(() => {\n            self.isSaving = 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!./ModalAddReservationMailText.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!./ModalAddReservationMailText.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalAddReservationMailText.vue?vue&type=template&id=dc2531c6\"\nimport script from \"./ModalAddReservationMailText.vue?vue&type=script&lang=js\"\nexport * from \"./ModalAddReservationMailText.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":""}