{"version":3,"sources":["webpack:///./src/New/ReservationSpy.vue?5971","webpack:///src/New/ReservationSpy.vue","webpack:///./src/New/ReservationSpy.vue?11d9","webpack:///./src/New/ReservationSpy.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","nativeOn","$event","dialog","scopedSlots","_u","key","fn","nextExpiry","staticClass","on","init","_e","proxy","model","value","callback","$$v","snack","expression","_v","_s","reservationInfo","count","stopPropagation","loading","length","_l","r","i","getInfo","staticRenderFns","data","info","computed","all","expiry","methods","$store","dispatch","loadInfo","keepAlive","push","reservation","x","needInfo","$VBL","http","post","watch","mounted","components","Countdown","ReservationSpyCard","component","VBtn","VCard","VCardText","VDialog","VIcon","VSnackbar","VSpacer","VToolbar","VToolbarTitle"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,aAAa,CAACE,MAAM,CAAC,aAAa,GAAG,KAAO,GAAG,QAAU,OAAO,QAAU,MAAMC,SAAS,CAAC,MAAQ,SAASC,GAAQR,EAAIS,QAAS,IAAOC,YAAYV,EAAIW,GAAG,CAAC,CAACC,IAAI,SAASC,GAAG,WAAW,MAAO,CAAEb,EAAc,WAAEI,EAAG,MAAM,CAACQ,IAAIZ,EAAIc,WAAWC,YAAY,cAAc,CAACX,EAAG,YAAY,CAACE,MAAM,CAAC,OAASN,EAAIc,WAAW,gBAAkB,EAAE,MAAO,GAAME,GAAG,CAAC,QAAUhB,EAAIiB,SAAS,GAAGjB,EAAIkB,OAAOC,OAAM,KAAQC,MAAM,CAACC,MAAOrB,EAAS,MAAEsB,SAAS,SAAUC,GAAMvB,EAAIwB,MAAMD,GAAKE,WAAW,UAAU,CAACrB,EAAG,MAAM,CAACA,EAAG,SAAS,CAACW,YAAY,QAAQ,CAACf,EAAI0B,GAAG,wBAAwB1B,EAAI0B,GAAG,IAAI1B,EAAI2B,GAAG3B,EAAI4B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render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-snackbar',{attrs:{\"multi-line\":\"\",\"left\":\"\",\"rounded\":\"pill\",\"timeout\":\"-1\"},nativeOn:{\"click\":function($event){_vm.dialog = true}},scopedSlots:_vm._u([{key:\"action\",fn:function(){return [(_vm.nextExpiry)?_c('div',{key:_vm.nextExpiry,staticClass:\"text-right\"},[_c('Countdown',{attrs:{\"expiry\":_vm.nextExpiry,\"lengthInSeconds\":0,\"mini\":true},on:{\"expired\":_vm.init}})],1):_vm._e()]},proxy:true}]),model:{value:(_vm.snack),callback:function ($$v) {_vm.snack=$$v},expression:\"snack\"}},[_c('div',[_c('v-icon',{staticClass:\"mr-2\"},[_vm._v(\"fas fa-alarm-clock\")]),_vm._v(\" \"+_vm._s(_vm.reservationInfo.count)+\" Active Reservation\"+_vm._s(_vm.reservationInfo.count > 1 ? 's' : '')+\" \")],1),_c('v-dialog',{attrs:{\"scrollable\":\"\",\"max-width\":\"500px\",\"transition\":\"dialog-transition\"},model:{value:(_vm.dialog),callback:function ($$v) {_vm.dialog=$$v},expression:\"dialog\"}},[_c('v-card',[_c('v-toolbar',{attrs:{\"color\":\"color1 color1Text--text\"}},[_c('v-toolbar-title',[_vm._v(\"Active reservations\")]),_c('v-spacer'),_c('v-btn',{attrs:{\"color\":\"color1Text\",\"icon\":\"\"},on:{\"click\":function($event){$event.stopPropagation();_vm.dialog=false}}},[_c('v-icon',[_vm._v(\"fas fa-times\")])],1)],1),_c('loading-bar',{attrs:{\"value\":_vm.loading.length > 0}}),_c('v-card-text',{staticClass:\"pt-3\"},[_vm._l((_vm.reservationInfo.inProcess),function(r,i){return _c('ReservationSpyCard',{key:((r.id) + \"-\" + (r.expiry)),attrs:{\"reservation\":r,\"info\":_vm.getInfo(r),\"i\":i,\"inCart\":false},on:{\"complete-click\":function($event){_vm.dialog=false},\"expired\":_vm.init}})}),_vm._l((_vm.reservationInfo.inCart),function(r,i){return _c('ReservationSpyCard',{key:((r.id) + \"-\" + (r.expiry)),attrs:{\"reservation\":r,\"info\":_vm.getInfo(r),\"i\":i,\"inCart\":true},on:{\"complete-click\":function($event){_vm.dialog=false},\"expired\":_vm.init}})})],2)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n    <v-snackbar\r\n      v-model=\"snack\"\r\n      multi-line left\r\n      rounded=\"pill\"\r\n      timeout=\"-1\"\r\n      @click.native=\"dialog = true\"\r\n    >\r\n      <div>\r\n        <v-icon class=\"mr-2\">fas fa-alarm-clock</v-icon> {{ reservationInfo.count }} Active Reservation{{ reservationInfo.count > 1 ? 's'  : '' }}\r\n      </div>\r\n      <template v-slot:action>\r\n        <div class=\"text-right\" v-if=\"nextExpiry\" :key=\"nextExpiry\">\r\n          <Countdown :expiry=\"nextExpiry\" :lengthInSeconds=\"0\" :mini=\"true\" @expired=\"init\"></Countdown>\r\n        </div>\r\n      </template>\r\n      <v-dialog\r\n        v-model=\"dialog\"\r\n        scrollable\r\n        max-width=\"500px\"\r\n        transition=\"dialog-transition\"\r\n      >\r\n        <v-card>\r\n          <v-toolbar color=\"color1 color1Text--text\">\r\n            <v-toolbar-title>Active reservations</v-toolbar-title>\r\n            <v-spacer></v-spacer>\r\n            <v-btn color=\"color1Text\" @click.stop=\"dialog=false\" icon>\r\n              <v-icon>fas fa-times</v-icon>\r\n            </v-btn>\r\n          </v-toolbar>\r\n          <loading-bar :value=\"loading.length > 0\"></loading-bar>\r\n          <v-card-text class=\"pt-3\">\r\n            <ReservationSpyCard\r\n              v-for=\"(r, i) in reservationInfo.inProcess\"\r\n              :key=\"`${r.id}-${r.expiry}`\"\r\n              :reservation=\"r\"\r\n              :info=\"getInfo(r)\"\r\n              @complete-click=\"dialog=false\"\r\n              @expired=\"init\"\r\n              :i=\"i\"\r\n              :inCart=\"false\"\r\n            >\r\n            </ReservationSpyCard>\r\n            <ReservationSpyCard\r\n              v-for=\"(r, i) in reservationInfo.inCart\"\r\n              :key=\"`${r.id}-${r.expiry}`\"\r\n              :reservation=\"r\"\r\n              :info=\"getInfo(r)\"\r\n              @complete-click=\"dialog=false\"\r\n              @expired=\"init\"\r\n              :i=\"i\"\r\n              :inCart=\"true\"\r\n            >\r\n            </ReservationSpyCard>\r\n          </v-card-text>\r\n        </v-card>\r\n      </v-dialog>\r\n    </v-snackbar>\r\n</template>\r\n\r\n<script>\r\nimport { mapGetters } from 'vuex'\r\nconst Countdown = () => import('@/components/Utils/Countdown')\r\nconst ReservationSpyCard = () => import('@/New/ReservationSpyCard')\r\n\r\nexport default {\r\n  data () {\r\n    return {\r\n      snack: false,\r\n      dialog: false,\r\n      loading: [],\r\n      info: []\r\n    }\r\n  },\r\n  computed: {\r\n    ...mapGetters(['reservationInfo']),\r\n    nextExpiry () {\r\n      return this.reservationInfo.all.length > 0 ? this.reservationInfo.all[0].expiry : null\r\n    }\r\n  },\r\n  methods: {\r\n    getInfo (r) {\r\n      const i = this.info.find(f => f.id === r.id)\r\n      return i\r\n    },\r\n    init () {\r\n      this.$store.dispatch('CLEAN_RESERVATIONS')\r\n        .then(() => {\r\n          this.snack = !!this.reservationInfo.count\r\n        })\r\n      this.loadInfo()\r\n    },\r\n    keepAlive (reservation) {\r\n      this.loading.push(`keep-alive-${reservation.id}`)\r\n      this.$store.dispatch('KEEP_ALIVE', reservation)\r\n        .catch(e => console.log(e.response))\r\n        .finally(() => {\r\n          this.loading = this.loading.filter(f => f !== `keep-alive-${reservation.id}`)\r\n        })\r\n    },\r\n    loadInfo () {\r\n      const needInfo = this.reservationInfo.all.filter(r => {\r\n        const x = this.info.findIndex(i => i.id === r.id)\r\n        return x === -1\r\n      }).map(m => m.id)\r\n\r\n      if (needInfo.length) {\r\n        this.loading.push('loadInfo')\r\n\r\n        this.$VBL.http.post('tournament/reservation/info', { ids: needInfo })\r\n          .then(r => {\r\n            this.info.push(...r.data)\r\n          })\r\n          .catch(e => console.log(e.repsonse))\r\n          .finally(() => {\r\n            this.loading = this.loading.filter(f => f !== 'loadInfo')\r\n          })\r\n      }\r\n    }\r\n  },\r\n  watch: {\r\n    'reservationInfo.count': 'init'\r\n  },\r\n  mounted () {\r\n    this.init()\r\n  },\r\n  components: {\r\n    Countdown,\r\n    ReservationSpyCard\r\n  }\r\n}\r\n</script>\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReservationSpy.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReservationSpy.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ReservationSpy.vue?vue&type=template&id=3358a4cb&\"\nimport script from \"./ReservationSpy.vue?vue&type=script&lang=js&\"\nexport * from \"./ReservationSpy.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\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VSnackbar } from 'vuetify/lib/components/VSnackbar';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VToolbar } from 'vuetify/lib/components/VToolbar';\nimport { VToolbarTitle } from 'vuetify/lib/components/VToolbar';\ninstallComponents(component, {VBtn,VCard,VCardText,VDialog,VIcon,VSnackbar,VSpacer,VToolbar,VToolbarTitle})\n"],"sourceRoot":""}