(this["webpackJsonpmath-exercise"]=this["webpackJsonpmath-exercise"]||[]).push([[0],{35:function(t,e,n){},41:function(t){t.exports=JSON.parse('{"path":"en","language":"English","app-name":"Math Exercise","app-description":"This is a free online math exercise application, mainly for the practice of addition, subtraction, 99 multiplications and read a clock in the lower grades of elementary school, and there are also Schulte table suitable for preschool.","app-keywords":"Schulte Table,Addition,Subtraction,9 x 9 Multiplication,19 x 19 Multiplication,Clock","schulte-table":"Schulte Table","addition":"Addition","subtraction":"Subtraction","multiplication-9x9":"9 x 9 Multiplication","multiplication-19x19":"19 x 19 Multiplication","clock":"Clock","sections":"Sections","answering-method":"Answering Method","choice":"Choice","filling":"Filling","time-limit":"Time Limit","seconds":"Seconds","number-of-questions":"Number of Questions","questions":"Questions","character":"Character","grid":"Grid","add-within-10":"Add within 10","add-within-20":"Add within 20","two-digit-addition":"Two digit addition","three-digit-addition":"Three digit addition","four-digit-addition":"Four digit addition","subtract-within-10":"Subtract within 10","subtract-within-20":"Subtract within 20","two-digit-subtraction":"Two digit subtraction","three-digit-subtraction":"Three digit subtraction","four-digit-subtraction":"Four digit subtraction","o-clock":"O\'Clock","half-an-hour":"Half an hour","five-minutes":"Five minutes","one-minute":"One minute","one-second":"One Second","timeout":"Timeout!","wrong-answer":"Wrong answer!","answer":"Answer","next":"Next","close":"Close","review":"Review","reply":"Reply","avg-duration":"Average duration","total-duration":"Total duration","duration":"Duration(Seconds)","question":"Question","number-of-correct":"Number of correct","number-of-wrong":"Number of wrong","number-of-timeout":"Number of timeout","select-all":"Select all","start":"Start","click":"Click"}')},42:function(t){t.exports=JSON.parse('{"path":"zh-tw","language":"\u7e41\u9ad4\u4e2d\u6587","app-name":"\u6578\u5b78\u7df4\u7fd2\u5c0f\u7a0b\u5f0f","app-description":"\u9019\u662f\u514d\u8cbb\u7684\u7dda\u4e0a\u6578\u5b78\u7df4\u7fd2\u5c0f\u7a0b\u5f0f\uff0c\u4e3b\u8981\u7d66\u5c0f\u5b78\u4f4e\u5e74\u7d1a\u7684\u7df4\u7fd2\u52a0\u6cd5\u3001\u6e1b\u6cd5\u300199\u4e58\u6cd5\u53ca\u6642\u9418\u67e5\u770b\uff0c\u53e6\u5916\u9084\u6709\u5b78\u9f61\u524d\u9069\u5408\u7684\u8212\u723e\u7279\u65b9\u683c\u6578\u5b57\u7df4\u7fd2\u3002","app-keywords":"\u8212\u723e\u7279\u65b9\u683c,\u52a0\u6cd5\u7df4\u7fd2,\u6e1b\u6cd5\u7df4\u7fd2,\u4e5d\u4e5d\u4e58\u6cd5\u7df4\u7fd2,19 x 19 \u4e58\u6cd5\u7df4\u7fd2,\u6642\u9418\u7df4\u7fd2","schulte-table":"\u8212\u723e\u7279\u65b9\u683c","addition":"\u52a0\u6cd5\u7df4\u7fd2","subtraction":"\u6e1b\u6cd5\u7df4\u7fd2","multiplication-9x9":"\u4e5d\u4e5d\u4e58\u6cd5\u7df4\u7fd2","multiplication-19x19":"19 x 19 \u4e58\u6cd5\u7df4\u7fd2","clock":"\u6642\u9418\u7df4\u7fd2","sections":"\u984c\u76ee\u9078\u64c7","answering-method":"\u7b54\u984c\u65b9\u5f0f","choice":"\u55ae\u9078\u984c","filling":"\u586b\u5145\u984c","time-limit":"\u7b54\u984c\u9650\u6642","seconds":"\u79d2","number-of-questions":"\u984c\u76ee\u6578\u91cf","questions":"\u984c","character":"\u5b57\u7b26","grid":"\u683c","add-within-10":"10 \u4ee5\u5167\u52a0\u6cd5","add-within-20":"20 \u4ee5\u5167\u52a0\u6cd5","two-digit-addition":"\u5169\u4f4d\u6578\u52a0\u6cd5","three-digit-addition":"\u4e09\u4f4d\u6578\u52a0\u6cd5","four-digit-addition":"\u56db\u4f4d\u6578\u52a0\u6cd5","subtract-within-10":"10 \u4ee5\u5167\u6e1b\u6cd5","subtract-within-20":"20 \u4ee5\u5167\u6e1b\u6cd5","two-digit-subtraction":"\u5169\u4f4d\u6578\u6e1b\u6cd5","three-digit-subtraction":"\u4e09\u4f4d\u6578\u6e1b\u6cd5","four-digit-subtraction":"\u56db\u4f4d\u6578\u6e1b\u6cd5","o-clock":"\u6574\u9ede\u9418","half-an-hour":"\u534a\u9ede\u9418","five-minutes":"\u4e94\u5206\u9418","one-minute":"\u4e00\u5206\u9418","one-second":"\u4e00\u79d2\u9418","timeout":"\u6642\u9593\u5230\uff01","wrong-answer":"\u7b54\u932f\u4e86\uff01","answer":"\u7b54\u6848","next":"\u4e0b\u4e00\u984c","close":"\u95dc\u9589","review":"\u8907\u7fd2","reply":"\u4f5c\u7b54","avg-duration":"\u5e73\u5747\u8017\u6642","total-duration":"\u5168\u90e8\u8017\u6642","duration":"\u8017\u6642(\u79d2)","question":"\u984c\u76ee","number-of-correct":"\u7b54\u5c0d\u6b21\u6578","number-of-wrong":"\u7b54\u932f\u6b21\u6578","number-of-timeout":"\u903e\u6642\u6b21\u6578","select-all":"\u5168\u9078","start":"\u958b\u59cb","click":"\u6309\u4e0b"}')},43:function(t){t.exports=JSON.parse('{"path":"zh-cn","language":"\u7b80\u4f53\u4e2d\u6587","app-name":"\u6570\u5b66\u7ec3\u4e60\u5c0f\u7a0b\u5f0f","app-description":"\u8fd9\u662f\u514d\u8d39\u7684\u7ebf\u4e0a\u6570\u5b66\u7ec3\u4e60\u5c0f\u7a0b\u5f0f\uff0c\u4e3b\u8981\u7ed9\u5c0f\u5b66\u4f4e\u5e74\u7ea7\u7684\u7ec3\u4e60\u52a0\u6cd5\u3001\u51cf\u6cd5\u300199\u4e58\u6cd5\u53ca\u65f6\u949f\u67e5\u770b\uff0c\u53e6\u5916\u8fd8\u6709\u5b66\u9f84\u524d\u9002\u5408\u7684\u8212\u5c14\u7279\u65b9\u683c\u6570\u5b57\u7ec3\u4e60\u3002","app-keywords":"\u8212\u5c14\u7279\u65b9\u683c,\u52a0\u6cd5\u7ec3\u4e60,\u51cf\u6cd5\u7ec3\u4e60,\u4e5d\u4e5d\u4e58\u6cd5\u7ec3\u4e60,19 x 19 \u4e58\u6cd5\u7ec3\u4e60,\u65f6\u949f\u7ec3\u4e60","schulte-table":"\u8212\u5c14\u7279\u65b9\u683c","addition":"\u52a0\u6cd5\u7ec3\u4e60","subtraction":"\u51cf\u6cd5\u7ec3\u4e60","multiplication-9x9":"\u4e5d\u4e5d\u4e58\u6cd5\u7ec3\u4e60","multiplication-19x19":"19 x 19 \u4e58\u6cd5\u7ec3\u4e60","clock":"\u65f6\u949f\u7ec3\u4e60","sections":"\u9898\u76ee\u9009\u62e9","answering-method":"\u7b54\u9898\u65b9\u5f0f","choice":"\u5355\u9009\u9898","filling":"\u586b\u5145\u9898","time-limit":"\u7b54\u9898\u9650\u65f6","seconds":"\u79d2","number-of-questions":"\u9898\u76ee\u6570\u91cf","questions":"\u9898","character":"\u5b57\u7b26","grid":"\u683c","add-within-10":"10 \u4ee5\u5185\u52a0\u6cd5","add-within-20":"20 \u4ee5\u5185\u52a0\u6cd5","two-digit-addition":"\u4e24\u4f4d\u6570\u52a0\u6cd5","three-digit-addition":"\u4e09\u4f4d\u6570\u52a0\u6cd5","four-digit-addition":"\u56db\u4f4d\u6570\u52a0\u6cd5","subtract-within-10":"10 \u4ee5\u5185\u51cf\u6cd5","subtract-within-20":"20 \u4ee5\u5185\u51cf\u6cd5","two-digit-subtraction":"\u4e24\u4f4d\u6570\u51cf\u6cd5","three-digit-subtraction":"\u4e09\u4f4d\u6570\u51cf\u6cd5","four-digit-subtraction":"\u56db\u4f4d\u6570\u51cf\u6cd5","o-clock":"\u6574\u70b9\u949f","half-an-hour":"\u534a\u70b9\u949f","five-minutes":"\u4e94\u5206\u949f","one-minute":"\u4e00\u5206\u949f","one-second":"\u4e00\u79d2\u949f","timeout":"\u65f6\u95f4\u5230\uff01","wrong-answer":"\u7b54\u9519\u4e86\uff01","answer":"\u7b54\u6848","next":"\u4e0b\u4e00\u9898","close":"\u5173\u95ed","review":"\u590d\u4e60","reply":"\u4f5c\u7b54","avg-duration":"\u5e73\u5747\u8017\u65f6","total-duration":"\u5168\u90e8\u8017\u65f6","duration":"\u8017\u65f6(\u79d2)","question":"\u9898\u76ee","number-of-correct":"\u7b54\u5bf9\u6b21\u6570","number-of-wrong":"\u7b54\u9519\u6b21\u6570","number-of-timeout":"\u903e\u65f6\u6b21\u6570","select-all":"\u5168\u9009","start":"\u5f00\u59cb","click":"\u6309\u4e0b"}')},44:function(t){t.exports=JSON.parse('{"path":"ja","language":"\u65e5\u672c\u8a9e","app-name":"\u6570\u5b66\u306e\u7df4\u7fd2","app-description":"\u3053\u308c\u306f\u7121\u6599\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u6570\u5b66\u6f14\u7fd2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3001\u4e3b\u306b\u5c0f\u5b66\u6821\u306e\u4f4e\u5b66\u5e74\u3067\u8db3\u3057\u7b97\u3001\u5f15\u304d\u7b97\u300199\u306e\u639b\u3051\u7b97\u3001\u6642\u8a08\u306e\u8aad\u307f\u65b9\u3092\u7df4\u7fd2\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u5c31\u5b66\u524d\u306e\u5b66\u6821\u306b\u9069\u3057\u305f\u30b7\u30e5\u30eb\u30c6\u30fb\u30c6\u30fc\u30d6\u30eb\u3082\u3042\u308a\u307e\u3059\u3002","app-keywords":"\u30b7\u30e5\u30eb\u30c6\u30fb\u30c6\u30fc\u30d6\u30eb,\u8db3\u3057\u7b97\u306e\u7df4\u7fd2,\u5f15\u304d\u7b97\u306e\u7df4\u7fd2,\u4e5d\u4e5d\u639b\u3051\u7b97\u306e\u7df4\u7fd2,19 x 19 \u639b\u3051\u7b97\u639b\u3051\u7b97\u306e\u7df4\u7fd2,\u6642\u8a08\u306e\u7df4\u7fd2","schulte-table":"\u30b7\u30e5\u30eb\u30c6\u30fb\u30c6\u30fc\u30d6\u30eb","addition":"\u8db3\u3057\u7b97\u306e\u7df4\u7fd2","subtraction":"\u5f15\u304d\u7b97\u306e\u7df4\u7fd2","multiplication-9x9":"\u4e5d\u4e5d\u639b\u3051\u7b97\u306e\u7df4\u7fd2","multiplication-19x19":"19 x 19 \u639b\u3051\u7b97\u306e\u7df4\u7fd2","clock":"\u6642\u8a08\u306e\u7df4\u7fd2","sections":"\u30c8\u30d4\u30c3\u30af\u306e\u9078\u629e","answering-method":"\u56de\u7b54\u65b9\u6cd5","choice":"\u5358\u4e00\u9078\u629e\u306e\u8cea\u554f","filling":"\u8cea\u554f\u306e\u8a18\u5165","time-limit":"\u6642\u9593\u5236\u9650","seconds":"\u79d2","number-of-questions":"\u8cea\u554f\u306e\u6570","questions":"\u8cea\u554f","character":"\u30ad\u30e3\u30e9\u30af\u30bf\u30fc","grid":"\u683c","add-within-10":"10\u307e\u3067\u306e\u8db3\u3057\u7b97","add-within-20":"20\u307e\u3067\u306e\u8db3\u3057\u7b97","two-digit-addition":"2\u6841\u306e\u8db3\u3057\u7b97","three-digit-addition":"3\u6841\u306e\u8db3\u3057\u7b97","four-digit-addition":"4\u6841\u306e\u8db3\u3057\u7b97","subtract-within-10":"10\u307e\u3067\u306e\u5f15\u304d\u7b97","subtract-within-20":"20\u307e\u3067\u306e\u5f15\u304d\u7b97","two-digit-subtraction":"2\u6841\u306e\u5f15\u304d\u7b97","three-digit-subtraction":"3\u6841\u306e\u5f15\u304d\u7b97","four-digit-subtraction":"4\u6841\u306e\u5f15\u304d\u7b97","o-clock":"\u6e80\u6642","half-an-hour":"30\u5206","five-minutes":"5\u5206","one-minute":"1\u5206","one-second":"1\u79d2","timeout":"\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\uff01","wrong-answer":"\u9593\u9055\u3063\u305f\u7b54\u3048\uff01","answer":"\u7b54\u3048","next":"\u6b21\u306e\u8cea\u554f","close":"\u9589\u3058\u308b","review":"\u30ec\u30d3\u30e5\u30fc","reply":"\u8fd4\u4fe1","avg-duration":"\u5e73\u5747\u6ede\u5728\u6642\u9593","total-duration":"\u5408\u8a08\u671f\u9593","duration":"\u6642\u9593\u304c\u304b\u304b\u308b(\u79d2)","question":"\u8cea\u554f","number-of-correct":"\u6b63\u89e3\u6570","number-of-wrong":"\u9593\u9055\u3063\u305f\u6570","number-of-timeout":"\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u306e\u6570","select-all":"\u3059\u3079\u3066\u9078\u629e","start":"\u30b9\u30bf\u30fc\u30c8","click":"\u62bc\u3059"}')},54:function(t,e,n){},69:function(t,e,n){},73:function(t,e,n){"use strict";n.r(e);var i=n(0),a=n(1),s=n.n(a),o=n(37),c=n.n(o),r=(n(54),n(2)),u=n(38),l=n(30),d=n(41),h=n(42),m=n(43),p=n(44),g={},f=[],b=function(t){g[t.path]={name:t.language,translation:t},f.push(t.path)};b(d),b(h),b(m),b(p),r.a.use(u.a).use(l.a).init({lowerCaseLng:!0,whitelist:f,resources:g,fallbackLng:"en",keySeparator:!1,interpolation:{escapeValue:!1}});r.a;var j=n(3),x=n(7),v=n(5),w=n(4),O=n(27),S=n(8),k=n(29),y=(n(69),n(35),function t(e){var n=this;Object(j.a)(this,t),this.start=function(){n.intervalId=setInterval((function(){n.durationSeconds+=n.intervalSeconds,n.callback&&n.callback(n.durationSeconds)}),1e3*n.intervalSeconds)},this.stop=function(){n.intervalId&&clearInterval(n.intervalId)},this.restart=function(){n.stop(),n.durationSeconds=0,n.start()},this.getDuration=function(){return n.durationSeconds},this.intervalSeconds=.1,this.durationSeconds=0,this.callback=e}),C=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;return Object(j.a)(this,n),(i=e.call(this,t)).updateTime=function(t){i.setState({time:"".concat(t.toFixed(1),"s")})},i.checkAnswer=function(t){i.answerTimer.stop(),clearTimeout(i.effectId);var e="incorrect",n=i.state.cursor,a=i.questionBank.checkAnswer(t.value);if(i.logAnswer(t),a&&(e="correct",null===(n=i.questionBank.nextCursor())))return i.timer.stop(),i.setState({time:null}),i.props.onFinish(i.results),void(i.results=[]);i.setState({clicked:{value:t.value,sytle:e},cursor:n}),i.effectId=setTimeout((function(){i.setState({clicked:{}})}),500),i.answerTimer.restart()},i.logAnswer=function(t){var e=Math.sqrt(i.state.characters.length),n={question:{description:"".concat(e," x ").concat(e," ").concat(r.a.t("grid")),answer:{text:"".concat(r.a.t("click")," ").concat(i.state.cursor.text)}},reply:t.text,correct:i.questionBank.checkAnswer(t.value),duration:i.answerTimer.getDuration()};i.results.push(n)},i.questionBank=t.questionBank,i.results=[],i.timer=new y(i.updateTime),i.answerTimer=new y,i.state={characters:i.questionBank.nextQuestion(),cursor:i.questionBank.nextCursor(),clicked:{},time:0},i}return Object(x.a)(n,[{key:"componentDidMount",value:function(){this.timer.start(),this.answerTimer.start()}},{key:"componentWillUnmount",value:function(){this.timer.stop(),this.answerTimer.stop()}},{key:"render",value:function(){var t=this,e=this.state.clicked;return Object(i.jsx)("div",{children:Object(i.jsxs)("div",{className:"schulte-table",children:[Object(i.jsxs)("div",{className:"cursor",children:[r.a.t("click"),"\uff1a",Object(i.jsx)("b",{children:this.state.cursor.text})]}),Object(i.jsx)("div",{className:"time",children:this.state.time}),Object(i.jsx)("div",{className:"characters size-".concat(this.state.characters.length),children:this.state.characters.map((function(n){return n&&Object(i.jsx)("div",{className:"cell ".concat(e.value===n.value?e.sytle:""),onClick:function(){return t.checkAnswer(n)},children:Object(i.jsx)("span",{children:n.text})},n.value)}))})]})})}}]),n}(a.Component),q=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;return Object(j.a)(this,n),(i=e.call(this,t)).reset=function(){i.timer.restart()},i.pause=function(){i.timer.stop()},i.resume=function(){i.timer.start()},i.countdown=function(){i.setState({time:i.maximum-i.timer.getDuration()}),i.props.onChanged(i.state.time),i.state.time>0||i.timeout()},i.timeout=function(){i.timer.stop(),i.props.timeout()},i.getDuration=function(){return Math.min(i.maximum,i.timer.getDuration())},i.getStatus=function(){var t=Math.round(i.state.time/i.maximum*100);return t<20?"danger":t<50?"warning":""},i.maximum=parseFloat(t.seconds||10),i.timer=new y(i.countdown),i.state={time:i.maximum},i}return Object(x.a)(n,[{key:"render",value:function(){return Object(i.jsx)("progress",{className:this.getStatus(),max:this.maximum,value:this.state.time.toFixed(1)})}}]),n}(a.Component),R=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;Object(j.a)(this,n),(i=e.call(this,t)).onClick=function(t){i.input+="".concat(t),i.props.onChanged&&i.props.onChanged(i.input)},i.onBack=function(){i.input.length<=1?i.clear():i.input=i.input.substring(0,i.input.length-1),i.props.onChanged&&i.props.onChanged(i.input)},i.onConfirm=function(){""!==i.input&&(i.props.onConfirm(i.input),i.clear())},i.clear=function(){i.input=""},i.state={clicked:{}},i.numbers=[];for(var a=1;a<=9;a++)i.numbers.push(a);return i.clear(),i}return Object(x.a)(n,[{key:"render",value:function(){var t=this,e=this.state.clicked;return Object(i.jsx)("div",{className:"numeric-keypad",children:Object(i.jsxs)("div",{className:"numbers",children:[this.numbers.map((function(n){return Object(i.jsx)("div",{className:"cell ".concat(e.num===n?e.sytle:""),onClick:function(){return t.onClick(n)},children:Object(i.jsx)("span",{children:n})},n)})),Object(i.jsx)("div",{className:"cell",onClick:function(){return t.onBack()},children:Object(i.jsx)("span",{className:"icon-backspace"})}),Object(i.jsx)("div",{className:"cell ".concat(0===e.num?e.sytle:""),onClick:function(){return t.onClick(0)},children:Object(i.jsx)("span",{children:"0"})}),Object(i.jsx)("div",{className:"cell",onClick:function(){return t.onConfirm()},children:Object(i.jsx)("span",{className:"icon-check"})})]})})}}]),n}(a.Component),N=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var a;Object(j.a)(this,n),(a=e.call(this,t)).nextQuestion=function(){a.setState({correct:null});var t=a.questionBank.nextQuestion();if(null===t)return a.props.onFinish(a.results),void(a.results=[]);a.state.choices.splice(0,a.state.choices.length),t.reply="",t.count=a.questionBank.getCount(),t.cursor=a.questionBank.getCursor(),a.setState(t),a.countdown.current.reset(),a.numericKeypad.current&&a.numericKeypad.current.clear()},a.checkAnswer=function(t){t=null==t?"":t,a.countdown.current.pause();var e=a.questionBank.checkAnswer(t);a.logAnswer(t),a.setState({correct:e,reply:t}),e&&a.nextQuestion()},a.logAnswer=function(t){var e={question:a.state,reply:a.questionBank.convertText(t,a.state.disableSecondhand),correct:a.questionBank.checkAnswer(t),duration:a.countdown.current.getDuration()};a.results.push(e)},a.onCountdownChanged=function(t){a.setState({countdown:t})},a.renderSwitch=function(){switch(a.state.answerMethod){case"filling":return Object(i.jsx)(R,{ref:a.numericKeypad,onChanged:function(t){return a.setState({reply:t})},onConfirm:function(t){return a.checkAnswer(parseInt(t))}});default:return Object(i.jsx)("ul",{className:"choices",children:a.state.choices.map((function(t,e){return Object(i.jsx)("li",{onClick:function(){return a.checkAnswer(t.value)},children:Object(i.jsx)("span",{children:t.text})},e)}))})}},a.questionBank=t.questionBank;var o=a.questionBank.getSetting("anwser-method"),c=a.questionBank.getSetting("timeoutSeconds");return a.results=[],a.state={description:"",answer:{},choices:[],reply:"",timeoutSeconds:c,answerMethod:null==o?"choice":o[0].value,count:a.questionBank.getCount(),cursor:a.questionBank.getCursor()},a.countdown=s.a.createRef(),a.numericKeypad=s.a.createRef(),a}return Object(x.a)(n,[{key:"componentDidMount",value:function(){this.nextQuestion()}},{key:"componentWillUnmount",value:function(){this.countdown.current.pause()}},{key:"render",value:function(){var t=this;return Object(i.jsxs)("div",{className:"answer-method ".concat(this.state.answerMethod),children:[Object(i.jsx)("span",{className:"questionNumber",children:"".concat(this.state.cursor,"/").concat(this.state.count)}),Object(i.jsxs)("div",{className:"question ".concat(this.state.countdown<3&&!1!==this.state.correct&&"blink"),children:[this.state.description," ","filling"===this.state.answerMethod&&Object(i.jsx)("span",{children:"= ".concat(this.state.reply)})]}),!1===this.state.correct?Object(i.jsxs)("div",{children:[Object(i.jsxs)("p",{children:[""===this.state.reply?r.a.t("timeout"):r.a.t("wrong-answer")," ",r.a.t("answer"),"\uff1a",this.state.answer.text]}),Object(i.jsx)("span",{className:"btn large blue",onClick:function(){return t.nextQuestion()},children:r.a.t("next")})]}):this.renderSwitch(),Object(i.jsx)(q,{ref:this.countdown,seconds:this.state.timeoutSeconds,timeout:function(){return t.checkAnswer(t.state.reply)},onChanged:function(e){return t.onCountdownChanged(e)}})]})}}]),n}(a.Component),M=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;Object(j.a)(this,n),i=e.call(this,t);var a=0,s=0,o=0,c=0,r=i.props.results||[];return r.forEach((function(t){t.correct?a++:t.reply?s++:o++,c+=t.duration})),i.state={results:r,correct:a,incorrect:s,timeout:o,avgDuration:r.length&&c/r.length,duration:c,score:r.length&&Math.floor(a/r.length*100)},i}return Object(x.a)(n,[{key:"render",value:function(){var t=this;return Object(i.jsx)("div",{className:"modal",children:Object(i.jsxs)("div",{className:"modal-content",children:[Object(i.jsx)("span",{className:"close",onClick:function(){return t.props.onClose()},children:"x"}),Object(i.jsx)("table",{children:Object(i.jsxs)("tbody",{children:[Object(i.jsxs)("tr",{className:"correct",children:[Object(i.jsxs)("td",{children:[r.a.t("number-of-correct"),"\uff1a"]}),Object(i.jsx)("td",{children:this.state.correct})]}),Object(i.jsxs)("tr",{className:this.state.incorrect>0?"incorrect":"",children:[Object(i.jsxs)("td",{children:[r.a.t("number-of-wrong"),"\uff1a"]}),Object(i.jsx)("td",{children:this.state.incorrect})]}),this.state.timeout>0&&Object(i.jsxs)("tr",{className:"incorrect",children:[Object(i.jsxs)("td",{children:[r.a.t("number-of-timeout"),"\uff1a"]}),Object(i.jsx)("td",{children:this.state.timeout})]}),Object(i.jsxs)("tr",{children:[Object(i.jsxs)("td",{children:[r.a.t("avg-duration"),"\uff1a"]}),Object(i.jsxs)("td",{children:[this.state.avgDuration.toFixed(1)," ",r.a.t("seconds")]})]}),Object(i.jsxs)("tr",{children:[Object(i.jsxs)("td",{children:[r.a.t("total-duration"),"\uff1a"]}),Object(i.jsxs)("td",{children:[this.state.duration.toFixed(1)," ",r.a.t("seconds")]})]})]})}),Object(i.jsx)("hr",{}),this.state.incorrect>0&&Object(i.jsxs)("table",{children:[Object(i.jsx)("thead",{children:Object(i.jsxs)("tr",{children:[Object(i.jsx)("th",{style:{width:"5%"}}),Object(i.jsx)("th",{children:r.a.t("question")}),Object(i.jsx)("th",{style:{width:"20%"},children:r.a.t("answer")}),Object(i.jsx)("th",{style:{width:"20%"},children:r.a.t("reply")}),Object(i.jsx)("th",{style:{width:"25%"},children:r.a.t("duration")})]})}),Object(i.jsx)("tbody",{children:this.state.results.map((function(t,e){return t.correct||Object(i.jsxs)("tr",{className:t.correct?"correct":"incorrect",children:[Object(i.jsx)("td",{children:Object(i.jsx)("b",{})}),Object(i.jsx)("td",{children:t.question.description}),Object(i.jsx)("td",{children:t.question.answer.text}),Object(i.jsx)("td",{children:""===t.reply?"--":t.reply}),Object(i.jsx)("td",{children:t.duration.toFixed(1)})]},e)}))})]}),Object(i.jsxs)("div",{className:"modal-footer",children:[Object(i.jsx)("span",{className:"btn",onClick:function(){return t.props.onClose()},children:r.a.t("close")}),this.props.enableReview&&this.state.incorrect>=3&&Object(i.jsx)("span",{className:"btn blue",onClick:function(){return t.props.onReview()},children:r.a.t("review")})]})]})})}}]),n}(a.Component),B=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var a;Object(j.a)(this,n),(a=e.call(this,t)).onStart=function(){a.state.ready>0&&a.props.onStart(a.state.options.map((function(t){return null!=t.selections&&(t.selections=t.selections.filter((function(t){return t.selected}))),t})))},a.onSelected=function(t,e){e.selections.forEach((function(n){n.text===t.target.value?n.selected=t.target.checked:"single-choice"===e.type&&(n.selected=!1)})),e.selectedAll=0===e.selections.filter((function(t){return!0!==t.selected})).length,a.updateMenuItem(e)},a.onSlide=function(t,e){e.value=t.target.value,a.updateMenuItem(e),a.setState((function(t){t.options.forEach((function(t){t.name===e.name&&(t=e)}))}))},a.toggleAll=function(t){var e=a.state.options.filter((function(e){return e.name===t}))[0],n=e.selections;e.selectedAll=!e.selectedAll,n.forEach((function(t){t.selected=e.selectedAll})),a.updateMenuItem(e)},a.updateMenuItem=function(t){var e=!0;a.setState((function(n){return n.options.forEach((function(n){n.name===t.name&&(n=t),null!=n.selections&&0===n.selections.filter((function(t){return t.selected})).length&&(e=!1)})),{options:n.options,ready:e}}))},a.renderSwitch=function(t){switch(t.type){case"single-choice":case"multiple-choice":return Object(i.jsxs)("ul",{className:"sections",children:[t.selections.map((function(e,n){return Object(i.jsx)("li",{children:Object(i.jsxs)("label",{children:[Object(i.jsx)("input",{type:"checkbox",value:e.text,onChange:function(e){return a.onSelected(e,t)},checked:e.selected||!1}),Object(i.jsx)("span",{children:e.text})]})},n)})),"multiple-choice"===t.type&&Object(i.jsx)("li",{children:Object(i.jsxs)("label",{children:[Object(i.jsx)("input",{type:"checkbox",onChange:function(){return a.toggleAll(t.name)},checked:t.selectedAll||!1}),Object(i.jsx)("span",{children:r.a.t("select-all")})]})})]});case"range-slider":return Object(i.jsxs)("div",{className:"sections",children:[Object(i.jsx)("input",{className:"slider",type:"range",min:t.min,max:t.max,step:t.step,value:t.value,onChange:function(e){return a.onSlide(e,t)}}),t.value," ",t.unit]});default:return Object(i.jsx)("div",{})}};var s=a.props.questionBank,o=s.getTitle(),c=s.getOptions();return a.state={title:o,options:c,ready:!0},a}return Object(x.a)(n,[{key:"render",value:function(){var t=this;return Object(i.jsxs)("div",{children:[Object(i.jsx)("h2",{children:this.state.title}),this.state.options.map((function(e,n){return Object(i.jsxs)("section",{children:[Object(i.jsx)("h3",{children:e.title}),t.renderSwitch(e)]},n)})),Object(i.jsx)("nav",{children:Object(i.jsx)("span",{className:"btn large ".concat(this.state.ready?"green":"disable"),onClick:function(){return t.onStart()},children:r.a.t("start")})})]})}}]),n}(a.Component),I=n(45),T="https://math-exercise.johnwu.cc",A="1046791958755149",Q=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;for(var a in Object(j.a)(this,n),(i=e.call(this,t)).lang=r.a.language,i.title=t.title||r.a.t("app-name"),i.description=t.description||r.a.t("app-description"),i.keywords=t.keywords||r.a.t("app-keywords"),document.title=i.title,i.meta=[{name:"description",content:i.description},{name:"keywords",content:i.keywords},{itemprop:"name",content:i.title},{itemprop:"description",content:i.description},{property:"og:title",content:i.title},{property:"og:description",content:i.description},{property:"og:type",content:"website"},{property:"og:url",content:"".concat(T).concat(window.location.pathname)},{property:"fb:app_id",content:A},{name:"twitter:card",content:"summary"},{name:"twitter:title",content:i.title},{name:"twitter:description",content:i.description}],i.link=[],g){var s="".concat(T).concat(window.location.pathname.replace(i.lang,a));i.link.push({rel:"alternate",hreflang:a,href:s})}return i}return Object(x.a)(n,[{key:"render",value:function(){return Object(i.jsx)(I.a,{htmlAttributes:{lang:this.lang},title:this.props.title,meta:this.meta,link:this.link})}}]),n}(a.Component),E=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var a;return Object(j.a)(this,n),(a=e.call(this,t)).onStart=function(t){a.questionBank.setSettings(t),a.questionBank.initQuestions(),a.setState({componentName:a.questionBank.getSetting("component"),enableReview:a.questionBank.getSetting("enableReview")})},a.showResult=function(t){a.state.results.splice(0,a.state.results.length),a.setState({isShowResult:!0,results:t})},a.onReview=function(){for(var t=[],e=a.state.results.filter((function(t){return!t.correct})).map((function(t){return t.question})),n=0;n<3;n++)t=t.concat(e);a.questionBank.setQuestions(t),a.quizAttempt.current.nextQuestion(),a.setState({isShowResult:!1})},a.onClose=function(){a.props.history.push("/".concat(r.a.language,"/"))},a.renderSwitch=function(t){switch(t){case"QuizAttempt":return Object(i.jsx)(N,{ref:a.quizAttempt,questionBank:a.questionBank,onFinish:function(t){return a.showResult(t)}});case"SchulteTable":return Object(i.jsx)(C,{questionBank:a.questionBank,onFinish:function(t){return a.showResult(t)}});default:return Object(i.jsx)(B,{questionBank:a.questionBank,onStart:function(t){return a.onStart(t)}})}},a.state={results:[]},a.quizAttempt=s.a.createRef(),a.handleUnload=a.handleUnload.bind(Object(k.a)(a)),a.questionBank=a.props.questionBank(),a}return Object(x.a)(n,[{key:"componentDidMount",value:function(){window.addEventListener("beforeunload",this.handleUnload)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("beforeunload",this.handleUnload)}},{key:"handleUnload",value:function(t){return(t||window.event).returnValue="",""}},{key:"render",value:function(){var t=this;return Object(i.jsxs)("div",{children:[Object(i.jsx)(Q,{title:"".concat(this.questionBank.getTitle()," | ").concat(r.a.t("app-name"))}),Object(i.jsx)("div",{className:"header",children:this.state.isShowResult||Object(i.jsx)("span",{className:"close",onClick:function(){return t.onClose()},children:"x"})}),this.renderSwitch(this.state.componentName),this.state.isShowResult&&Object(i.jsx)(M,{enableReview:this.state.enableReview,results:this.state.results,onReview:function(){return t.onReview()},onClose:function(){return t.onClose()}})]})}}]),n}(a.Component),D=Object(S.f)(E),F=function t(){Object(j.a)(this,t)};F.pickRandomItems=function(t,e){for(var n=[],i=0;i<e;i++){var a=F.getRandomInt(t.length),s=t.splice(a,1)[0];n.push(s)}return n},F.getRandomInt=function(t){return F.getRandomIntRange(0,t)},F.getRandomIntRange=function(t,e){return Math.floor(Math.random()*(e-t)+t)};var P=function t(){var e=this;Object(j.a)(this,t),this.getTitle=function(){return e.getSetting("title")},this.getCount=function(){return e.count},this.getCursor=function(){return e.cursor},this.generateChoices=function(t){for(var n=t.answer.value,i=t.answerRange||20,a=[],s=Math.max(2,n-i);s<n+i;s++)s!==n&&a.push({text:e.convertText(s),value:s});var o=e.getSetting("choiceCount")-1,c=F.pickRandomItems(a,o);return c.splice(F.getRandomInt(o),0,{text:e.convertText(n),value:n}),c},this.setQuestions=function(t){e.questions=t||[],e.count=e.questions.length,e.cursor=0},this.nextQuestion=function(){if(0===e.questions.length)return null;e.cursor++;var t=F.getRandomInt(e.questions.length),n=e.questions.splice(t,1)[0];return n.choices=e.generateChoices(n),e.currentQuestion=n},this.checkAnswer=function(t){return null!=t&&t.toString()===e.currentQuestion.answer.value.toString()},this.convertText=function(t){return t.toString()},this.getOptions=function(){var t=e.getSections();return t[0].selected=!0,e.getSetting("options").map((function(e){return"sections"===e.name?e.selections=t:"timeoutSeconds"===e.name?e.value=10:"questionCount"===e.name&&(e.value=20),e}))},this.setSettings=function(t){t.forEach((function(t){e.settings[t.name]=t.selections||t.value}))},this.getSetting=function(t){return e.settings[t]},this.settings={component:"QuizAttempt",enableReview:!0,choiceCount:6,options:[{title:r.a.t("sections"),name:"sections",type:"multiple-choice"},{title:r.a.t("answering-method"),name:"anwser-method",type:"single-choice",selections:[{text:r.a.t("choice"),value:"choice",selected:!0},{text:r.a.t("filling"),value:"filling"}]},{title:r.a.t("time-limit"),name:"timeoutSeconds",type:"range-slider",value:10,unit:r.a.t("seconds"),min:3,max:60,step:1},{title:r.a.t("number-of-questions"),name:"questionCount",type:"range-slider",value:20,unit:r.a.t("questions"),min:10,max:100,step:5}]}},z=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(){var t;return Object(j.a)(this,n),(t=e.call(this)).getOptions=function(){var e=t.getSections();return e[0].selected=!0,[{title:r.a.t("sections"),name:"sections",type:"single-choice",selections:e},{title:r.a.t("character"),name:"character",type:"single-choice",selections:[{text:"123",value:"numeral",selected:!0},{text:"\u3105\u3106\u3107",value:"\u3105\u3106\u3107\u3108\u3109\u310a\u310b\u310c\u310d\u310e\u310f\u3110\u3111\u3112\u3113\u3114\u3115\u3116\u3117\u3118\u3119\u3127\u3128\u3129\u311a\u311b\u311c\u311d\u311e\u311f\u3120\u3121\u3122\u3123\u3124\u3125\u3126"},{text:"ABC",value:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"},{text:"abc",value:"abcdefghijklmnopqrstuvwxyz"},{text:"\u3042\u3044\u3046",value:"\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3053\u3055\u3057\u3059\u305b\u305d\u305f\u3061\u3064\u3066\u3068\u306a\u306b\u306c\u306d\u306e\u306f\u3072\u3075\u3078\u307b\u307e\u307f\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308a\u308b\u308c\u308d\u308f\u3092\u3093"},{text:"\u30a2\u30a4\u30a6",value:"\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f2\u30f3"}]}]},t.getSections=function(){for(var t=[],e=3;e<=9;e++)t.push({text:"".concat(e," x ").concat(e," ").concat(r.a.t("grid")),value:e});return t},t.initQuestions=function(){for(var e=t.getSetting("sections")[0].value,n=t.characters=t.getCharacters(t.getSetting("character")[0].value),i=Math.min(e,Math.ceil(Math.sqrt(n.length))),a=Math.pow(i,2),s=[],o=1;o<=a;o++){var c=n[o-1];s.push(null==c?null:{text:c,value:o})}t.setQuestions(F.pickRandomItems(s,a))},t.nextQuestion=function(){return t.cursor=0,t.questions},t.checkAnswer=function(e){return null!=e&&e===t.cursor},t.nextCursor=function(){if(t.cursor>=t.questions.length)return null;var e=t.cursor++,n=t.characters[e];return null==n?null:{text:n,value:e}},t.getCharacters=function(t){return"numeral"===t?Array.from({length:Math.pow(9,2)},(function(t,e){return e+1})):t.split("")},t.settings.route="schulte-table",t.settings.title=r.a.t(t.settings.route),t.settings.component="SchulteTable",t.settings.enableReview=!1,t}return n}(P),U=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(){var t;return Object(j.a)(this,n),(t=e.call(this)).getSections=function(){return[{text:r.a.t("add-within-10"),minimum:0,minSummation:1,maxSummation:10,answerRange:10,maxCount:45},{text:r.a.t("add-within-20"),minimum:0,minSummation:10,maxSummation:20,answerRange:10},{text:r.a.t("two-digit-addition"),minimum:10,minSummation:20,maxSummation:99,answerRange:20},{text:r.a.t("three-digit-addition"),minimum:100,minSummation:200,maxSummation:999,answerRange:50},{text:r.a.t("four-digit-addition"),minimum:1e3,minSummation:2e3,maxSummation:9999,answerRange:50}]},t.initQuestions=function(){var e=t.getSetting("sections")||t.getSections(),n=t.getSetting("questionCount"),i=Math.ceil(n/e.length),a=[];e.forEach((function(e){for(var s=new Map;s.size<Math.min(i,e.maxCount||n);){var o=F.getRandomIntRange(e.minSummation,e.maxSummation),c=F.getRandomIntRange(e.minimum,o-e.minimum),r=o-c,u="".concat(c," + ").concat(r);s.set(u,{description:u,answer:{text:t.convertText(o),value:o},answerRange:e.answerRange})}s.forEach((function(t){a.push(t)}))})),a=F.pickRandomItems(a,Math.min(n,a.length));for(var s=0;a.length<n;s++)s>=a.length&&(s=0),a.push(a[s]);t.setQuestions(a)},t.settings.route="addition",t.settings.title=r.a.t(t.settings.route),t}return n}(P),L=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(){var t;return Object(j.a)(this,n),(t=e.call(this)).getSections=function(){return[{text:r.a.t("subtract-within-10"),minimum:0,minSummation:1,maxSummation:10,answerRange:10,maxCount:45},{text:r.a.t("subtract-within-20"),minimum:0,minSummation:10,maxSummation:20,answerRange:10},{text:r.a.t("two-digit-subtraction"),minimum:10,minSummation:20,maxSummation:99,answerRange:20},{text:r.a.t("three-digit-subtraction"),minimum:100,minSummation:200,maxSummation:999,answerRange:50},{text:r.a.t("four-digit-subtraction"),minimum:1e3,minSummation:2e3,maxSummation:9909,answerRange:50}]},t.initQuestions=function(){var e=t.getSetting("sections")||t.getSections(),n=t.getSetting("questionCount"),i=Math.ceil(n/e.length),a=[];e.forEach((function(e){for(var s=new Map;s.size<Math.min(i,e.maxCount||n);){var o=F.getRandomIntRange(e.minSummation,e.maxSummation),c=F.getRandomIntRange(e.minimum,o),r=o-c,u="".concat(o," - ").concat(c);s.set(u,{description:u,answer:{text:t.convertText(r),value:r},answerRange:e.answerRange})}s.forEach((function(t){a.push(t)}))})),a=F.pickRandomItems(a,Math.min(n,a.length));for(var s=0;a.length<n;s++)s>=a.length&&(s=0),a.push(a[s]);t.setQuestions(a)},t.settings.route="subtraction",t.settings.title=r.a.t(t.settings.route),t}return n}(P),J=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;switch(Object(j.a)(this,n),(i=e.call(this)).getSections=function(){for(var t=[],e=i.getSetting("multiplier"),n=i.getSetting("multiplicand"),a=e;a<=n;a++)t.push({text:"".concat(a," x ").concat(n),value:a});return t},i.initQuestions=function(){var t=i.getSetting("sections"),e=i.getSetting("multiplicand"),n=[];(t||i.getSections()).forEach((function(t){for(var a=2;a<=e;a++)n.push({description:"".concat(t.value," x ").concat(a),answer:{text:i.convertText(t.value*a),value:t.value*a}})})),i.setQuestions(n)},t||1){case 2:i.settings.multiplier=11,i.settings.multiplicand=19,i.settings.route="multiplication-19x19";break;default:i.settings.multiplier=2,i.settings.multiplicand=9,i.settings.route="multiplication-9x9"}return i.settings.title=r.a.t(i.settings.route),i.settings.options=i.settings.options.filter((function(t){return"questionCount"!==t.name})),i}return n}(P),W=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;return Object(j.a)(this,n),(i=e.call(this,t)).drawClock=function(t){var e=i.canvas.current;e.height=e.width;var n=e.getContext("2d"),a=e.height/2;n.translate(a,a),a*=.9,i.context=n,i.radius=a;var s=(t||"00:00:00").split(":"),o=s[0]||"0",c=s[1]||"0",r=s[2]||"0";i.drawFace(),i.drawNumbers(),i.drawTime(o,c,r)},i.drawFace=function(){var t=i.context,e=i.radius;t.beginPath(),t.arc(0,0,e,0,2*Math.PI),t.fillStyle="white",t.fill()},i.drawNumbers=function(){var t=i.context,e=i.radius;t.beginPath(),t.fillStyle="black",t.font="bold ".concat(.2*e,"px arial"),t.textBaseline="middle",t.textAlign="center";for(var n=1;n<13;n++){var a=n*Math.PI/6;t.rotate(a),t.translate(0,.85*-e),t.rotate(-a),t.fillText(n.toString(),0,0),t.rotate(a),t.translate(0,.85*e),t.rotate(-a)}},i.drawTime=function(t,e,n){var a=i.radius;t=(t%=12)*Math.PI/6+e*Math.PI/360+n*Math.PI/21600,i.drawHand(t,.4*a,.07*a),e=e*Math.PI/30+n*Math.PI/1800,i.drawHand(e,.7*a,.05*a),"true"!==i.disableSecondhand&&(n=n*Math.PI/30,i.drawHand(n,.6*a,.02*a,"red"))},i.drawHand=function(t,e,n,a){var s=i.context;a=a||"black",s.beginPath(),s.arc(0,0,e*n*.015,0,2*Math.PI),s.fillStyle=a,s.fill(),s.beginPath(),s.strokeStyle=a,s.lineWidth=n,s.lineCap="round",s.moveTo(0,0),s.rotate(t),s.lineTo(0,-e),s.stroke(),s.rotate(-t)},i.canvas=s.a.createRef(),i}return Object(x.a)(n,[{key:"componentWillReceiveProps",value:function(t){this.disableSecondhand=t.disableSecondhand,this.drawClock(t.hhmmss)}},{key:"componentDidMount",value:function(){this.disableSecondhand=this.props.disableSecondhand,this.drawClock(this.props.hhmmss)}},{key:"render",value:function(){return Object(i.jsx)("canvas",{className:"clock",ref:this.canvas,width:this.props.width||200})}}]),n}(a.Component),H=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(){var t;return Object(j.a)(this,n),(t=e.call(this)).secondsInDay=86400,t.getOptions=function(){var e=t.getSections();return e[0].selected=!0,[{title:r.a.t("sections"),name:"sections",type:"single-choice",selections:e},{title:r.a.t("time-limit"),name:"timeoutSeconds",type:"range-slider",value:10,unit:r.a.t("seconds"),min:3,max:60,step:1},{title:r.a.t("number-of-questions"),name:"questionCount",type:"range-slider",value:20,unit:r.a.t("questions"),min:10,max:100,step:5}]},t.getSections=function(){return[{text:r.a.t("o-clock"),intervalSeconds:3600,answerRange:10,maxCount:12},{text:r.a.t("half-an-hour"),intervalSeconds:1800,answerRange:10,maxCount:24},{text:r.a.t("five-minutes"),intervalSeconds:300,answerRange:10},{text:r.a.t("one-minute"),intervalSeconds:60,answerRange:10},{text:r.a.t("one-second"),intervalSeconds:5,answerRange:120}]},t.initQuestions=function(){var e=t.getSetting("sections")||t.getSections(),n=t.getSetting("questionCount"),a=Math.ceil(n/e.length),s=[];e.forEach((function(e){for(var o=new Map;o.size<Math.min(a,e.maxCount||n);){var c=5!==e.intervalSeconds,r=F.getRandomInt(t.secondsInDay/2);r-=r%e.intervalSeconds;var u=t.convertText(r,c);o.set(u,{description:Object(i.jsx)(W,{hhmmss:u,disableSecondhand:c.toString()}),answer:{text:u,value:r},answerRange:e.answerRange,intervalSeconds:e.intervalSeconds,disableSecondhand:c})}o.forEach((function(t){s.push(t)}))})),s=F.pickRandomItems(s,Math.min(n,s.length));for(var o=0;s.length<n;o++)o>=s.length&&(o=0),s.push(s[o]);t.setQuestions(s)},t.generateChoices=function(e){for(var n=e.answer.value,i=e.answerRange*e.intervalSeconds,a=e.intervalSeconds,s=[],o=Math.max(0,n-i);o<Math.min(n+i,t.secondsInDay/2);o+=a)o!==n&&s.push({text:t.convertText(o,e.disableSecondhand),value:o});var c=t.getSetting("choiceCount")-1,r=F.pickRandomItems(s,c);return r.splice(F.getRandomInt(c),0,{text:t.convertText(n,e.disableSecondhand),value:n}),r},t.convertText=function(t,e){var n=Math.floor(t/3600),i=Math.floor(t%3600/60),a=t%60,s="".concat((n=0===n?12:n).toString().padStart(2,"0"),":").concat(i.toString().padStart(2,"0"));return e||(s+=":".concat(a.toString().padStart(2,"0"))),s},t.settings.route="clock",t.settings.title=r.a.t(t.settings.route),t}return n}(P),K=[{path:"schulte-table",component:Object(i.jsx)(D,{questionBank:function(){return new z}})},{path:"addition",component:Object(i.jsx)(D,{questionBank:function(){return new U}})},{path:"subtraction",component:Object(i.jsx)(D,{questionBank:function(){return new L}})},{path:"multiplication-9x9",component:Object(i.jsx)(D,{questionBank:function(){return new J}})},{path:"multiplication-19x19",component:Object(i.jsx)(D,{questionBank:function(){return new J(2)}})},{path:"clock",component:Object(i.jsx)(D,{questionBank:function(){return new H}})}],V=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;for(var a in Object(j.a)(this,n),(i=e.call(this,t)).title=r.a.t("app-name"),i.translations=[],g)i.translations.push({path:a,name:g[a].name});return i}return Object(x.a)(n,[{key:"render",value:function(){return Object(i.jsxs)("div",{children:[Object(i.jsx)(Q,{}),Object(i.jsx)("div",{className:"header",children:Object(i.jsxs)("div",{className:"dropdown",children:[Object(i.jsx)("button",{className:"dropbtn",children:r.a.t("language")}),Object(i.jsx)("div",{className:"dropdown-content",children:this.translations.map((function(t,e){return Object(i.jsx)("a",{hrefLang:t.path,href:"/".concat(t.path,"/"),children:t.name},e)}))})]})}),Object(i.jsxs)("nav",{className:"menu",children:[Object(i.jsx)("h1",{children:this.title}),Object(i.jsx)("ul",{children:K.map((function(t,e){return Object(i.jsx)("li",{children:Object(i.jsx)(O.b,{className:"btn green",to:"/".concat(r.a.language,"/").concat(t.path,"/"),children:r.a.t(t.path)})},e)}))})]})]})}}]),n}(a.Component),G=function(t){Object(v.a)(n,t);var e=Object(w.a)(n);function n(t){var i;Object(j.a)(this,n),i=e.call(this,t);var a=window.location.pathname.split("/")[1];return g[a]||(a=r.a.language),a!==r.a.language&&r.a.changeLanguage(a),i}return Object(x.a)(n,[{key:"render",value:function(){return Object(i.jsx)("div",{className:"app",children:Object(i.jsx)(O.a,{children:Object(i.jsxs)(S.c,{children:[K.map((function(t,e){return Object(i.jsx)(S.a,{path:"/:lang/".concat(t.path),component:function(){return t.component}},e)})),Object(i.jsx)(S.a,{exact:!0,component:V})]})})})}}]),n}(a.Component),X=Object(l.b)()(G);c.a.render(Object(i.jsx)(X,{}),document.getElementById("root"))}},[[73,1,2]]]);
//# sourceMappingURL=main.82fd9acc.chunk.js.map