/*! For license information please see dll.Timer.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[132],{3170:function(t,e,n){"use strict";n.r(e);var i=n(135),r=n.n(i);e.default=function(t){var e=r()(t/60),n=t-60*e;return e=e<10?"0".concat(e):e,n=n<10?"0".concat(n):n,"".concat(e,":").concat(n)}},3171:function(t,e,n){"use strict";n.r(e);var i=n(135),r=n.n(i);e.default=function(t){t*=-1;var e=r()(t/60),n=t-60*e;return e=e<10?"0".concat(e):e,n=n<10?"0".concat(n):n,"-".concat(e,":").concat(n)}},3172:function(t,e,n){var i=n(54),r=n(3173);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var o={insert:"head",singleton:!1};i(r,o);t.exports=r.locals||{}},3173:function(t,e,n){"use strict";n.r(e);var i=n(22),r=n.n(i)()(!1);r.push([t.i,".timer-div {\n\tposition: fixed;\n\ttop: 0;\n\tright: 0;\n\tmargin-top: 10px;\n\tmargin-right: 25px;\n\tz-index: 9999;\n\tfont-size: 24px;\n\tpadding-left: 10px;\n\tpadding-right: 10px;\n\tborder-radius: 3px;\n}\n\n.timer-info {\n\tbackground-color: #383D48;\n\tcolor: white;\n}\n\n.timer-danger {\n\tbackground-color: #f87c87;\n\tcolor: #591801;\n}\n",""]),e.default=r},927:function(t,e,n){"use strict";n.r(e);var i=n(14),r=n.n(i),o=n(12),a=n.n(o),s=n(15),u=n.n(s),c=n(16),l=n.n(c),f=n(8),d=n.n(f),p=n(0),v=n.n(p),m=n(1),h=n.n(m),g=n(139),y=n.n(g),b=n(3170),w=n(3171);n(3172);function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=d()(t);if(e){var r=d()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return l()(this,n)}}var x=function(t){u()(n,t);var e=k(n);function n(t){var i;r()(this,n),i=e.call(this,t);var o=localStorage.getItem(i.getTimerId());return i.state={timeLeft:o||t.duration,duration:t.duration,finished:!1},i}return a()(n,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentDidUpdate",value:function(t,e){!this.props.active||t.active||this.state.countdown||this.startCountdown()}},{key:"componentWillUnmount",value:function(){var t=this.state.countdown;t&&clearInterval(t)}},{key:"getTimerId",value:function(){var t=this.props.id;return t?"timer::".concat(t):null}},{key:"startCountdown",value:function(){var t=this,e=setInterval((function(){t.setState({timeLeft:t.state.timeLeft-1});var n=t.getTimerId();n&&localStorage.setItem(n,t.state.timeLeft),!t.state.finished&&t.state.timeLeft<=0&&(t.props.belowZero||clearInterval(e),t.props.onTimeUp(),t.setState({finished:!0}))}),1e3);this.setState({countdown:e})}},{key:"render",value:function(){if(this.props.invisible)return null;var t=this.state.timeLeft>0?b.default:w.default;return v.a.createElement("div",{style:this.props.style,className:"timer-div ".concat(this.state.timeLeft<0?"timer-danger":"timer-info")},this.props.legend,t(this.props.belowZero?this.state.timeLeft:y()(this.state.timeLeft,0)))}}],[{key:"getDerivedStateFromProps",value:function(t,e){if(t.duration!==e.duration){var n={};return n.duration=t.duration,n.timeLeft=t.duration,n}return null}}]),n}(p.Component);x.propTypes={id:h.a.string,active:h.a.bool.isRequired,belowZero:h.a.bool,duration:h.a.number.isRequired,invisible:h.a.bool,legend:h.a.string,style:h.a.object,onTimeUp:h.a.func},x.defaultProps={id:null,belowZero:!1,invisible:!1,legend:"",style:{},onTimeUp:function(){}},e.default=x}}]);