{"version":3,"sources":["webpack:///./src/components/Invoices/InvoiceMail.vue","webpack:///src/components/Invoices/InvoiceMail.vue","webpack:///./src/components/Invoices/InvoiceMail.vue?df32","webpack:///./src/components/Invoices/InvoiceMail.vue?72d2"],"names":["render","_vm","this","_c","_self","showSendMail","attrs","invoiceId","hideModal","on","mailSend","_e","staticClass","setShowSendMail","_v","_s","$t","mailLogs","staticRenderFns","MailLog","ModalSendInvoice","components","props","default","type","Number","data","isLoading","computed","created","getInvoiceMailLog","EventBus","$on","beforeDestroy","$off","methods","self","mailProvider","then","response","status","finally","mailLog","unshift","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAAEF,EAAII,aAAcF,EAAG,mBAAmB,CAACG,MAAM,CAAC,UAAYL,EAAIM,UAAU,UAAYN,EAAII,aAAa,cAAgBJ,EAAIO,WAAWC,GAAG,CAAC,SAAWR,EAAIS,YAAYT,EAAIU,KAAKR,EAAG,MAAM,CAACS,YAAY,4DAA4D,CAACT,EAAG,MAAM,CAACS,YAAY,SAAS,CAACT,EAAG,MAAM,CAACS,YAAY,eAAeT,EAAG,MAAM,CAACS,YAAY,eAAe,CAACT,EAAG,IAAI,CAACS,YAAY,WAAWH,GAAG,CAAC,MAAQR,EAAIY,kBAAkB,CAACV,EAAG,OAAO,CAACS,YAAY,iBAAiB,CAACT,EAAG,oBAAoB,CAACG,MAAM,CAAC,KAAO,CAAC,MAAO,mBAAmB,GAAGH,EAAG,OAAO,CAACF,EAAIa,GAAGb,EAAIc,GAAGd,EAAIe,GAAG,iEAAiEb,EAAG,UAAU,CAACG,MAAM,CAAC,SAAWL,EAAIgB,aAAa,IAEvvBC,EAAkB,G,kECmCtBC,EAAA,mEACAC,EAAA,mEAEe,GACfC,WAAA,CACAF,UACAC,oBAGAE,MAAA,CACAf,UAAA,CACAgB,QAAA,EACAC,KAAAC,SAIAC,KAAA,WACA,OACAC,WAAA,EACAV,SAAA,GACAZ,cAAA,IAIAuB,SAAA,GAEAC,QAAA,WACA,KAAAC,oBAEAC,OAAAC,IAAA,uBAAAF,oBAGAG,cAAA,WACAF,OAAAG,KAAA,oBAGAC,QAAA,CACAL,kBAAA,WACA,IAAAM,EAAA,KAEAA,EAAAT,YACAS,EAAAT,WAAA,EAEAU,OAAAF,QACAL,kBAAAM,EAAA7B,WACA+B,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAJ,EAAAnB,SAAAsB,EAAAb,SAGAe,SAAA,WACAL,EAAAT,WAAA,OAKAjB,SAAA,SAAAgC,GACA,KAAAzB,SAAA0B,QAAAD,IAGA7B,gBAAA,WACA,KAAAR,cAAA,GAGAG,UAAA,WACA,KAAAH,cAAA,KCtGmW,I,YCO/VuC,EAAY,eACd,EACA5C,EACAkB,GACA,EACA,KACA,KACA,MAIa,aAAA0B,E","file":"js/chunk-2d0efd5c.js?id=c1bd0e007af64a0a53b4","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.showSendMail)?_c('ModalSendInvoice',{attrs:{\"invoiceId\":_vm.invoiceId,\"showModal\":_vm.showSendMail,\"onClickCancel\":_vm.hideModal},on:{\"mailSend\":_vm.mailSend}}):_vm._e(),_c('div',{staticClass:\"actionBar has-background-white-ter p-4 has-margin-bottom\"},[_c('div',{staticClass:\"level\"},[_c('div',{staticClass:\"level-left\"}),_c('div',{staticClass:\"level-right\"},[_c('a',{staticClass:\"has-icon\",on:{\"click\":_vm.setShowSendMail}},[_c('span',{staticClass:\"icon is-small\"},[_c('font-awesome-icon',{attrs:{\"icon\":['fas', 'paper-plane']}})],1),_c('span',[_vm._v(_vm._s(_vm.$t('Components.Invoices.InvoiceDetail.Button_SendMail')))])])])])]),_c('MailLog',{attrs:{\"mailLogs\":_vm.mailLogs}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div>\n    <ModalSendInvoice\n      v-if=\"showSendMail\"\n      :invoiceId=\"invoiceId\"\n      :showModal=\"showSendMail\"\n      :onClickCancel=\"hideModal\"\n      @mailSend=\"mailSend\"\n    />\n\n    <div class=\"actionBar has-background-white-ter p-4 has-margin-bottom\">\n      <div class=\"level\">\n        <div class=\"level-left\"></div>\n        <div class=\"level-right\">\n          <a\n            @click=\"setShowSendMail\"\n            class=\"has-icon\"\n          >\n            <span class=\"icon is-small\">\n              <font-awesome-icon :icon=\"['fas', 'paper-plane']\" />\n            </span>\n            <span>{{\n              $t('Components.Invoices.InvoiceDetail.Button_SendMail')\n            }}</span>\n          </a>\n        </div>\n      </div>\n    </div>\n\n    <MailLog :mailLogs=\"mailLogs\" />\n  </div>\n</template>\n\n<script>\nimport mailProvider from '@/providers/mail'\nimport EventBus from '@/eventbus/event-bus';\n\nconst MailLog = () => import('@/components/Mails/MailLog')\nconst ModalSendInvoice = () => import('@/components/Invoices/ModalSendInvoice')\n\nexport default {\n  components: {\n    MailLog,\n    ModalSendInvoice,\n  },\n\n  props: {\n    invoiceId: {\n      default: 0,\n      type: Number,\n    },\n  },\n\n  data() {\n    return {\n      isLoading: false,\n      mailLogs: [],\n      showSendMail: false,\n    }\n  },\n\n  computed: {},\n\n  created() {\n    this.getInvoiceMailLog();\n\n    EventBus.$on('invoiceMailSend', this.getInvoiceMailLog);\n  },\n\n  beforeDestroy() {\n    EventBus.$off('invoiceMailSend');\n  },\n\n  methods: {\n    getInvoiceMailLog() {\n      let self = this\n\n      if (!self.isLoading) {\n        self.isLoading = true\n\n        mailProvider.methods\n          .getInvoiceMailLog(self.invoiceId)\n          .then((response) => {\n            if (response.status === 200) {\n              self.mailLogs = response.data\n            }\n          })\n          .finally(() => {\n            self.isLoading = false\n          })\n      }\n    },\n\n    mailSend(mailLog) {\n      this.mailLogs.unshift(mailLog)\n    },\n\n    setShowSendMail() {\n      this.showSendMail = true\n    },\n\n    hideModal() {\n      this.showSendMail = false\n    },\n  },\n}\n</script>\n\n<style></style>\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!./InvoiceMail.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!./InvoiceMail.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./InvoiceMail.vue?vue&type=template&id=d65be05a\"\nimport script from \"./InvoiceMail.vue?vue&type=script&lang=js\"\nexport * from \"./InvoiceMail.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":""}