{"version":3,"sources":["webpack:///./src/views/seminars/pages/SubmissionDetails.vue?c1af","webpack:///./src/views/seminars/pages/SubmissionDetails.vue","webpack:///./src/views/seminars/pages/SubmissionDetails.vue?566c","webpack:///./src/views/seminars/pages/SubmissionDetails.vue?66d3"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","VBtn","attrs","on","getSubmission","$event","$router","go","VIcon","_m","id","_s","video","userName","_f","seminarName","elementName","sub","createdAt","videoURI","seminar","handleRated","feedbackFor","handleFeedbackRated","_e","staticRenderFns","SubmissionDetails","loading","notFound","end","api","get","res","getSeminar","seminarId","console","log","submissionId","type","all","videoRatings","existing","find","x","rater","userId","ratings","filter","length","Date","toISOString","Number","$route","params","isNaN","init","Vue","__decorate","Getter","Action","Watch","immediate","Component","components","VideoPlayer","VideoRatings","VideoMenu","VideoSubmission","component"],"mappings":"qJAGIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAAEJ,EAAY,SAAEI,EAAG,MAAM,CAACE,YAAY,qBAAqB,CAACF,EAAG,KAAK,CAACJ,EAAIO,GAAG,0BAA0BH,EAAG,IAAI,CAACJ,EAAIO,GAAG,qDAAqDH,EAAGI,EAAA,KAAK,CAACC,MAAM,CAAC,UAAY,KAAKC,GAAG,CAAC,MAAQV,EAAIW,gBAAgB,CAACP,EAAG,OAAO,CAACJ,EAAIO,GAAG,kBAAkB,GAAIP,EAAS,MAAEI,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,MAAM,CAACE,YAAY,eAAe,CAACF,EAAGI,EAAA,KAAK,CAACC,MAAM,CAAC,KAAO,IAAIC,GAAG,CAAC,MAAQ,SAASE,GAAQ,OAAOZ,EAAIa,QAAQC,IAAI,MAAM,CAACV,EAAGW,EAAA,KAAM,CAACf,EAAIO,GAAG,uBAAuB,GAAGH,EAAG,KAAK,CAACE,YAAY,eAAe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D,KAAKkB,MAAMK,IAAYuB,aAAeM,KACxC,iCAED,YAMC,WALCT,EAAY,EAAZA,aACAC,EAAI,EAAJA,KAKA,GAAK5C,KAAKkB,MAAV,CAEA,IAAM2B,EAAiB7C,KAAKkB,MAAMU,YAAoBkB,cAAgB,GAChEC,EAAWF,EAAIG,MAAK,SAAAC,GAAC,OAAIA,EAAEC,QAAU,EAAKC,QAAUF,EAAEL,OAASA,KACjEQ,EAAoB,GAanBA,EAXAL,EAWUF,EAAIQ,QAAO,SAAAJ,GAAC,OAAIA,EAAEjC,KAAO+B,EAAS/B,MAVrC,GAAH,sBACF6B,GAAG,CACN,CACE7B,GAAK6B,EAAIS,OAAaT,EAAIA,EAAIS,OAAS,GAAGtC,GAAK,EAA7B,EAClB2B,eACAC,OACAM,MAAOlD,KAAKmD,OACZ3B,WAAW,IAAI+B,MAAOC,iBAK3BxD,KAAKkB,MAAMU,YAAoBkB,aAAeM,KAChD,kBAED,WACE,IAAMpC,EAAKyC,OAAOzD,KAAK0D,OAAOC,OAAO3C,IACjC4C,MAAM5C,GACRhB,KAAKkC,UAAW,GAGlBlC,KAAKgB,GAAKA,EACVhB,KAAKU,mBACN,0BAGD,WACEV,KAAK6D,WACN,EApGmC,CAASC,cACvBC,gBAArBC,eAAO,cAAa,mEACQD,gBAA5BC,eAAO,qBAAoB,oEACJD,gBAAvBE,eAAO,gBAAe,yEA+FvBF,gBADCG,eAAM,SAAU,CAAEC,WAAW,IAAO,2JAjGlBnC,EAAiB,gBAHrCoC,eAAU,CACTC,WAAY,CAAEC,mBAAaC,0BAAcC,uBAAWC,iCAEjCzC,WCxG2Z,I,YCO5a0C,EAAY,eACd,EACA5E,EACAiC,GACA,EACA,KACA,KACA,MAIa,aAAA2C,E","file":"assets/js/chunk-2d0d3a04.542be0f0.js","sourcesContent":["import { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\n\nvar render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.notFound)?_c('div',{staticClass:\"text-center px-16\"},[_c('h1',[_vm._v(\"Submission not found\")]),_c('p',[_vm._v(\"The submission you requested could not be found\")]),_c(VBtn,{attrs:{\"elevation\":\"0\"},on:{\"click\":_vm.getSubmission}},[_c('span',[_vm._v(\"Try again\")])])],1):(_vm.video)?_c('div',{staticClass:\"pa-4\"},[_c('div',{staticClass:\"d-flex mb-4\"},[_c(VBtn,{attrs:{\"icon\":\"\"},on:{\"click\":function($event){return _vm.$router.go(-1)}}},[_c(VIcon,[_vm._v(\"mdi-chevron-left\")])],1),_c('h1',{staticClass:\"flex-1 ml-4\"},[_vm._v(\"Video Submission\")])],1),_c('div',{staticClass:\"d-flex justify-space-between mb-4\"},[_c('div',{staticClass:\"flex-1\"},[_vm._m(0),_c('div',{attrs:{\"data-automation-id\":(\"video-\" + _vm.id + \"-user-name\")}},[_vm._v(\" \"+_vm._s(_vm.video.userName)+\" \")])]),_c('div',{staticClass:\"mx-1\"}),_c('div',{staticClass:\"flex-1\"},[_vm._m(1),_c('div',{attrs:{\"data-automation-id\":(\"video-\" + _vm.id + \"-seminar-name\")}},[_vm._v(\" \"+_vm._s(_vm._f(\"truncate\")(_vm.video.seminarName))+\" \")])]),_c('div',{staticClass:\"mx-1\"}),_c('div',{staticClass:\"flex-1\"},[_vm._m(2),_c('div',{attrs:{\"data-automation-id\":(\"video-\" + _vm.id + \"-element-name\")}},[_vm._v(\" \"+_vm._s(_vm._f(\"truncate\")(_vm.video.elementName))+\" \")])]),_c('div',{staticClass:\"mx-1\"}),_c('div',{staticClass:\"flex-1\"},[_vm._m(3),_c('div',{attrs:{\"data-automation-id\":(\"video-\" + _vm.id + \"-created-at-formatted\")}},[_vm._v(\" \"+_vm._s(_vm._f(\"formatwithtime\")(_vm.video.sub.createdAt))+\" \")])])]),_c('div',[_c('VideoPlayer',{attrs:{\"id\":_vm.video.sub.id,\"url\":_vm.video.sub.videoURI}})],1),_c('div',{staticClass:\"d-flex mt-4\"},[_c('div',{staticClass:\"flex-1 mr-4\"},[(_vm.seminar)?_c('VideoRatings',{attrs:{\"seminar\":_vm.seminar,\"submission\":_vm.video.sub,\"extended\":true},on:{\"rated\":_vm.handleRated}}):_c('div',[_vm._v(\"Seminar loading...\")])],1),_c('VideoMenu',{attrs:{\"submission\":_vm.video.sub,\"can-share\":false}})],1),(_vm.video.feedbackFor)?_c('div',{staticClass:\"mt-4\",attrs:{\"data-automation-id\":(\"video-\" + _vm.id + \"-feedback-for-\" + (_vm.video.feedbackFor.id))}},[_c('h3',[_vm._v(\"Feedback for\")]),_c('p',[_vm._v(\"This video submission is in response to the following video\")]),_c('VideoSubmission',{attrs:{\"id\":_vm.video.feedbackFor.id,\"horizontal\":true,\"seminar\":_vm.seminar,\"submission\":_vm.video.feedbackFor},on:{\"rated\":_vm.handleFeedbackRated}})],1):_vm._e()]):_vm._e()])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b',[_vm._v(\"Submitter\")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b',[_vm._v(\"Seminar\")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b',[_vm._v(\"Element\")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b',[_vm._v(\"Submitted on\")])])}]\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Vue from \"vue\";\r\nimport { Action, Getter } from \"vuex-class\";\r\nimport { Component, Watch } from \"vue-property-decorator\";\r\n\r\nimport api from \"@/core/utils/api\";\r\nimport type { Rating, Seminar, Submission } from \"@/core/models\";\r\nimport VideoPlayer from \"@/components/common/VideoPlayer.vue\";\r\nimport VideoRatings from \"../components/VideoRatings.vue\";\r\nimport VideoSubmission from \"../components/VideoSubmission.vue\";\r\nimport VideoMenu from \"../components/VideoMenu.vue\";\r\n\r\ntype Video = {\r\n sub: Submission;\r\n feedbackFor?: Submission;\r\n userName: string;\r\n elementName: string;\r\n seminarName: string;\r\n};\r\n@Component({\r\n components: { VideoPlayer, VideoRatings, VideoMenu, VideoSubmission },\r\n})\r\nexport default class SubmissionDetails extends Vue {\r\n @Getter(\"profile/id\") userId!: string;\r\n @Getter(\"seminars/selected\") seminar?: Seminar;\r\n @Action(\"seminars/get\") getSeminar!: (d: any) => Promise;\r\n\r\n loading = false;\r\n notFound = false;\r\n id: number | null = null;\r\n video: Video | null = null;\r\n\r\n async getSubmission() {\r\n // no id\r\n if (!this.id) {\r\n this.notFound = true;\r\n return;\r\n }\r\n\r\n // load submission\r\n this.notFound = false;\r\n this.loading = true;\r\n try {\r\n const end = `/api/Submissions/${this.id}`;\r\n const res = (await api.get(end)) as Video | null;\r\n if (!res) this.notFound = true;\r\n else {\r\n this.video = res;\r\n this.getSeminar({ id: res.sub.seminarId });\r\n }\r\n } catch (error) {\r\n this.notFound = true;\r\n console.log(error);\r\n }\r\n this.loading = false;\r\n }\r\n\r\n handleRated({ submissionId, type }: { submissionId: number; type: string }) {\r\n if (!this.video) return;\r\n\r\n const all: Rating[] = (this.video.sub as any).videoRatings || [];\r\n const existing = all.find(x => x.rater === this.userId && x.type === type);\r\n let ratings: Rating[] = [];\r\n\r\n if (!existing)\r\n ratings = [\r\n ...all,\r\n {\r\n id: !all.length ? 0 : all[all.length - 1].id + 1,\r\n submissionId,\r\n type,\r\n rater: this.userId,\r\n createdAt: new Date().toISOString(),\r\n },\r\n ];\r\n else ratings = all.filter(x => x.id !== existing.id);\r\n\r\n (this.video.sub as any).videoRatings = ratings;\r\n }\r\n\r\n handleFeedbackRated({\r\n submissionId,\r\n type,\r\n }: {\r\n submissionId: number;\r\n type: string;\r\n }) {\r\n if (!this.video) return;\r\n\r\n const all: Rating[] = (this.video.feedbackFor as any).videoRatings || [];\r\n const existing = all.find(x => x.rater === this.userId && x.type === type);\r\n let ratings: Rating[] = [];\r\n\r\n if (!existing)\r\n ratings = [\r\n ...all,\r\n {\r\n id: !all.length ? 0 : all[all.length - 1].id + 1,\r\n submissionId,\r\n type,\r\n rater: this.userId,\r\n createdAt: new Date().toISOString(),\r\n },\r\n ];\r\n else ratings = all.filter(x => x.id !== existing.id);\r\n\r\n (this.video.feedbackFor as any).videoRatings = ratings;\r\n }\r\n\r\n init() {\r\n const id = Number(this.$route.params.id);\r\n if (isNaN(id)) {\r\n this.notFound = true;\r\n return;\r\n }\r\n this.id = id;\r\n this.getSubmission();\r\n }\r\n\r\n @Watch(\"$route\", { immediate: true })\r\n routeChanged() {\r\n this.init();\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SubmissionDetails.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SubmissionDetails.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./SubmissionDetails.vue?vue&type=template&id=432040ba&\"\nimport script from \"./SubmissionDetails.vue?vue&type=script&lang=ts&\"\nexport * from \"./SubmissionDetails.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"],"sourceRoot":""}