{"version":3,"sources":["webpack:///src/components/Apis/ModalEditLocation.vue","webpack:///./src/components/Apis/ModalEditLocation.vue","webpack:///./src/components/Apis/ModalEditLocation.vue?8726","webpack:///./src/components/Apis/ModalEditLocation.vue?5016","webpack:///./src/components/Apis/ModalEditLocation.vue?f9af","webpack:///./src/eventbus/event-bus.js"],"names":["components","EditAccountRights","props","showModal","type","Boolean","default","onClickCancel","Function","required","apiLocation","Object","data","isSaving","isSavingSuccess","isSavingError","selectedAccount","computed","_objectSpread","mapState","created","setupAccount","methods","mapMutations","ProfileId","application","LocationId","AccountLevel","InvoiceLevel","LocationLevel","OptionLevel","PriceLevel","ReportLevel","ReservationLevel","SpaceLevel","VoucherLevel","saveApplicationLocation","_this","self","accountRoleRights","$refs","editAccountRight","roleSettings","Status","accountProvider","saveAccount","then","response","status","result","Result","index","Locations","findIndex","l","location","Vue","set","setApplication","catch","e","finally","render","_vm","_c","_self","attrs","modalTitle","hideFooterButtons","onClickSave","on","closeModal","scopedSlots","_u","key","fn","name","mode","ref","editModeDisabled","account","_e","proxy","slot","staticRenderFns","_withStripped","EventBus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;AACA;AACA;AACA;AAEe;EACfA,UAAA;IACAC,iBAAA,WAAAA,kBAAA;MAAA;IAAA;EACA;EAEAC,KAAA;IACAC,SAAA;MACAC,IAAA,EAAAC,OAAA;MACAC,OAAA;IACA;IAEAC,aAAA;MACAH,IAAA,EAAAI,QAAA;MACAC,QAAA;IACA;IAEAC,WAAA;MACAN,IAAA,EAAAO,MAAA;MACAL,OAAA;IACA;EACA;EAEAM,IAAA,WAAAA,KAAA;IACA;MACAC,QAAA;MACAC,eAAA;MACAC,aAAA;MACAC,eAAA;IACA;EACA;EAEAC,QAAA,EAAAC,iIAAA,KACAC,6DAAA,sCACA;EAEAC,OAAA,WAAAA,QAAA;IACA,SAAAV,WAAA;MACA,KAAAW,YAAA;IACA;EACA;EAEAC,OAAA,EAAAJ,iIAAA,CA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ACR,EAAE,mGAAM;AACR,EAAE,4GAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;;ACtCf;AAAyS,CAAgB,mVAAG,EAAC,C;;;;;;;;;;;;;ACA7T;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;ACAA;AAAA;AAAqB;AACd,IAAMC,QAAQ,GAAG,IAAI9B,2CAAG,CAAC,CAAC;AAElB8B,iEAAQ,E","file":"js/288.js?id=c3a4a137ca70921d5b71","sourcesContent":["<template>\n  <ui-component-modal\n    modalTitle=\"\"\n    :isSaving=\"isSaving\"\n    :isSavingSuccess=\"isSavingSuccess\"\n    :isSavingError=\"isSavingError\"\n    :hideFooterButtons=\"isSavingError || isSavingSuccess\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"saveApplicationLocation\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <transition name=\"fade\" mode=\"out-in\" v-if=\"selectedAccount\">\n        <div key=\"setRights\">\n          <EditAccountRights\n            ref=\"editAccountRight\"\n            :editModeDisabled=\"false\"\n            :account=\"selectedAccount\"\n          />\n        </div>\n      </transition>\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 accountProvider from '@/providers/account'\n\nexport default {\n  components: {\n    EditAccountRights: () => import('@/components/Account/EditAccountRights'),\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    apiLocation: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      isSaving: false,\n      isSavingSuccess: false,\n      isSavingError: false,\n      selectedAccount: null,\n    }\n  },\n\n  computed: {\n    ...mapState('applicationStore', ['application']),\n  },\n\n  created() {\n    if (this.apiLocation) {\n      this.setupAccount()\n    }\n  },\n\n  methods: {\n    ...mapMutations('applicationStore', ['setApplication']),\n\n    setupAccount() {\n      this.selectedAccount = {\n        ProfileId: this.application.ProfileId,\n        LocationId: this.apiLocation.LocationId,\n        AccountLevel: this.apiLocation.AccountLevel,\n        InvoiceLevel: this.apiLocation.InvoiceLevel,\n        LocationLevel: this.apiLocation.LocationLevel,\n        OptionLevel: this.apiLocation.OptionLevel,\n        PriceLevel: this.apiLocation.PriceLevel,\n        ReportLevel: this.apiLocation.ReportLevel,\n        ReservationLevel: this.apiLocation.ReservationLevel,\n        SpaceLevel: this.apiLocation.SpaceLevel,\n        VoucherLevel: this.apiLocation.VoucherLevel,\n      }\n    },\n\n    saveApplicationLocation() {\n      let self = this\n\n      if (!self.isSaving) {\n        self.isSaving = true\n\n        let accountRoleRights = this.$refs.editAccountRight.roleSettings\n        accountRoleRights.LocationId = this.apiLocation.LocationId\n        accountRoleRights.ProfileId = this.application.ProfileId\n        accountRoleRights.Status = 'Request'\n\n        accountProvider.methods\n          .saveAccount(accountRoleRights)\n          .then((response) => {\n            if (response.status === 200) {\n              self.isSavingSuccess = true\n\n              let result = response.data.Result\n\n              let index = this.application.Locations.findIndex(\n                (l) => l.LocationId === this.apiLocation.LocationId\n              )\n              if (index > -1) {\n                let location = this.application.Locations[index]\n                location.AccountLevel = result.AccountLevel\n                location.InvoiceLevel = result.InvoiceLevel\n                location.LocationLevel = result.LocationLevel\n                location.OptionLevel = result.OptionLevel\n                location.PriceLevel = result.PriceLevel\n                location.ReportLevel = result.ReportLevel\n                location.ReservationLevel = result.ReservationLevel\n                location.SpaceLevel = result.SpaceLevel\n                location.VoucherLevel = result.VoucherLevel\n\n                Vue.set(this.application.Locations, index, location)\n\n                this.setApplication(this.application)\n              }\n\n              self.onClickCancel()\n            }\n          })\n          .catch((e) => {\n            self.isSavingError = true\n          })\n          .finally(() => {})\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: \"\",\n        isSaving: _vm.isSaving,\n        isSavingSuccess: _vm.isSavingSuccess,\n        isSavingError: _vm.isSavingError,\n        hideFooterButtons: _vm.isSavingError || _vm.isSavingSuccess,\n        onClickCancel: _vm.onClickCancel,\n        onClickSave: _vm.saveApplicationLocation,\n        showModal: _vm.showModal,\n      },\n      on: { closeModal: _vm.onClickCancel },\n      scopedSlots: _vm._u([\n        {\n          key: \"content\",\n          fn: function () {\n            return [\n              _vm.selectedAccount\n                ? _c(\n                    \"transition\",\n                    { attrs: { name: \"fade\", mode: \"out-in\" } },\n                    [\n                      _c(\n                        \"div\",\n                        { key: \"setRights\" },\n                        [\n                          _c(\"EditAccountRights\", {\n                            ref: \"editAccountRight\",\n                            attrs: {\n                              editModeDisabled: false,\n                              account: _vm.selectedAccount,\n                            },\n                          }),\n                        ],\n                        1\n                      ),\n                    ]\n                  )\n                : _vm._e(),\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 \"./ModalEditLocation.vue?vue&type=template&id=9a3aa174\"\nimport script from \"./ModalEditLocation.vue?vue&type=script&lang=js\"\nexport * from \"./ModalEditLocation.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('9a3aa174')) {\n      api.createRecord('9a3aa174', component.options)\n    } else {\n      api.reload('9a3aa174', component.options)\n    }\n    module.hot.accept(\"./ModalEditLocation.vue?vue&type=template&id=9a3aa174\", function () {\n      api.rerender('9a3aa174', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"src/components/Apis/ModalEditLocation.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!./ModalEditLocation.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!./ModalEditLocation.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!./ModalEditLocation.vue?vue&type=template&id=9a3aa174\"","import Vue from 'vue'\nexport const EventBus = new Vue()\n\nexport default EventBus\n"],"sourceRoot":""}