{"version":3,"sources":["webpack:///./src/components/Admin/crud/Grammar/Add.vue?89a5","webpack:///./src/components/Admin/crud/Grammar/Add.vue","webpack:///../../../src/components/VForm/VForm.ts","webpack:///./src/mixins/homeworkMixin.js","webpack:///./src/components/Admin/crud/Homework/Recording.vue?a32a","webpack:///src/components/Admin/crud/Homework/Recording.vue","webpack:///./src/components/Admin/crud/Homework/Recording.vue?4b68","webpack:///./src/components/Admin/crud/Homework/Recording.vue","webpack:///./src/mixins/pronunciationMixin.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","on","$event","$emit","_v","_t","staticRenderFns","script","component","VBtn","VIcon","name","provide","form","inheritAttrs","props","disabled","lazyValidation","readonly","value","Boolean","data","inputs","watchers","errorBag","watch","handler","errors","Object","deep","immediate","methods","watchInput","watcher","input","val","_uid","valid","shouldValidate","validate","filter","reset","resetErrorBag","setTimeout","resetValidation","register","unregister","found","find","i","unwatch","h","novalidate","attrs$","submit","e","$slots","type","default","createFields","location","String","loading","rules","required","v","crud","title","subtitle","description","question_group","questions","onSave","$refs","JSON","stringify","createOrUpdateHomework","response","uuid","newQuestions","map","element","content","postQuestions","forEach","index","console","log","ref","preventDefault","model","callback","$$v","$set","expression","_l","question","key","removeQuestion","onNewWord","components","appPronunciationCard","PronunciationCard","appAdd","Add","appEditor","Editor","mixins","pronunciationMixin","VCol","VForm","VRow","defaultQuestion","text","push","deleteQuestion","splice"],"mappings":"0IAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,QAAQ,CAACE,YAAY,uBAAuBC,MAAM,CAAC,IAAM,GAAG,UAAY,GAAG,MAAQ,WAAWC,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOT,EAAIU,MAAM,mBAAmB,CAACN,EAAG,SAAS,CAACG,MAAM,CAAC,MAAQ,UAAU,CAACP,EAAIW,GAA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,CACPiF,gBAAiB,iBAAO,CACtB7C,MAAO,gBACPe,QAAS,CACPzB,KAAM,MACNyB,QAAS,CACP,CACEzB,KAAM,YACNyB,QAAS,CACP,CACEzB,KAAM,OACNwD,KAAM,kCAOlBd,UAlBO,WAmBLzG,KAAKwE,KAAKI,eAAeC,UAAU2C,KAAKxH,KAAKsH,oBAE/Cd,eArBO,SAqBQb,GACb,IAAMP,EAAOpF,KAAKwE,KAAKI,eAAeC,UAAUc,GAAOP,KACnDA,GACFqC,eAAerC,GAEjBpF,KAAKwE,KAAKI,eAAeC,UAAU6C,OAAO/B,EAAO","file":"js/chunk-0df4065c.1175487a.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('v-btn',{staticClass:\"d-flex mt-10 mx-auto\",attrs:{\"fab\":\"\",\"depressed\":\"\",\"color\":\"#29284c\"},on:{\"click\":function($event){return _vm.$emit('new-exercise')}}},[_c('v-icon',{attrs:{\"color\":\"white\"}},[_vm._v(\"mdi-plus\")])],1),_c('div',{staticClass:\"text-center mt-5 headline custom-text\"},[_vm._t(\"default\",[_vm._v(\"Add New Exercise\")])],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./Add.vue?vue&type=template&id=00b14525&\"\nvar script = {}\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 { VIcon } from 'vuetify/lib/components/VIcon';\ninstallComponents(component, {VBtn,VIcon})\n","// Components\nimport VInput from '../VInput/VInput'\n\n// Mixins\nimport mixins from '../../util/mixins'\nimport BindsAttrs from '../../mixins/binds-attrs'\nimport { provide as RegistrableProvide } from '../../mixins/registrable'\n\n// Helpers\nimport { VNode } from 'vue'\n\ntype ErrorBag = Record\ntype VInputInstance = InstanceType\ntype Watchers = {\n _uid: number\n valid: () => void\n shouldValidate: () => void\n}\n\n/* @vue/component */\nexport default mixins(\n BindsAttrs,\n RegistrableProvide('form')\n /* @vue/component */\n).extend({\n name: 'v-form',\n\n provide (): object {\n return { form: this }\n },\n\n inheritAttrs: false,\n\n props: {\n disabled: Boolean,\n lazyValidation: Boolean,\n readonly: Boolean,\n value: Boolean,\n },\n\n data: () => ({\n inputs: [] as VInputInstance[],\n watchers: [] as Watchers[],\n errorBag: {} as ErrorBag,\n }),\n\n watch: {\n errorBag: {\n handler (val) {\n const errors = Object.values(val).includes(true)\n\n this.$emit('input', !errors)\n },\n deep: true,\n immediate: true,\n },\n },\n\n methods: {\n watchInput (input: any): Watchers {\n const watcher = (input: any): (() => void) => {\n return input.$watch('hasError', (val: boolean) => {\n this.$set(this.errorBag, input._uid, val)\n }, { immediate: true })\n }\n\n const watchers: Watchers = {\n _uid: input._uid,\n valid: () => {},\n shouldValidate: () => {},\n }\n\n if (this.lazyValidation) {\n // Only start watching inputs if we need to\n watchers.shouldValidate = input.$watch('shouldValidate', (val: boolean) => {\n if (!val) return\n\n // Only watch if we're not already doing it\n if (this.errorBag.hasOwnProperty(input._uid)) return\n\n watchers.valid = watcher(input)\n })\n } else {\n watchers.valid = watcher(input)\n }\n\n return watchers\n },\n /** @public */\n validate (): boolean {\n return this.inputs.filter(input => !input.validate(true)).length === 0\n },\n /** @public */\n reset (): void {\n this.inputs.forEach(input => input.reset())\n this.resetErrorBag()\n },\n resetErrorBag () {\n if (this.lazyValidation) {\n // Account for timeout in validatable\n setTimeout(() => {\n this.errorBag = {}\n }, 0)\n }\n },\n /** @public */\n resetValidation () {\n this.inputs.forEach(input => input.resetValidation())\n this.resetErrorBag()\n },\n register (input: VInputInstance) {\n this.inputs.push(input)\n this.watchers.push(this.watchInput(input))\n },\n unregister (input: VInputInstance) {\n const found = this.inputs.find(i => i._uid === input._uid)\n\n if (!found) return\n\n const unwatch = this.watchers.find(i => i._uid === found._uid)\n if (unwatch) {\n unwatch.valid()\n unwatch.shouldValidate()\n }\n\n this.watchers = this.watchers.filter(i => i._uid !== found._uid)\n this.inputs = this.inputs.filter(i => i._uid !== found._uid)\n this.$delete(this.errorBag, found._uid)\n },\n },\n\n render (h): VNode {\n return h('form', {\n staticClass: 'v-form',\n attrs: {\n novalidate: true,\n ...this.attrs$,\n },\n on: {\n submit: (e: Event) => this.$emit('submit', e),\n },\n }, this.$slots.default)\n },\n})\n","import { createOrUpdateHomework, postQuestions } from '@/api/api';\n\nexport default {\n props: {\n data: {\n type: Object,\n default: () => ({\n type: 'Custom',\n name: 'Custom',\n }),\n },\n createFields: {\n type: Object,\n default: () => ({}),\n },\n location: {\n type: String,\n default: 'LIVE',\n },\n },\n data() {\n return {\n loading: false,\n rules: {\n required: v => !!v || 'Field required',\n },\n crud: {\n title: '',\n subtitle: '',\n description: '',\n question_group: {\n questions: [],\n },\n },\n };\n },\n methods: {\n async onSave() {\n if (!this.$refs.form.validate()) return;\n this.loading = true;\n let crud = {\n ...this.crud,\n description: JSON.stringify(this.crud.description),\n location: this.location,\n ...this.createFields,\n };\n try {\n const response = await createOrUpdateHomework(crud);\n this.crud.uuid = response.data.uuid;\n\n if (response.data.question_group.uuid) {\n this.crud.question_group.uuid = response.data.question_group.uuid;\n } else this.crud.question_group.uuid = response.data.question_group;\n\n let newQuestions = { ...this.crud.question_group };\n newQuestions.questions = [...newQuestions.questions];\n newQuestions.questions = newQuestions.questions.map(element => {\n if (typeof element.content === 'string') {\n return { ...element };\n }\n return { ...element, content: JSON.stringify(element.content) };\n });\n\n const questions = await postQuestions(newQuestions);\n this.crud.question_group.questions.forEach((element, index) => {\n element.uuid = questions.questions[index].uuid;\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.log(error);\n }\n this.loading = false;\n },\n },\n};\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-form',{ref:\"form\",on:{\"submit\":function($event){$event.preventDefault();}}},[_c('v-row',[_c('v-col',{attrs:{\"cols\":\"12\"}},[_c('app-editor',{ref:\"editor\",model:{value:(_vm.crud.description),callback:function ($$v) {_vm.$set(_vm.crud, \"description\", $$v)},expression:\"crud.description\"}})],1),_vm._l((_vm.crud.question_group.questions),function(question,index){return _c('v-col',{key:'Question' + index,attrs:{\"cols\":\"12\",\"md\":\"6\"}},[_c('app-pronunciation-card',{attrs:{\"content\":question.content},on:{\"update:content\":function($event){return _vm.$set(question, \"content\", $event)},\"delete\":function($event){return _vm.removeQuestion(index)}},model:{value:(question.question_file),callback:function ($$v) {_vm.$set(question, \"question_file\", $$v)},expression:\"question.question_file\"}})],1)}),_c('v-col',{attrs:{\"cols\":\"12\"}},[_c('app-add',{on:{\"new-exercise\":_vm.onNewWord}},[_vm._v(\"Add New Word\")])],1),_c('v-btn',{staticClass:\"d-flex ml-auto\",attrs:{\"text\":\"\",\"loading\":_vm.loading,\"color\":\"#FF347C\"},on:{\"click\":_vm.onSave}},[_vm._v(\"Save\")])],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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/vuetify-loader/lib/loader.js??ref--18-0!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Recording.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/vuetify-loader/lib/loader.js??ref--18-0!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Recording.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Recording.vue?vue&type=template&id=8598c9f4&\"\nimport script from \"./Recording.vue?vue&type=script&lang=js&\"\nexport * from \"./Recording.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 { VCol } from 'vuetify/lib/components/VGrid';\nimport { VForm } from 'vuetify/lib/components/VForm';\nimport { VRow } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VBtn,VCol,VForm,VRow})\n","import { deleteQuestion } from '@/api/api';\n\nexport default {\n methods: {\n defaultQuestion: () => ({\n title: 'Pronunciation',\n content: {\n type: 'doc',\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'Write your word here ...',\n },\n ],\n },\n ],\n },\n }),\n onNewWord() {\n this.crud.question_group.questions.push(this.defaultQuestion());\n },\n removeQuestion(index) {\n const uuid = this.crud.question_group.questions[index].uuid;\n if (uuid) {\n deleteQuestion(uuid);\n }\n this.crud.question_group.questions.splice(index, 1);\n },\n },\n};\n"],"sourceRoot":""}