text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ed57bc02"],{"0798":function(t,e,r){"use strict";var i=r("5530"),n=r("ade3"),o=(r("caad"),r("0c18"),r("10d2")),s=r("afdd"),a=r("9d26"),c=r("f2e7"),u=r("7560"),l=r("2b0e"),d=l["a"].extend({name:"transitionable",props:{mode:String,origin:String,transition:String}}),h=r("58df"),f=r("d9bd");e["a"]=Object(h["a"])(o["a"],c["a"],d).extend({name:"v-alert",props:{border:{type:String,validator:function(t){return["top","right","bottom","left"].includes(t)}},closeLabel:{type:String,default:"$vuetify.close"},coloredBorder:Boolean,dense:Boolean,dismissible:Boolean,closeIcon:{type:String,default:"$cancel"},icon:{default:"",type:[Boolean,String],validator:function(t){return"string"===typeof t||!1===t}},outlined:Boolean,prominent:Boolean,text:Boolean,type:{type:String,validator:function(t){return["info","error","success","warning"].includes(t)}},value:{type:Boolean,default:!0}},computed:{__cachedBorder:function(){if(!this.border)return null;var t={staticClass:"v-alert__border",class:Object(n["a"])({},"v-alert__border--".concat(this.border),!0)};return this.coloredBorder&&(t=this.setBackgroundColor(this.computedColor,t),t.class["v-alert__border--has-color"]=!0),this.$createElement("div",t)},__cachedDismissible:function(){var t=this;if(!this.dismissible)return null;var e=this.iconColor;return this.$createElement(s["a"],{staticClass:"v-alert__dismissible",props:{color:e,icon:!0,small:!0},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:function(){return t.isActive=!1}}},[this.$createElement(a["a"],{props:{color:e}},this.closeIcon)])},__cachedIcon:function(){return this.computedIcon?this.$createElement(a["a"],{staticClass:"v-alert__icon",props:{color:this.iconColor}},this.computedIcon):null},classes:function(){var t=Object(i["a"])(Object(i["a"])({},o["a"].options.computed.classes.call(this)),{},{"v-alert--border":Boolean(this.border),"v-alert--dense":this.dense,"v-alert--outlined":this.outlined,"v-alert--prominent":this.prominent,"v-alert--text":this.text});return this.border&&(t["v-alert--border-".concat(this.border)]=!0),t},computedColor:function(){return this.color||this.type},computedIcon:function(){return!1!==this.icon&&("string"===typeof this.icon&&this.icon?this.icon:!!["error","info","success","warning"].includes(this.type)&&"$".concat(this.type))},hasColoredIcon:function(){return this.hasText||Boolean(this.border)&&this.coloredBorder},hasText:function(){return this.text||this.outlined},iconColor:function(){return this.hasColoredIcon?this.computedColor:void 0},isDark:function(){return!(!this.type||this.coloredBorder||this.outlined)||u["a"].options.computed.isDark.call(this)}},created:function(){this.$attrs.hasOwnProperty("outline")&&Object(f["a"])("outline","outlined",this)},methods:{genWrapper:function(){var t=[this.$slots.prepend||this.__cachedIcon,this.genContent(),this.__cachedBorder,this.$slots.append,this.$scopedSlots.close?this.$scopedSlots.close({toggle:this.toggle}):this.__cachedDismissible],e={staticClass:"v-alert__wrapper"};return this.$createElement("div",e,t)},genContent:function(){return this.$createElement("div",{staticClass:"v-alert__content"},this.$slots.default)},genAlert:function(){var t={staticClass:"v-alert",attrs:{role:"alert"},on:this.listeners$,class:this.classes,style:this.styles,directives:[{name:"show",value:this.isActive}]};if(!this.coloredBorder){var e=this.hasText?this.setTextColor:this.setBackgroundColor;t=e(this.computedColor,t)}return this.$createElement("div",t,[this.genWrapper()])},toggle:function(){this.isActive=!this.isActive}},render:function(t){var e=this.genAlert();return this.transition?t("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[e]):e}})},"0c18":function(t,e,r){},"4bd4":function(t,e,r){"use strict";var i=r("5530"),n=(r("caad"),r("2532"),r("07ac"),r("4de4"),r("159b"),r("7db0"),r("58df")),o=r("7e2b"),s=r("3206");e["a"]=Object(n["a"])(o["a"],Object(s["b"])("form")).extend({name:"v-form",provide:function(){return{form:this}},inheritAttrs:!1,props:{disabled:Boolean,lazyValidation:Boolean,readonly:Boolean,value:Boolean},data:function(){return{inputs:[],watchers:[],errorBag:{}}},watch:{errorBag:{handler:function(t){var e=Object.values(t).includes(!0);this.$emit("input",!e)},deep:!0,immediate:!0}},methods:{watchInput:function(t){var e=this,r=function(t){return t.$watch("hasError",(function(r){e.$set(e.errorBag,t._uid,r)}),{immediate:!0})},i={_uid:t._uid,valid:function(){},shouldValidate:function(){}};return this.lazyValidation?i.shouldValidate=t.$watch("shouldValidate",(function(n){n&&(e.errorBag.hasOwnProperty(t._uid)||(i.valid=r(t)))})):i.valid=r(t),i},validate:function(){return 0===this.inputs.filter((function(t){return!t.validate(!0)})).length},reset:function(){this.inputs.forEach((function(t){return t.reset()})),this.resetErrorBag()},resetErrorBag:function(){var t=this;this.lazyValidation&&setTimeout((function(){t.errorBag={}}),0)},resetValidation:function(){this.inputs.forEach((function(t){return t.resetValidation()})),this.resetErrorBag()},register:function(t){this.inputs.push(t),this.watchers.push(this.watchInput(t))},unregister:function(t){var e=this.inputs.find((function(e){return e._uid===t._uid}));if(e){var r=this.watchers.find((function(t){return t._uid===e._uid}));r&&(r.valid(),r.shouldValidate()),this.watchers=this.watchers.filter((function(t){return t._uid!==e._uid})),this.inputs=this.inputs.filter((function(t){return t._uid!==e._uid})),this.$delete(this.errorBag,e._uid)}}},render:function(t){var e=this;return t("form",{staticClass:"v-form",attrs:Object(i["a"])({novalidate:!0},this.attrs$),on:{submit:function(t){return e.$emit("submit",t)}}},this.$slots.default)}})},afdd:function(t,e,r){"use strict";var i=r("8336");e["a"]=i["a"]},f6b7:function(t,e,r){"use strict";r.r(e);var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"row"},[r("div",{class:t.$vuetify.breakpoint.xs?"":"col-2"}),r("div",{class:t.$vuetify.breakpoint.xs?"col-12 text-center":"col-8 text-center"},[r("div",{staticClass:"row pb-4"},[r("div",{staticClass:"col-6 text-left justify-center"},[r("div",{staticClass:"success--text title font-weight-regular"},[r("v-btn",{attrs:{icon:"",small:"",color:"success"},on:{click:function(e){return t.$router.go(-1)}}},[r("v-icon",{attrs:{dark:""}},[t._v(" mdi-arrow-left")])],1),r("span",[t._v(" Edit quiz")])],1)]),r("div",{staticClass:"col-6 text-right my-auto"},[r("v-btn",{attrs:{small:"",outlined:"",color:"red lighten-1"},on:{click:function(e){return t.deleteQuiz()}}},[t._v("Delete")])],1)]),r("v-form",{on:{submit:function(e){return e.preventDefault(),t.submitForm.apply(null,arguments)}}},[r("v-text-field",{attrs:{outlined:"",label:"Enter the name of the quiz",color:"success"},model:{value:t.quiz["name"],callback:function(e){t.$set(t.quiz,"name",e)},expression:"quiz['name']"}}),t.error.length?r("v-alert",{attrs:{border:"left",color:"red lighten-1",dark:""}},[t._v(" "+t._s(t.error)+" ")]):t._e(),r("v-btn",{staticClass:"text-capitalize",attrs:{type:"submit",block:"",color:"success"}},[t._v("Submit")])],1)],1),r("div",{class:t.$vuetify.breakpoint.xs?"":"col-2"})])])},n=[],o=r("1da1"),s=(r("b0c0"),r("96cf"),r("bc3a")),a=r.n(s),c={data:function(){return{error:"",quiz:{}}},mounted:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,a.a.get("/api/v1/quiz/".concat(t.$route.params.id)).then((function(e){t.quiz=e.data}));case 2:case"end":return e.stop()}}),e)})))()},methods:{deleteQuiz:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.$store.commit("setIsLoading",!0),e.next=3,a.a.delete("/api/v1/quiz/".concat(t.$route.params.id)).then((function(e){t.$router.push({name:"quizes"})})).catch((function(t){console.log(t)}));case 3:t.$store.commit("setIsLoading",!1);case 4:case"end":return e.stop()}}),e)})))()},submitForm:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.$store.commit("setIsLoading",!0),t.error="",""!==t.quiz_name){e.next=6;break}return t.error="Quiz name cannot be empty!",t.$store.commit("setIsLoading",!1),e.abrupt("return",!1);case 6:return r={quiz:{name:t.quiz["name"],id:t.quiz["id"]}},e.next=9,a.a.patch("/api/v1/quizes/",r).then((function(e){t.$router.push({name:"quizes"})})).catch((function(t){console.log(t)}));case 9:t.$store.commit("setIsLoading",!1);case 10:case"end":return e.stop()}}),e)})))()}}},u=c,l=r("2877"),d=r("6544"),h=r.n(d),f=r("0798"),p=r("8336"),m=r("4bd4"),v=r("132d"),b=r("8654"),g=Object(l["a"])(u,i,n,!1,null,null,null);e["default"]=g.exports;h()(g,{VAlert:f["a"],VBtn:p["a"],VForm:m["a"],VIcon:v["a"],VTextField:b["a"]})}}]);
  //# sourceMappingURL=chunk-ed57bc02.773df42c.js.map