{"version":3,"sources":["webpack:///./src/components/Dashboards/IndustrySplit.vue","webpack:///src/components/Dashboards/IndustrySplit.vue","webpack:///./src/components/Dashboards/IndustrySplit.vue?4f88","webpack:///./src/components/Dashboards/IndustrySplit.vue?5b30"],"names":["render","_vm","this","_c","_self","showDatesLabel","mStartDate","mEndDate","_v","_s","_f","_e","staticClass","$t","key","timestamp","attrs","dataLoaded","dataRes","dataSeats","dataRev","staticRenderFns","DonutChart","components","props","companyId","default","type","Number","locationId","endDate","Date","Boolean","startDate","showUnknown","data","mLocationId","industries","getTime","watch","immediate","handler","newVal","oldVal","getLocationIndustrySplitData","created","methods","_this","statsProvider","getLocationIndustrySplit","$options","filters","dateObjectIsoDateString","then","response","status","finally","prepData","self","i","length","industry","IndustryId","res","label","Industry","NrOfReservations","degrees","colour","Colour","getColour","push","seats","TotalSeats","rev","TotalRevenue","index","color","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAAEF,EAAII,eAAgBF,EAAG,MAAM,CAAEF,EAAIK,aAAeL,EAAIM,SAAUJ,EAAG,OAAO,CAACF,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIS,GAAG,0BAAPT,CAAkCA,EAAIK,gBAAgBL,EAAIU,KAAMV,EAAIK,aAAeL,EAAIM,SAAUJ,EAAG,OAAO,CAACF,EAAIO,GAAGP,EAAIQ,GAAGR,EAAIS,GAAG,0BAAPT,CAAkCA,EAAIK,aAAa,MAAML,EAAIQ,GAAGR,EAAIS,GAAG,0BAAPT,CAAkCA,EAAIM,cAAcN,EAAIU,OAAOV,EAAIU,KAAKR,EAAG,IAAI,CAACS,YAAY,YAAY,CAACX,EAAIO,GAAG,IAAIP,EAAIQ,GAAGR,EAAIY,GAAG,+DAA+D,OAAOV,EAAG,MAAM,CAACS,YAAY,WAAW,CAACT,EAAG,MAAM,CAACS,YAAY,UAAU,CAACT,EAAG,MAAM,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AAU,UAAAX,GAAAE,EAAAQ,QAGAX,EAAAxC,QAAAqD,KAAAR,GAEA,IAAAS,EAAA,CACAR,MAAAH,EAAAI,SACA9B,KAAA0B,EAAAY,WACAN,SAAA,GACAC,OAAA,IAAAP,EAAAQ,OAAAT,OAAA,KAAAU,UAAAX,GAAAE,EAAAQ,QAGAX,EAAAvC,UAAAoD,KAAAC,GAEA,IAAAE,EAAA,CACAV,MAAAH,EAAAI,SACA9B,KAAA0B,EAAAc,aACAR,SAAA,GACAC,OAAA,IAAAP,EAAAQ,OAAAT,OAAA,KAAAU,UAAAX,GAAAE,EAAAQ,QAGAX,EAAAtC,QAAAmD,KAAAG,IAIAhB,EAAA3C,WAAA,IAAAgB,MAAAO,UACAoB,EAAAzC,YAAA,GAGAqD,UAAA,SAAAM,GACA,IAAAC,EAAA,GACA,OAAAD,GACA,OACAC,EAAA,qBACA,MACA,OACAA,EAAA,qBACA,MACA,OACAA,EAAA,qBACA,MACA,OACAA,EAAA,sBACA,MACA,OACAA,EAAA,qBACA,MACA,OACAA,EAAA,qBACA,MACA,OACAA,EAAA,sBACA,MACA,OACAA,EAAA,qBACA,MACA,QACA,MAEA,OAAAA,KCnPqW,I,YCOjWC,EAAY,eACd,EACA9E,EACAqB,GACA,EACA,KACA,KACA,MAIa,aAAAyD,E","file":"js/chunk-2d0e68c6.js?id=a93ea49c7fe90d1d1a15","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.showDatesLabel)?_c('div',[(_vm.mStartDate === _vm.mEndDate)?_c('span',[_vm._v(_vm._s(_vm._f(\"dateObjectIsoDateString\")(_vm.mStartDate)))]):_vm._e(),(_vm.mStartDate !== _vm.mEndDate)?_c('span',[_vm._v(_vm._s(_vm._f(\"dateObjectIsoDateString\")(_vm.mStartDate))+\" - \"+_vm._s(_vm._f(\"dateObjectIsoDateString\")(_vm.mEndDate)))]):_vm._e()]):_vm._e(),_c('p',{staticClass:\"subtitle\"},[_vm._v(\" \"+_vm._s(_vm.$t('Components.Dashboards.IndustrySplit.Subtitle_IndustrySplit'))+\" \")]),_c('div',{staticClass:\"columns\"},[_c('div',{staticClass:\"column\"},[_c('div',{staticClass:\"box\"},[_c('p',{staticClass:\"subtitle\"},[_vm._v(\" \"+_vm._s(_vm.$t('Components.Dashboards.IndustrySplit.Subtitle_NumberOfReservations'))+\" \")]),_c('donut-chart',{key:'dc-res' + _vm.timestamp,attrs:{\"dataLoaded\":_vm.dataLoaded,\"initialValues\":_vm.dataRes,\"labelEmpty\":this.$t('Components.Dashboards.IndustrySplit.Label_NoIndustries'),\"showCenterData\":false,\"tabelLabelLabel\":this.$t('Components.Dashboards.IndustrySplit.Table_HeaderIndustry'),\"tabelDataLabel\":this.$t('Components.Dashboards.IndustrySplit.Table_HeaderReservations'),\"viewType\":'full'}})],1)]),_c('div',{staticClass:\"column\"},[_c('div',{staticClass:\"box\"},[_c('p',{staticClass:\"subtitle\"},[_vm._v(\" \"+_vm._s(_vm.$t('Components.Dashboards.IndustrySplit.Subtitle_NumberOfSeats'))+\" \")]),_c('donut-chart',{key:'dc-seats' + _vm.timestamp,attrs:{\"dataLoaded\":_vm.dataLoaded,\"initialValues\":_vm.dataSeats,\"labelEmpty\":this.$t('Components.Dashboards.IndustrySplit.Label_NoIndustries'),\"showCenterData\":false,\"tabelLabelLabel\":this.$t('Components.Dashboards.IndustrySplit.Table_HeaderIndustry'),\"tabelDataLabel\":this.$t('Components.Dashboards.IndustrySplit.Table_HeaderSeats'),\"viewType\":'full'}})],1)]),_c('div',{staticClass:\"column\"},[_c('div',{staticClass:\"box\"},[_c('p',{staticClass:\"subtitle\"},[_vm._v(\" \"+_vm._s(_vm.$t('Components.Dashboards.IndustrySplit.Subtitle_TotalRevenue'))+\" \")]),_c('donut-chart',{key:'dc-rev' + _vm.timestamp,attrs:{\"dataLoaded\":_vm.dataLoaded,\"initialValues\":_vm.dataRev,\"labelEmpty\":this.$t('Components.Dashboards.IndustrySplit.Label_NoIndustries'),\"showCenterData\":false,\"tabelLabelLabel\":this.$t('Components.Dashboards.IndustrySplit.Table_HeaderIndustry'),\"tabelDataLabel\":this.$t('Components.Dashboards.IndustrySplit.Table_HeaderRevenue'),\"viewType\":'full'}})],1)])])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div>\n    <div v-if=\"showDatesLabel\">\n      <span v-if=\"mStartDate === mEndDate\">{{\n        mStartDate | dateObjectIsoDateString\n      }}</span>\n      <span v-if=\"mStartDate !== mEndDate\"\n        >{{ mStartDate | dateObjectIsoDateString }} -\n        {{ mEndDate | dateObjectIsoDateString }}</span\n      >\n    </div>\n\n    <p class=\"subtitle\">\n      {{$t('Components.Dashboards.IndustrySplit.Subtitle_IndustrySplit')}}\n    </p>\n\n    <div class=\"columns\">\n      <div class=\"column\">\n        <div class=\"box\">\n          <p class=\"subtitle\">\n           {{$t('Components.Dashboards.IndustrySplit.Subtitle_NumberOfReservations')}}\n          </p>\n          <donut-chart\n            :key=\"'dc-res' + timestamp\"\n            :dataLoaded=\"dataLoaded\"\n            :initialValues=\"dataRes\"\n            :labelEmpty=\"this.$t('Components.Dashboards.IndustrySplit.Label_NoIndustries')\"\n            :showCenterData=\"false\"\n            :tabelLabelLabel=\"this.$t('Components.Dashboards.IndustrySplit.Table_HeaderIndustry')\"\n            :tabelDataLabel=\"this.$t('Components.Dashboards.IndustrySplit.Table_HeaderReservations')\"\n            :viewType=\"'full'\"\n          ></donut-chart>\n        </div>\n      </div>\n\n      <div class=\"column\">\n        <div class=\"box\">\n          <p class=\"subtitle\">\n           {{$t('Components.Dashboards.IndustrySplit.Subtitle_NumberOfSeats')}}\n          </p>\n\n          <donut-chart\n            :key=\"'dc-seats' + timestamp\"\n            :dataLoaded=\"dataLoaded\"\n            :initialValues=\"dataSeats\"\n            :labelEmpty=\"this.$t('Components.Dashboards.IndustrySplit.Label_NoIndustries')\"\n            :showCenterData=\"false\"\n            :tabelLabelLabel=\"this.$t('Components.Dashboards.IndustrySplit.Table_HeaderIndustry')\"\n            :tabelDataLabel=\"this.$t('Components.Dashboards.IndustrySplit.Table_HeaderSeats')\"\n            :viewType=\"'full'\"\n          ></donut-chart>\n        </div>\n      </div>\n\n      <div class=\"column\">\n        <div class=\"box\">\n          <p class=\"subtitle\">\n            {{$t('Components.Dashboards.IndustrySplit.Subtitle_TotalRevenue')}}\n          </p>\n          <donut-chart\n            :key=\"'dc-rev' + timestamp\"\n            :dataLoaded=\"dataLoaded\"\n            :initialValues=\"dataRev\"\n            :labelEmpty=\"this.$t('Components.Dashboards.IndustrySplit.Label_NoIndustries')\"\n            :showCenterData=\"false\"\n            :tabelLabelLabel=\"this.$t('Components.Dashboards.IndustrySplit.Table_HeaderIndustry')\"\n            :tabelDataLabel=\"this.$t('Components.Dashboards.IndustrySplit.Table_HeaderRevenue')\"\n            :viewType=\"'full'\"\n          ></donut-chart>\n        </div>\n      </div>\n    </div>\n  </div>\n</template>\n<script>\nimport statsProvider from '@/providers/stats'\n\nconst DonutChart = () => import('@/components/UI/Charts/DonutChart')\n\nexport default {\n  components: {\n    'donut-chart': DonutChart\n  },\n\n  props: {\n    companyId: {\n      default: 0,\n      type: Number\n    },\n\n    locationId: {\n      default: 0,\n      type: Number\n    },\n\n    endDate: {\n      default: new Date(),\n      type: Date\n    },\n\n    showDatesLabel: {\n      default: false,\n      type: Boolean\n    },\n\n    startDate: {\n      default: new Date(),\n      type: Date\n    },\n\n    showUnknown: {\n      type: Boolean,\n      default: false\n    }\n  },\n\n  data() {\n    return {\n      dataRes: [],\n      dataSeats: [],\n      dataRev: [],\n      dataLoaded: false,\n      mLocationId: this.locationId,\n      mEndDate: this.endDate,\n      mStartDate: this.startDate,\n      industries: [],\n      timestamp: new Date().getTime()\n    }\n  },\n\n  watch: {\n    mEndDate: {\n      immediate: true,\n      handler: function(newVal, oldVal) {\n        this.getLocationIndustrySplitData()\n      }\n    },\n\n    mStartDate: {\n      immediate: true,\n      handler: function(newVal, oldVal) {\n        this.getLocationIndustrySplitData()\n      }\n    }\n  },\n\n  created() {\n    this.getLocationIndustrySplitData()\n  },\n\n  methods: {\n    getLocationIndustrySplitData() {\n      this.dataLoaded = false\n\n      statsProvider.methods\n        .getLocationIndustrySplit(\n          this.mLocationId,\n          this.$options.filters.dateObjectIsoDateString(this.startDate),\n          this.$options.filters.dateObjectIsoDateString(this.endDate)\n        )\n        .then(response => {\n          if (response.status === 200) {\n            this.industries = response.data\n          }\n        })\n        .finally(() => {\n          this.prepData()\n        })\n    },\n\n    prepData() {\n      let self = this\n      self.dataRes = []\n      self.dataSeats = []\n      self.dataRev = []\n\n      for (let i = 0; i < self.industries.length; i++) {\n        let industry = self.industries[i]\n\n        if (industry.IndustryId > 0 || self.showUnknown) {\n          let res = {\n            label: industry.Industry,\n            data: industry.NrOfReservations,\n            degrees: -90,\n            colour: industry.Colour.length === 0 ? this.getColour(i) : industry.Colour\n            //link: inv.IsPaid === 1 ? \"invoices-list\" : \"expired-invoices-list\"\n          }\n          self.dataRes.push(res)\n\n          let seats = {\n            label: industry.Industry,\n            data: industry.TotalSeats,\n            degrees: -90,\n            colour: industry.Colour.length === 0 ? this.getColour(i) : industry.Colour\n            //link: inv.IsPaid === 1 ? \"invoices-list\" : \"expired-invoices-list\"\n          }\n          self.dataSeats.push(seats)\n\n          let rev = {\n            label: industry.Industry,\n            data: industry.TotalRevenue,\n            degrees: -90,\n            colour: industry.Colour.length === 0 ? this.getColour(i) : industry.Colour\n            //link: inv.IsPaid === 1 ? \"invoices-list\" : \"expired-invoices-list\"\n          }\n          self.dataRev.push(rev)\n        }\n      }\n\n      self.timestamp = new Date().getTime()\n      self.dataLoaded = true\n    },\n\n    getColour(index) {\n      let color = ''\n      switch (index) {\n        case 7:\n          color = 'hsl(14, 100%, 53%)'\n          break\n        case 6:\n          color = 'hsl(48, 100%, 67%)'\n          break\n        case 5:\n          color = 'hsl(141, 53%, 53%)'\n          break\n        case 4:\n          color = 'hsl(171, 100%, 41%)'\n          break\n        case 3:\n          color = 'hsl(204, 71%, 53%)'\n          break\n        case 2:\n          color = 'hsl(217, 71%, 53%)'\n          break\n        case 1:\n          color = 'hsl(271, 100%, 71%)'\n          break\n        case 0:\n          color = 'hsl(348, 86%, 61%)'\n          break\n        default:\n          break\n      }\n      return color\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!./IndustrySplit.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!./IndustrySplit.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./IndustrySplit.vue?vue&type=template&id=5088d508\"\nimport script from \"./IndustrySplit.vue?vue&type=script&lang=js\"\nexport * from \"./IndustrySplit.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":""}