(function(t){function e(e){for(var r,a,s=e[0],u=e[1],c=e[2],l=0,f=[];l<s.length;l++)a=s[l],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&f.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);d&&d(e);while(f.length)f.shift()();return i.push.apply(i,c||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,s=1;s<n.length;s++){var u=n[s];0!==o[u]&&(r=!1)}r&&(i.splice(e--,1),t=a(a.s=n[0]))}return t}var r={},o={app:0},i=[];function a(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=r,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="/power-math/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],u=s.push.bind(s);s.push=e,s=s.slice();for(var c=0;c<s.length;c++)e(s[c]);var d=u;i.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"56d7":function(t,e,n){"use strict";n.r(e);n("e260"),n("e6cf"),n("cca6"),n("a79d");var r=n("2b0e"),o=n("bfc7"),i=n("289d"),a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("div",{directives:[{name:"katex",rawName:"v-katex",value:t.expression,expression:"expression"}],attrs:{id:"expression"}}),n("div",{staticClass:"container"},[n("div",{staticClass:"columns is-centered"},[n("div",{staticClass:"column is-three-fifths"},[n("b-field",{attrs:{id:"input"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.checkAnswer()}}},[n("b-input",{model:{value:t.answer,callback:function(e){t.answer=e},expression:"answer"}})],1)],1)])])])},s=[],u=(n("a9e3"),n("25eb"),n("99af"),{methods:{getRandomInt:function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t)+t)}}}),c={methods:{addition:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=u.methods.getRandomInt(5*t,100*t),n=u.methods.getRandomInt(5*t,100*t);return{text:"".concat(e," + ").concat(n),answer:e+n}},subtraction:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=u.methods.getRandomInt(5*t,100*t),n=u.methods.getRandomInt(5*t,100*t);return Math.random()>.5?{text:"".concat(e," - ").concat(n),answer:e-n}:{text:"-".concat(e," + ").concat(n),answer:-e+n}},multiplication:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=u.methods.getRandomInt(3*t,30*t),n=u.methods.getRandomInt(3*t,15*t);return{text:"".concat(e," \\times ").concat(n),answer:e*n}},square_root:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=u.methods.getRandomInt(2*t,20*t);return{text:"\\sqrt{".concat(e*e,"}"),answer:e}},getProblem:function(){var t=[this.multiplication,this.square_root],e=u.methods.getRandomInt(0,t.length);return t[e]()}}},d={name:"App",data:function(){return{answer:null,currentQuestion:null,correctTimeout:!1}},computed:{expression:function(){return null!=this.currentQuestion?this.currentQuestion.text:"error"}},created:function(){var t=this;window.addEventListener("keyup",(function(e){39===e.keyCode&&t.nextQuestion()}))},mounted:function(){var t=this;this.$nextTick((function(){t.nextQuestion()}))},methods:{nextQuestion:function(){this.currentQuestion=c.methods.getProblem()},checkAnswer:function(){var t;t="number"===typeof this.currentQuestion.answer?this.currentQuestion.answer===Number.parseInt(this.answer):this.currentQuestion.answer===this.answer,t?(this.$buefy.toast.open({message:"Correct!",type:"is-success",duration:6e3}),this.nextQuestion(),this.answer=""):this.$buefy.toast.open({message:"Incorrect.",type:"is-danger",duration:5e3})}}},l=d,f=(n("5c0b"),n("2877")),p=Object(f["a"])(l,a,s,!1,null,null,null),h=p.exports;n("be0f"),n("5abe");r["a"].config.productionTip=!1,r["a"].use(i["a"]),r["a"].use(o["a"]),new r["a"]({render:function(t){return t(h)}}).$mount("#app")},"5c0b":function(t,e,n){"use strict";var r=n("9c0c"),o=n.n(r);o.a},"9c0c":function(t,e,n){}});
//# sourceMappingURL=app.c001db59.js.map