text: (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{20:function(t,e,n){"use strict";n.r(e);var a={components:{RiseLoader:n(4).a},data:function(){return{isLoading:!1,journal:!1,diary:!1,cast:!1,oracle:{},rating_labels:[{rating:0,label:"Difficult"},{rating:1,label:"Below Average"},{rating:2,label:"Average"},{rating:3,label:"Above Average"},{rating:3.5,label:"Good"},{rating:4,label:"Good"},{rating:4.5,label:"Good"},{rating:5,label:"Excellent"}],numb:!1,question:!1,details:!1,form:new Form({numb1:null,numb2:null,numb3:null,numb4:null,oracle_number:null,question:"",details:""})}},mounted:function(){},methods:{generateNumber:function(){this.form.numb1=Math.floor(10*Math.random()),this.form.numb2=Math.floor(10*Math.random()),this.form.numb3=Math.floor(10*Math.random()),this.form.numb4=Math.floor(10*Math.random()),this.form.oracle_number=""+this.form.numb1+this.form.numb2+this.form.numb3+this.form.numb4},generate:function(){this.isLoading=!0,0==this.diary?this.castOnly():this.castAsDiary()},saveJournal:function(){var t=this;this.form.post("/api/oracle/store?api_token="+window.token).then((function(t){window.location="/diaries"})).catch((function(e){t.$notify({group:"notification",type:"error",title:"Invalid Details",text:"Question and Details are required"})}))},castAsDiary:function(){var t=this;this.form.oracle_number=""+this.form.numb1+this.form.numb2+this.form.numb3+this.form.numb4,this.form.numb1,this.form.numb2,this.form.numb3,null==this.form.numb4||""==this.form.question||""==this.form.details?this.$notify({group:"notification",type:"error",title:"Invalid Input",text:"Oracle Number, Question and Details are required"}):this.form.post("/api/oracle/number?api_token="+window.token).then((function(e){t.oracle=e.data,t.cast=!0,t.question=!0,t.details=!0,t.numb=!0,t.isLoading=!1}))},castOnly:function(){var t=this;this.form.oracle_number=""+this.form.numb1+this.form.numb2+this.form.numb3+this.form.numb4,this.form.numb1,this.form.numb2,this.form.numb3,null!=this.form.numb4?this.form.post("/api/oracle/number?api_token="+window.token).then((function(e){t.oracle=e.data,t.isLoading=!1})):(this.isLoading=!1,this.$notify({group:"notification",type:"error",title:"Invalid Input",text:"Oracle Number, Question and Details are required"}))}}},o=(n(40),n(0)),i=Object(o.a)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container"},[n("notifications",{attrs:{group:"notification",position:"bottom right"}}),t._v(" "),n("div",{staticClass:"row justify-content-center"},[n("div",{staticClass:"col-md-8"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-md-3 border p-1"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.numb1,expression:"form.numb1"}],staticClass:"form-control num-size text-center",attrs:{readonly:t.numb,type:"text",maxlength:"1"},domProps:{value:t.form.numb1},on:{input:function(e){e.target.composing||t.$set(t.form,"numb1",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"col-md-3 border p-1"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.numb2,expression:"form.numb2"}],staticClass:"form-control num-size text-center",attrs:{readonly:t.numb,type:"text",maxlength:"1"},domProps:{value:t.form.numb2},on:{input:function(e){e.target.composing||t.$set(t.form,"numb2",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"col-md-3 border p-1"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.numb3,expression:"form.numb3"}],staticClass:"form-control num-size text-center",attrs:{readonly:t.numb,type:"text",maxlength:"1"},domProps:{value:t.form.numb3},on:{input:function(e){e.target.composing||t.$set(t.form,"numb3",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"col-md-3 border p-1"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.numb4,expression:"form.numb4"}],staticClass:"form-control num-size text-center",attrs:{readonly:t.numb,type:"text",maxlength:"1"},domProps:{value:t.form.numb4},on:{input:function(e){e.target.composing||t.$set(t.form,"numb4",e.target.value)}}})])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.cast,expression:"!cast"}],staticClass:"w-100 text-center"},[n("span",{staticClass:"p-2 badge badge-success",on:{click:t.generateNumber}},[t._v("Generate random number")])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isLoading,expression:"isLoading"}],staticClass:"mb-5"},[n("span",[n("RiseLoader")],1)]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.isLoading,expression:"!isLoading"}],staticClass:"row mt-5"},[n("div",{staticClass:"col-md-4"},[n("span",{staticClass:"numb-format font-weight-bold"},[t._v("\n                        "+t._s(t.oracle.number)+"\n                    ")])]),t._v(" "),n("div",{staticClass:"col-md-8 pt-3"},[n("img",{staticClass:"img-fluid",attrs:{src:null!=t.oracle.rating?"/img/rating/"+t.oracle.rating+".png":"",alt:""}})]),t._v(" "),n("div",{staticClass:"w-100 numb-format"},t._l(t.rating_labels,(function(e){return n("span",{directives:[{name:"show",rawName:"v-show",value:e.rating==t.oracle.rating,expression:"item.rating == oracle.rating"}],key:e.rating},[t._v("\n                        "+t._s(e.label)+"\n                    ")])})),0),t._v(" "),n("div",[n("p",{staticClass:"meaning-format"},[t._v("\n                        "+t._s(t.oracle.text)+"\n                    ")])])]),t._v(" "),n("div",{staticClass:"w-100 text-center mt-2"},[n("button",{directives:[{name:"show",rawName:"v-show",value:!t.cast,expression:"!cast"}],staticClass:"btn button-success w-25",on:{click:t.generate}},[t._v("Submit")])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.journal&&t.cast,expression:"journal && cast"}],staticClass:"w-100 text-center mt-2"},[n("button",{staticClass:"btn button-primary w-25",on:{click:t.saveJournal}},[t._v("Save Journal")])])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.diary,expression:"diary"}],staticClass:"col-md-4"},[t._m(0),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.question,expression:"form.question"}],staticClass:"form-control",attrs:{type:"text",readonly:t.question,placeholder:"Question here..."},domProps:{value:t.form.question},on:{input:function(e){e.target.composing||t.$set(t.form,"question",e.target.value)}}})]),t._v(" "),t._m(1),t._v(" "),n("div",[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.details,expression:"form.details"}],staticClass:"form-control",attrs:{readonly:t.details,placeholder:"Details here...",name:"",id:"",cols:"30",rows:"10"},domProps:{value:t.form.details},on:{input:function(e){e.target.composing||t.$set(t.form,"details",e.target.value)}}})])])])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("label",{attrs:{for:"question"}},[this._v("Question")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"mt-2"},[e("label",{attrs:{for:"details"}},[this._v("Details")])])}],!1,null,"4f995354",null);e.default=i.exports},40:function(t,e,n){"use strict";var a=n(6);n.n(a).a},41:function(t,e,n){(e=t.exports=n(2)(!1)).push([t.i,"@import url(https://fonts.googleapis.com/css2?family=Lobster&display=swap);",""]),e.push([t.i,"\n.numb-format[data-v-4f995354]{\n    font-size: 60px;\n    color: #FF3A18;\n    font-family: 'Lobster', cursive;\n}\n.num-size[data-v-4f995354]{\n    font-size: 80px;\n}\n.meaning-format[data-v-4f995354]{\n    font-size: 19px;\n    font-family: 'Lobster', cursive;\n    color: gray;\n    text-indent: 50px;\n}\n.v-spinner[data-v-4f995354]{\n    text-align: center;\n}\n",""])},6:function(t,e,n){var a=n(41);"string"==typeof a&&(a=[[t.i,a,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(3)(a,o);a.locals&&(t.exports=a.locals)}}]);