{"version":3,"sources":["webpack:///./src/views/Programs/Volunteers/VolunteersIndex.vue?a6fa","webpack:///./src/views/Programs/Volunteers/VolunteersIndex.vue","webpack:///./src/views/Programs/Volunteers/VolunteersIndex.vue?9a3f","webpack:///./src/views/Programs/Volunteers/VolunteersIndex.vue?84f6","webpack:///./src/views/Programs/Volunteers/ext/routeutils.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","tabs","length","attrs","resolveCoaches","_e","staticRenderFns","league","name","RuntimeException","isHistoricalProgram","route","to","path","routeId","programsClient","retrieveAll","restResult","leagueInfo","data","find","p","upwardLeagueID","id","isHistorical","console","error","$route","params","routeType","fullPath","routeName","startsWith","text","baseRoute","store","getters","leagueAbstraction","isUpwardSelect","push","refLabel","programs","splice","typeProgramID","toLowerCase","Getter","components","VerticalTabs","Loading","Modal","inject","component","VolunteerRouteRuntimeException","routeActionToVolunteer","currentVolunteer","individualID","getRouteCategoryName","routepath","matches","match","getLeagueType","routeParts","split"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,+BAA+B,CAAEN,EAAIO,MAA4B,IAApBP,EAAIO,KAAKC,OAAcJ,EAAG,gBAAgB,CAACE,YAAY,aAAaG,MAAM,CAAC,cAAcT,EAAIU,eAAe,KAAOV,EAAIO,QAAQP,EAAIW,KAAKP,EAAG,MAAM,CAACE,YAAY,eAAe,CAACF,EAAG,gBAAgB,IAAI,IACpWQ,EAAkB,G,0QC6BhBC,EAAS,eAAU,QAEnB,E,wDAAN,iD,0BACE,EAAAC,KAAO,gCADT,E,UAA6CC,EAAA,MAaxB,EAArB,yG,0BAEU,EAAAC,qBAAsB,EAFhC,gEAmByBC,EAAcC,GACnC,OACE,eAA2B,eAAqBD,EAAME,QACtD,eAA2B,eAAqBD,MAtBtD,gMAiESjB,KAAKmB,QAjEd,sBAk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AA,EAAY3D,QAAS,EAChB2D,EAAW,GAEb,GAET,MAAO","file":"js/chunk-038ba39a.af3f6c1f.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"d-flex flex-row flex-grow-1\"},[(_vm.tabs && _vm.tabs.length !== 0)?_c('vertical-tabs',{staticClass:\"bg-light-2\",attrs:{\"is-on-route\":_vm.resolveCoaches,\"tabs\":_vm.tabs}}):_vm._e(),_c('div',{staticClass:\"flex-grow-1\"},[_c('router-view')],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport VerticalTabs from '@/components/VerticalTabs.vue'\nimport { Component, ProvideReactive, Vue } from 'vue-property-decorator'\nimport Loading from '@/elements/Loading.vue'\nimport Modal from '@/components/Modal.vue'\nimport { namespace } from 'vuex-class'\n\nimport { League } from '@/GeneratedTypes/League'\nimport { namespace as leagueStoreName } from '@/store/leagues'\nimport { Route } from 'vue-router'\nimport { CategoryNameWithoutProgram } from '@/views/Programs/Volunteers/ext/roleutils'\nimport { getRouteCategoryName, getLeagueType } from '@/views/Programs/Volunteers/ext/routeutils'\nimport { RuntimeException } from '@/lib/common/exceptions/RuntimeException'\nimport programsClient from '@/clients/programsClient'\nimport store from '@/store'\n\nconst league = namespace(leagueStoreName)\n\nclass VolunteerIndexRuntimeException extends RuntimeException {\n name = 'Volunteer Index Runtime Error'\n}\n\n@Component({\n components: {\n VerticalTabs,\n Loading,\n Modal,\n },\n // https://github.com/kaorun343/vue-property-decorator/issues/277#issuecomment-558594655\n inject: [],\n})\nexport default class VolunteerIndex extends Vue {\n @ProvideReactive()\n private isHistoricalProgram = false\n\n private get id() {\n return this.$route.params.id\n }\n private get routeName() {\n return this.$route.name\n }\n\n private get routeId() {\n return this.id ? `${this.id}/` : ''\n }\n\n private get baseRoute() {\n return `/programs/${this.routeType}/${this.routeId}volunteers`\n }\n\n private resolveCoaches(route: Route, to: string) {\n return (\n CategoryNameWithoutProgram(getRouteCategoryName(route.path)) ==\n CategoryNameWithoutProgram(getRouteCategoryName(to))\n )\n }\n\n private get routeType(): string {\n return getLeagueType(this.$route.fullPath)\n }\n\n private get tabs() {\n let tabs: { text: string; to: string }[] = []\n if (\n this.routeName?.startsWith('list-volunteer') ||\n this.routeName?.startsWith('former-volunteer') ||\n this.routeName?.startsWith('search-volunteer') ||\n this.routeName?.startsWith('delete-volunteer')\n ) {\n tabs = [{ text: 'Coaches', to: `${this.baseRoute}/list/coaches` }]\n\n if (this.routeType == 'league') {\n if (!store.getters.leagueAbstraction.isUpwardSelect) {\n tabs.push({\n text: `${store.getters.leagueAbstraction.refLabel}s`,\n to: `${this.baseRoute}/list/referees`,\n })\n }\n if (this.league && this.league.programs && this.league.programs.length > 1) {\n tabs.splice(0, 0, {\n text: 'Cheer Director',\n to: `${this.baseRoute}/list/cheerdirector-${this.league.programs[1].typeProgramID.toLowerCase()}`,\n })\n }\n\n tabs.push({ text: 'Commissioners', to: `${this.baseRoute}/list/commissioners` })\n tabs.push({ text: 'Other Volunteers', to: `${this.baseRoute}/list/others` })\n }\n }\n return tabs\n }\n\n /** getters */\n @league.Getter('currentItem') league!: League\n\n async created() {\n if (!this.routeId) {\n throw new VolunteerIndexRuntimeException(\"Can't enter a volunteer Editor without a League selected\")\n }\n\n try {\n const restResult = await programsClient.retrieveAll(true)\n const leagueInfo = restResult.data?.find((p) => p.upwardLeagueID === this.id)\n this.isHistoricalProgram = leagueInfo?.isHistorical || false\n } catch (e) {\n console.error('There was a problem fetching the program', this.id)\n }\n }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VolunteersIndex.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VolunteersIndex.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./VolunteersIndex.vue?vue&type=template&id=6344c5fb&\"\nimport script from \"./VolunteersIndex.vue?vue&type=script&lang=ts&\"\nexport * from \"./VolunteersIndex.vue?vue&type=script&lang=ts&\"\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","import { Route } from 'vue-router'\nimport { LeagueVolunteerInfo } from '@/GeneratedTypes/ListInfo/LeagueVolunteerInfo'\nimport { RuntimeException } from '@/lib/common/exceptions/RuntimeException'\nimport { LeagueVolunteer } from '@/GeneratedTypes/LeagueVolunteer'\nimport { getEmptyLeagueVolunteer, LeagueVolunteerSeedInfo } from '@/lib/support/models/LeagueVolunteer/data'\nimport { leagueVolunteerInfoToLeagueVolunteer } from '@/lib/support/models/LeagueVolunteer/leagueVolunteerInfoToLeagueVolunteer'\nimport { newPlayerID } from '@/lib/support/models/LeaguePlayerInfo/data'\n\nclass VolunteerRouteRuntimeException extends RuntimeException {\n name = 'Volunteer Route Error'\n}\n\n/***\n * Takes the route name (edit,copy,new) and produces a volunteer model for initial edit.\n * @param routeName\n * @param currentVolunteer\n */\n\nexport function routeActionToVolunteer(\n routeName: string | null | undefined,\n currentVolunteer: LeagueVolunteerInfo\n): LeagueVolunteer {\n if (routeName?.startsWith('new-volunteer')) {\n return getEmptyLeagueVolunteer(new LeagueVolunteerSeedInfo())\n }\n\n if (routeName?.startsWith('edit-volunteer')) {\n return {\n ...getEmptyLeagueVolunteer(new LeagueVolunteerSeedInfo()),\n ...leagueVolunteerInfoToLeagueVolunteer(currentVolunteer),\n }\n }\n\n if (routeName?.startsWith('copy-volunteer')) {\n return {\n ...getEmptyLeagueVolunteer(new LeagueVolunteerSeedInfo()),\n ...leagueVolunteerInfoToLeagueVolunteer(currentVolunteer),\n individualID: newPlayerID(),\n }\n }\n\n throw new VolunteerRouteRuntimeException('expected a valid routeName, got ' + routeName)\n}\n\n/**\n * Takes a URL our route and returns the category name part\n * @param routepath\n */\nexport function getRouteCategoryName(routepath: Route | string) {\n if (typeof routepath == 'string') {\n const matches = routepath.match(/volunteers\\/(\\S+)\\/(\\S+)/)\n if (matches?.length == 3) {\n return matches[2]\n }\n return ''\n }\n return routepath.params['type'] ?? ''\n}\n\n/**\n * Takes a URL our route and returns the category name part\n * @param routepath\n */\nexport function getLeagueType(routepath: Route | string) {\n if (typeof routepath == 'string') {\n const routeParts = routepath.split('/')\n if (routeParts?.length > 3) {\n return routeParts[2]\n }\n return ''\n }\n return ''\n}\n"],"sourceRoot":""}