{"version":3,"sources":["webpack:///./src/components/Tournament/Courts/AddCourts.vue?2ef5","webpack:///src/components/Tournament/Courts/AddCourts.vue","webpack:///./src/components/Tournament/Courts/AddCourts.vue?8b07","webpack:///./src/components/Tournament/Courts/AddCourts.vue","webpack:///./src/components/Tournament/Courts/AddCourtsDialog.vue?1864","webpack:///src/components/Tournament/Courts/AddCourtsDialog.vue","webpack:///./src/components/Tournament/Courts/AddCourtsDialog.vue?2622","webpack:///./src/components/Tournament/Courts/AddCourtsDialog.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","flat","_v","model","value","callback","$$v","courts","expression","staticClass","saving","on","$event","stopPropagation","cancel","dirty","save","staticRenderFns","props","data","computed","tCourts","calcCourts","ranges","forEach","results","filter","isNaN","a","b","push","noSort","combined","methods","$emit","emitCourts","emit","tournament","jProps","saveJProps","watch","val","component","VBtn","VCard","VCardActions","VCardText","VTextField","scopedSlots","_u","key","fn","ref","_g","dialog","loading","onSavingChange","_e","v","components","AddCourts","VDialog","VIcon","VSpacer","VToolbar","VToolbarTitle"],"mappings":"kHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,SAAS,CAACE,MAAM,CAAC,KAAON,EAAIO,OAAO,CAACH,EAAG,cAAc,CAACA,EAAG,MAAM,CAACJ,EAAIQ,GAAG,2EAA2EJ,EAAG,MAAM,CAACJ,EAAIQ,GAAG,mIAAmIJ,EAAG,eAAe,CAACE,MAAM,CAAC,MAAQ,qBAAqBG,MAAM,CAACC,MAAOV,EAAU,OAAEW,SAAS,SAAUC,GAAMZ,EAAIa,OAAOD,GAAKE,WAAW,aAAa,GAAGV,EAAG,iBAAiB,CAACW,YAAY,kBAAkB,CAACX,EAAG,QAAQ,CAACE,MAAM,CAAC,MAAQ,oBAAoB,SAAWN,EAAIgB,QAAQC,GAAG,CAAC,MAAQ,SAASC,GAAiC,OAAzB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,EAAIqC,QAAQpB,GAAG,CAAC,eAAe,SAASC,GAAQlB,EAAI4D,QAAS,GAAO,gBAAgB,SAAS1C,GAAQlB,EAAI4D,QAAS,GAAO,gBAAgB5D,EAAI8D,eAAe,cAAc9D,EAAIyC,cAAczC,EAAI+D,MAAM,IAAI,IACp4BxC,EAAkB,G,YC2CtB,GACEC,MAAO,CAAC,aAAc,OAAQ,UAC9BC,KAFF,WAGI,MAAO,CACLmC,QAAQ,EACRC,SAAS,IAGbtB,QAAS,CACPuB,eADJ,SACA,GACM7D,KAAK4D,QAAUG,GAEjBvB,WAJJ,SAIA,GACMxC,KAAKuC,MAAM,cAAe3B,GAC1BZ,KAAK2D,QAAS,IAGlBK,WAAY,CACVC,UAAJ,SChEuX,I,qHCOnXlB,EAAY,eACd,EACAjD,EACAwB,GACA,EACA,KACA,KACA,MAIa,aAAAyB,EAAiB,QAWhC,IAAkBA,EAAW,CAACC,OAAA,KAAKC,QAAA,KAAMiB,UAAA,KAAQC,QAAA,KAAMC,UAAA,KAAQC,WAAA,KAASC,cAAA","file":"js/chunk-bb1d2a2a.4c9c7e7c.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-card',{attrs:{\"flat\":_vm.flat}},[_c('v-card-text',[_c('div',[_vm._v(\"Enter the court numbers (or names) seperated by a comma. i.e. 6,7,8,9\")]),_c('div',[_vm._v(\"To enter a range of court put in the starting and ending court number sperated by a dash. i.e. 1-10 (only works with numbers)\")]),_c('v-text-field',{attrs:{\"label\":\"Additional Courts\"},model:{value:(_vm.courts),callback:function ($$v) {_vm.courts=$$v},expression:\"courts\"}})],1),_c('v-card-actions',{staticClass:\"justify-center\"},[_c('v-btn',{attrs:{\"color\":\"error white--text\",\"disabled\":_vm.saving},on:{\"click\":function($event){$event.stopPropagation();return _vm.cancel($event)}}},[_vm._v(\"cancel\")]),_c('v-btn',{attrs:{\"color\":\"success white--text\",\"disabled\":!_vm.dirty,\"loading\":_vm.saving},on:{\"click\":function($event){$event.stopPropagation();return _vm.save($event)}}},[_vm._v(\"save\")])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n  <v-card :flat=\"flat\">\r\n    <v-card-text>\r\n      <div>Enter the court numbers (or names) seperated by a comma. i.e. 6,7,8,9</div>\r\n      <div>To enter a range of court put in the starting and ending court number sperated by a dash. i.e. 1-10 (only works with numbers)</div>\r\n      <v-text-field\r\n        label=\"Additional Courts\"\r\n        v-model=\"courts\"\r\n      ></v-text-field>\r\n    </v-card-text>\r\n    <v-card-actions class=\"justify-center\">\r\n      <v-btn\r\n        color=\"error white--text\"\r\n        @click.stop=\"cancel\"\r\n        :disabled=\"saving\"\r\n      >cancel</v-btn>\r\n      <v-btn\r\n        color=\"success white--text\"\r\n        :disabled=\"!dirty\"\r\n        :loading=\"saving\"\r\n        @click.stop=\"save\"\r\n      >save</v-btn>\r\n    </v-card-actions>\r\n  </v-card>\r\n</template>\r\n\r\n<script>\r\nimport { firstBy } from 'thenby'\r\nimport { union } from '@/helpers/SetFunctions'\r\nexport default {\r\n  props: ['flat', 'tournament', 'emit', 'noSort'],\r\n  data () {\r\n    return {\r\n      courts: null,\r\n      saving: false\r\n    }\r\n  },\r\n  computed: {\r\n    tCourts () {\r\n      return (this.tournament && this.tournament.courts) || []\r\n    },\r\n    calcCourts () {\r\n      if (!this.courts) return []\r\n      let results = this.courts.split(',')\r\n      const ranges = results.filter(f => f.includes('-'))\r\n      ranges.forEach(r => {\r\n        results = results.filter(f => f !== r)\r\n        const x = r.split('-')\r\n        let a = +x[0]\r\n        const b = +x[1]\r\n        if (!isNaN(a) && !isNaN(b)) {\r\n          for (a; a <= b; a++) {\r\n            results.push(`${a}`.trim())\r\n          }\r\n        }\r\n      })\r\n\r\n      return this.noSort ? [...new Set(results)] : [...new Set(results)].sort(firstBy(Number))\r\n    },\r\n    combined () {\r\n      const all = union(new Set(this.calcCourts), new Set(this.tCourts))\r\n      return [...all].sort(firstBy(Number)).map(m => m.trim()).filter(f => !!f)\r\n    },\r\n    dirty () {\r\n      return (this.tournament && JSON.stringify(this.tCourts) !== JSON.stringify(this.combined)) || (this.emit && this.calcCourts.length > 0)\r\n    }\r\n  },\r\n  methods: {\r\n    cancel () {\r\n      this.courts = null\r\n      this.$emit('cancel-click')\r\n    },\r\n    emitCourts () {\r\n      this.$emit('emit-courts', this.calcCourts)\r\n    },\r\n    save () {\r\n      if (this.emit) {\r\n        this.emitCourts()\r\n        return\r\n      }\r\n      this.saving = true\r\n      this.tournament.jProps.courts = this.combined\r\n      this.tournament.saveJProps()\r\n        .then(r => {\r\n          this.courts = null\r\n          this.$emit('save-complete')\r\n        })\r\n        .catch(e => console.log(e.response))\r\n        .finally(() => { this.saving = false })\r\n    }\r\n  },\r\n  watch: {\r\n    saving: function (val) {\r\n      this.$emit('saving-change', val)\r\n    }\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!./AddCourts.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!./AddCourts.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AddCourts.vue?vue&type=template&id=5fbbc588&\"\nimport script from \"./AddCourts.vue?vue&type=script&lang=js&\"\nexport * from \"./AddCourts.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 { VCardActions } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\ninstallComponents(component, {VBtn,VCard,VCardActions,VCardText,VTextField})\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-dialog',{attrs:{\"scrollable\":\"\",\"max-width\":\"500px\",\"transition\":\"dialog-transition\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nreturn [_c('v-btn',_vm._g({attrs:{\"color\":\"color3\",\"text\":\"\",\"x-small\":\"\"}},on),[_vm._v(\"Add Courts\")])]}}]),model:{value:(_vm.dialog),callback:function ($$v) {_vm.dialog=$$v},expression:\"dialog\"}},[_c('v-card',[_c('v-toolbar',{attrs:{\"color\":\"color2 color2Text--text\"}},[_c('v-toolbar-title',[_vm._v(\"Add Courts\")]),_c('v-spacer'),_c('v-btn',{attrs:{\"color\":\"color1 color1Text--text\",\"small\":\"\",\"fab\":\"\",\"disabled\":_vm.loading},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}}),(_vm.dialog)?_c('add-courts',{attrs:{\"flat\":true,\"tournament\":_vm.tournament,\"emit\":_vm.emit,\"noSort\":_vm.noSort},on:{\"cancel-click\":function($event){_vm.dialog = false},\"save-complete\":function($event){_vm.dialog = false},\"saving-change\":_vm.onSavingChange,\"emit-courts\":_vm.emitCourts}}):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<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    <template v-slot:activator=\"{on}\">\r\n      <v-btn\r\n        color=\"color3\"\r\n        text x-small\r\n        v-on=\"on\"\r\n      >Add Courts</v-btn>\r\n    </template>\r\n    <v-card>\r\n      <v-toolbar color=\"color2 color2Text--text\">\r\n        <v-toolbar-title>Add Courts</v-toolbar-title>\r\n        <v-spacer></v-spacer>\r\n        <v-btn\r\n          color=\"color1 color1Text--text\"\r\n          small fab\r\n          @click.stop=\"dialog = false\"\r\n          :disabled=\"loading\"\r\n        >\r\n          <v-icon>fas fa-times</v-icon>\r\n        </v-btn>\r\n      </v-toolbar>\r\n      <loading-bar :value=\"loading\"></loading-bar>\r\n      <add-courts\r\n        v-if=\"dialog\"\r\n        :flat=\"true\"\r\n        :tournament=\"tournament\"\r\n        :emit=\"emit\"\r\n        :noSort=\"noSort\"\r\n        @cancel-click=\"dialog = false\"\r\n        @save-complete=\"dialog = false\"\r\n        @saving-change=\"onSavingChange\"\r\n        @emit-courts=\"emitCourts\"\r\n      ></add-courts>\r\n    </v-card>\r\n  </v-dialog>\r\n</template>\r\n\r\n<script>\r\nimport AddCourts from './AddCourts'\r\n\r\nexport default {\r\n  props: ['tournament', 'emit', 'noSort'],\r\n  data () {\r\n    return {\r\n      dialog: false,\r\n      loading: false\r\n    }\r\n  },\r\n  methods: {\r\n    onSavingChange (v) {\r\n      this.loading = v\r\n    },\r\n    emitCourts (courts) {\r\n      this.$emit('emit-courts', courts)\r\n      this.dialog = false\r\n    }\r\n  },\r\n  components: {\r\n    AddCourts\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!./AddCourtsDialog.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!./AddCourtsDialog.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AddCourtsDialog.vue?vue&type=template&id=67c6ef12&\"\nimport script from \"./AddCourtsDialog.vue?vue&type=script&lang=js&\"\nexport * from \"./AddCourtsDialog.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 { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\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,VDialog,VIcon,VSpacer,VToolbar,VToolbarTitle})\n"],"sourceRoot":""}