{"version":3,"sources":["webpack:///./src/components/MissionDetail/MissionDetail.vue?9acf","webpack:///./src/components/MissionDetail/missionDetail.js","webpack:///./src/components/MissionDetail/missionDetail.js?69d2","webpack:///./src/components/MissionDetail/MissionDetail.vue","webpack:///./src/components/MissionDetail/MissionDetail.vue?eeb8"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","_v","_s","mission","title","city","isLoggedIn","_e","ref","style","btnWidth","on","redirectToPostTulerUrl","$t","name","detailRoute","query","Object","assign","id","idJobOffer","$route","staticRenderFns","props","data","hasApplied","cantApply","cantApplyMessage","isApplying","isCancelling","isCancelled","isCancelledMessage","extension","computed","mapGetters","generalSetting","localStorage","getItem","test","path","applyRoute","mixins","Utils","created","setTimeout","setBtnWidth","methods","redirectPageToApply","window","location","replace","$router","push","$refs","detailBtn","applyBtn","detailBtnWidth","offsetWidth","applyBtnWidth","postulerOffre","pkM","vue","pkMissions","missionService","applyMission","then","res","success","message","catch","err","callToaster","finally","annulerOffe","cancelOffer","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,SAAS,CAACE,YAAY,aAAa,CAACF,EAAG,QAAQ,CAACA,EAAG,QAAQ,CAACG,MAAM,CAAC,GAAK,MAAM,CAACP,EAAIQ,GAAG,WAAWR,EAAIS,GAAGT,EAAIU,QAAQC,OAAO,OAAOX,EAAIS,GAAGT,EAAIU,QAAQE,MAAM,cAAcZ,EAAIQ,GAAG,qBAAqBJ,EAAG,QAAQ,CAACG,MAAM,CAAC,GAAK,MAAM,CAACH,EAAG,QAAQ,CAACE,YAAY,oBAAoB,CAAGN,EAAIa,WAA6Rb,EAAIc,KAArRV,EAAG,MAAM,CAACW,IAAI,WAAWT,YAAY,mBAAmBU,MAAQ,SAAWhB,EAAIiB,SAAW,MAAQ,CAACb,EAAG,WAAW,CAACG,MAAM,CAAC,MAA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AAKS,QAAQiB,YACd1B,KAAK2B,OAAOL,UAKvB6B,YAdO,WAeL,GAAKnD,KAAK2D,MAAMC,WAAc5D,KAAK2D,MAAME,SAAzC,CAGA,IAAMC,EAAiB9D,KAAK2D,MAAMC,UAAUG,YACtCC,EAAgBhE,KAAK2D,MAAME,SAASE,YAC1C/D,KAAKgB,SAAW8C,EAAiBE,EAAgBF,EAAiBE,EAClEhE,KAAKgB,UAAY,IAGnBiD,cAxBO,SAwBOC,GACZ,IAAMC,EAAMnE,KACN8B,EAAO,CACXsC,WAAYF,GAEdlE,KAAKkC,YAAa,EAClBlC,KAAKoC,aAAc,EACnBiC,OACGC,aAAaxC,GACbyC,MAAK,SAACC,GACDA,EAAIC,QACNN,EAAIpC,YAAa,GAGnBoC,EAAInC,WAAY,EAChBmC,EAAIlC,iBAAmBuC,EAAIE,YAE5BC,OAAM,SAACC,GACNT,EAAIU,YAAYV,EAAIhD,GAAG,qBAExB2D,SAAQ,WACPX,EAAIjC,YAAa,MAGvB6C,YAhDO,SAgDKb,GACV,IAAMC,EAAMnE,KACN8B,EAAO,CACXsC,WAAYF,GAEdlE,KAAK+B,YAAa,EAClBsC,OACGW,YAAYlD,GACZyC,MAAK,SAACC,GACDA,EAAIC,UACNN,EAAIpC,YAAa,EACjBoC,EAAI/B,aAAc,EAClB+B,EAAI9B,mBAAqBmC,EAAIE,YAGhCC,OAAM,SAACC,GACNT,EAAIU,YAAYV,EAAIhD,GAAG,qBAExB2D,SAAQ,WACPX,EAAIhC,cAAe,QC1GqQ,I,wBCQ9R8C,EAAY,eACd,EACAnF,EACA8B,GACA,EACA,KACA,KACA,MAIa,aAAAqD,E,6CCnBf,yBAAmgB,EAAG,G","file":"js/chunk-00487794.aa4079de.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',{staticClass:\"h5 shadow\"},[_c('b-row',[_c('b-col',{attrs:{\"md\":\"7\"}},[_vm._v(\"\\n \"+_vm._s(_vm.mission.title)+\" à \"+_vm._s(_vm.mission.city)+\"\\n\\n \"),_vm._v(\"\\n  \\n \")]),_c('b-col',{attrs:{\"md\":\"5\"}},[_c('b-row',{staticClass:\"float-right mr-1\"},[(!_vm.isLoggedIn)?_c('div',{ref:\"applyBtn\",staticClass:\"fit-content mr-3\",style:((\"width:\" + _vm.btnWidth + \"px\"))},[_c('b-button',{attrs:{\"block\":\"\",\"variant\":\"primary\"},on:{\"click\":_vm.redirectToPostTulerUrl}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('apply-a-job-offer'))+\"\\n \")])],1):_vm._e(),_c('div',{ref:\"detailBtn\",staticClass:\"fit-content\",style:((\"width:\" + _vm.btnWidth + \"px\"))},[_c('b-button',{attrs:{\"block\":\"\",\"to\":{\n name: _vm.detailRoute,\n query: Object.assign({}, {id: _vm.mission.idJobOffer},\n _vm.$route.query),\n },\"variant\":\"outline-primary\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('more-information'))+\"\\n \")])],1)])],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import missionService from \"@/services/mission\";\nimport Utils from \"@/mixins/Utils\";\nimport { mapGetters } from \"vuex\";\nexport default {\n name: \"MissionDetail\",\n props: [\"mission\"],\n data() {\n return {\n hasApplied: false,\n cantApply: false,\n cantApplyMessage: \"\",\n isApplying: false,\n isCancelling: false,\n isCancelled: false,\n isCancelledMessage: \"\",\n extension: \"\",\n btnWidth: null\n };\n },\n computed: {\n ...mapGetters('auth', {\n generalSetting : 'generalSetting'\n }),\n isLoggedIn() {\n return localStorage.getItem(\"isAuthenticated\");\n },\n detailRoute() {\n return (/^\\/public/.test(this.$route.path) ? '' : 'candidate-') + 'job-offer-details';\n },\n applyRoute() {\n return (/^\\/public/.test(this.$route.path) ? '' : 'candidate-') + 'sign-up';\n }\n },\n mixins: [Utils],\n created() {\n setTimeout(()=> {\n this.setBtnWidth();\n })\n },\n methods: {\n redirectToPostTulerUrl() {\n if(this.generalSetting.redirectPageToApply) {\n window.location.replace(this.generalSetting.redirectPageToApply)\n } else {\n this.$router.push({\n name: this.applyRoute,\n query: { \n id: this.mission.idJobOffer,\n ...this.$route.query\n },\n })\n }\n },\n setBtnWidth() {\n if (!this.$refs.detailBtn || !this.$refs.applyBtn) {\n return;\n }\n const detailBtnWidth = this.$refs.detailBtn.offsetWidth;\n const applyBtnWidth = this.$refs.applyBtn.offsetWidth;\n this.btnWidth = detailBtnWidth > applyBtnWidth ? detailBtnWidth : applyBtnWidth\n this.btnWidth += 1;\n \n },\n postulerOffre(pkM) {\n const vue = this;\n const data = {\n pkMissions: pkM,\n };\n this.isApplying = true;\n this.isCancelled = false;\n missionService\n .applyMission(data)\n .then((res) => {\n if (res.success) {\n vue.hasApplied = true;\n return;\n }\n vue.cantApply = true;\n vue.cantApplyMessage = res.message;\n })\n .catch((err) => {\n vue.callToaster(vue.$t('problem-arise'));\n })\n .finally(() => {\n vue.isApplying = false;\n });\n },\n annulerOffe(pkM) {\n const vue = this;\n const data = {\n pkMissions: pkM,\n };\n this.hasApplied = false;\n missionService\n .cancelOffer(data)\n .then((res) => {\n if (res.success) {\n vue.hasApplied = false;\n vue.isCancelled = true;\n vue.isCancelledMessage = res.message;\n }\n })\n .catch((err) => {\n vue.callToaster(vue.$t('problem-arise'));\n })\n .finally(() => {\n vue.isCancelling = false;\n });\n },\n },\n};\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/eslint-loader/index.js??ref--13-0!./missionDetail.js?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/eslint-loader/index.js??ref--13-0!./missionDetail.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./MissionDetail.vue?vue&type=template&id=a7248c3a&\"\nimport script from \"./missionDetail.js?vue&type=script&lang=js&\"\nexport * from \"./missionDetail.js?vue&type=script&lang=js&\"\nimport style0 from \"./MissionDetail.vue?vue&type=style&index=0&lang=css&\"\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 mod from \"-!../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MissionDetail.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MissionDetail.vue?vue&type=style&index=0&lang=css&\""],"sourceRoot":""}