pomodore-timer
Version:
npm i pomodore-timer
14 lines • 35.4 kB
JavaScript
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(e,t,r){"use strict";e.exports=r(8)},function(e,t){e.exports=require("react")},function(e,t,r){"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),a=[];function s(e){for(var t=-1,r=0;r<a.length;r++)if(a[r].identifier===e){t=r;break}return t}function u(e,t){for(var r={},n=[],o=0;o<e.length;o++){var i=e[o],u=t.base?i[0]+t.base:i[0],c=r[u]||0,l="".concat(u," ").concat(c);r[u]=c+1;var p=s(l),f={css:i[1],media:i[2],sourceMap:i[3]};-1!==p?(a[p].references++,a[p].updater(f)):a.push({identifier:l,updater:v(f,t),references:1}),n.push(l)}return n}function c(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=r.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var l,p=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function f(e,t,r,n){var o=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=p(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function h(e,t,r){var n=r.css,o=r.media,i=r.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var d=null,b=0;function v(e,t){var r,n,o;if(t.singleton){var i=b++;r=d||(d=c(t)),n=f.bind(null,r,i,!1),o=f.bind(null,r,i,!0)}else r=c(t),n=h.bind(null,r,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var r=u(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var o=s(r[n]);a[o].references--}for(var i=u(e,t),c=0;c<r.length;c++){var l=s(r[c]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}r=i}}}},function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"==typeof btoa){var o=(a=n,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(u," */")),i=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[r].concat(i).concat([o]).join("\n")}var a,s,u;return[r].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);n&&o[u[0]]||(r&&(u[2]?u[2]="".concat(r," and ").concat(u[2]):u[2]=r),t.push(u))}},t}},function(e,t,r){var n=r(2),o=r(5);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},function(e,t,r){(t=r(3)(!1)).push([e.i,"body {\r\n margin: 0;\r\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\r\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\r\n sans-serif;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n}\r\n\r\ncode {\r\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\r\n monospace;\r\n}\r\n:root{\r\n --red: #f54e4e;\r\n --green: #4aec8c;\r\n}\r\n\r\nbody{\r\n background-color: #30384b;\r\n color: #eee;\r\n}\r\nmain{\r\n padding-top: 50px;\r\n max-width: 340px;\r\n margin: 0 auto;\r\n text-align: center;\r\n}\r\n\r\nbutton{\r\n background-color: transparent;\r\n color: rgba(255,255,255,0.8);\r\n border:0;\r\n display: inline-block;\r\n width: 100px;\r\n cursor: pointer;\r\n}\r\n\r\nbutton.with-text{\r\n width: auto;\r\n background-color:rgba(255,255,255,0.1);\r\n border-radius:10px;\r\n padding: 10px 20px;\r\n font-size: 1.4rem;\r\n line-height: 36px;\r\n}\r\nbutton.with-text svg{\r\n width: 36px;\r\n float:left;\r\n margin-right: 5px;\r\n}\r\n\r\nlabel{\r\n display:block;\r\n margin-bottom: 10px;\r\n margin-top: 20px;\r\n text-transform: capitalize;\r\n}",""]),e.exports=t},function(e,t,r){var n=r(2),o=r(7);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},function(e,t,r){(t=r(3)(!1)).push([e.i,'/*\n * react-circular-progressbar styles\n * All of the styles in this file are configurable!\n */\n\n.CircularProgressbar {\n /*\n * This fixes an issue where the CircularProgressbar svg has\n * 0 width inside a "display: flex" container, and thus not visible.\n */\n width: 100%;\n /*\n * This fixes a centering issue with CircularProgressbarWithChildren:\n * https://github.com/kevinsqi/react-circular-progressbar/issues/94\n */\n vertical-align: middle;\n}\n\n.CircularProgressbar .CircularProgressbar-path {\n stroke: #3e98c7;\n stroke-linecap: round;\n -webkit-transition: stroke-dashoffset 0.5s ease 0s;\n transition: stroke-dashoffset 0.5s ease 0s;\n}\n\n.CircularProgressbar .CircularProgressbar-trail {\n stroke: #d6d6d6;\n /* Used when trail is not full diameter, i.e. when props.circleRatio is set */\n stroke-linecap: round;\n}\n\n.CircularProgressbar .CircularProgressbar-text {\n fill: #3e98c7;\n font-size: 20px;\n dominant-baseline: middle;\n text-anchor: middle;\n}\n\n.CircularProgressbar .CircularProgressbar-background {\n fill: #d6d6d6;\n}\n\n/*\n * Sample background styles. Use these with e.g.:\n *\n * <CircularProgressbar\n * className="CircularProgressbar-inverted"\n * background\n * percentage={50}\n * />\n */\n.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-background {\n fill: #3e98c7;\n}\n\n.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-text {\n fill: #fff;\n}\n\n.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-path {\n stroke: #fff;\n}\n\n.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-trail {\n stroke: transparent;\n}\n',""]),e.exports=t},function(e,t,r){"use strict";
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/r(9);var n=r(1),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,i={},c=null,l=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)s.call(t,n)&&!u.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:l,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},function(e,t,r){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,u=a(e),c=1;c<arguments.length;c++){for(var l in r=Object(arguments[c]))o.call(r,l)&&(u[l]=r[l]);if(n){s=n(r);for(var p=0;p<s.length;p++)i.call(r,s[p])&&(u[s[p]]=r[s[p]])}}return u}},function(e,t,r){var n=r(2),o=r(11);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},function(e,t,r){(t=r(3)(!1)).push([e.i,".slider{\r\n height: 40px;\r\n border: 2px solid var(--red);\r\n border-radius: 20px;\r\n}\r\n\r\n.thumb{\r\n background-color: var(--red);\r\n cursor:pointer;\r\n width:40px;\r\n height: 40px;\r\n border-radius: 20px;\r\n}\r\n\r\n.slider.green{\r\n border: 2px solid var(--green);\r\n}\r\n.slider.green .thumb{\r\n background-color: var(--green);\r\n}",""]),e.exports=t},function(e,t,r){"use strict";r.r(t);r(4);var n=r(1),o=r.n(n),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function a(e){var t=e.className,r=e.counterClockwise,o=e.dashRatio,i=e.pathRadius,a=e.strokeWidth,c=e.style;return Object(n.createElement)("path",{className:t,style:Object.assign({},c,u({pathRadius:i,dashRatio:o,counterClockwise:r})),d:s({pathRadius:i,counterClockwise:r}),strokeWidth:a,fillOpacity:0})}function s(e){var t=e.pathRadius,r=e.counterClockwise?1:0;return"\n M 50,50\n m 0,-"+t+"\n a "+t+","+t+" "+r+" 1 1 0,"+2*t+"\n a "+t+","+t+" "+r+" 1 1 0,-"+2*t+"\n "}function u(e){var t=e.counterClockwise,r=e.dashRatio,n=e.pathRadius,o=2*Math.PI*n,i=(1-r)*o;return{strokeDasharray:o+"px "+o+"px",strokeDashoffset:(t?-i:i)+"px"}}var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.getBackgroundPadding=function(){return this.props.background?this.props.backgroundPadding:0},t.prototype.getPathRadius=function(){return 50-this.props.strokeWidth/2-this.getBackgroundPadding()},t.prototype.getPathRatio=function(){var e=this.props,t=e.value,r=e.minValue,n=e.maxValue;return(Math.min(Math.max(t,r),n)-r)/(n-r)},t.prototype.render=function(){var e=this.props,t=e.circleRatio,r=e.className,o=e.classes,i=e.counterClockwise,s=e.styles,u=e.strokeWidth,c=e.text,l=this.getPathRadius(),p=this.getPathRatio();return Object(n.createElement)("svg",{className:o.root+" "+r,style:s.root,viewBox:"0 0 100 100","data-test-id":"CircularProgressbar"},this.props.background?Object(n.createElement)("circle",{className:o.background,style:s.background,cx:50,cy:50,r:50}):null,Object(n.createElement)(a,{className:o.trail,counterClockwise:i,dashRatio:t,pathRadius:l,strokeWidth:u,style:s.trail}),Object(n.createElement)(a,{className:o.path,counterClockwise:i,dashRatio:p*t,pathRadius:l,strokeWidth:u,style:s.path}),c?Object(n.createElement)("text",{className:o.text,style:s.text,x:50,y:50},c):null)},t.defaultProps={background:!1,backgroundPadding:0,circleRatio:1,classes:{root:"CircularProgressbar",trail:"CircularProgressbar-trail",path:"CircularProgressbar-path",text:"CircularProgressbar-text",background:"CircularProgressbar-background"},counterClockwise:!1,className:"",maxValue:100,minValue:0,strokeWidth:8,styles:{root:{},trail:{},path:{},text:{},background:{}},text:""},t}(n.Component);function l(e){return Object.keys(e).forEach((function(t){null==e[t]&&delete e[t]})),e}r(6);var p=r(0);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=function(e){return Object(p.jsx)("button",h(h({},e),{},{children:Object(p.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:Object(p.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z",clipRule:"evenodd"})})}))};function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y=function(e){return Object(p.jsx)("button",g(g({},e),{},{children:Object(p.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:Object(p.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})}))};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){j(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w=function(e){return Object(p.jsxs)("button",x(x({},e),{},{className:"with-text",children:[Object(p.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:Object(p.jsx)("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})}),"Settings"]}))},k=o.a.createContext({});function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var M=function(){var e=Object(n.useContext)(k),t=P(Object(n.useState)(!0),2),r=t[0],o=t[1],i=P(Object(n.useState)("work"),2),a=i[0],s=i[1],u=P(Object(n.useState)(0),2),f=u[0],h=u[1],d=Object(n.useRef)(f),v=Object(n.useRef)(r),g=Object(n.useRef)(a);Object(n.useEffect)((function(){d.current=60*e.workMinutes,h(d.current);var t=setInterval((function(){var t,r;if(!v.current)return 0===d.current?(t="work"===g.current?"break":"work",r=60*("work"===t?e.workMinutes:e.breakMinutes),s(t),g.current=t,h(r),void(d.current=r)):(d.current--,void h(d.current))}),1e3);return function(){return clearInterval(t)}}),[e]);var m,O,x,j,C,M,S,E,N,T,D,R,_="work"===a?60*e.workMinutes:60*e.breakMinutes,z=Math.round(f/_*100),A=Math.floor(f/60),B=f%60;return B<10&&(B="0"+B),Object(p.jsxs)("div",{children:[Object(p.jsx)(c,{value:z,text:A+":"+B,styles:(m={textColor:"#fff",pathColor:"work"===a?"#f54e4e":"#4aec8c",tailColor:"rgba(255,255,255,.2)"},O=m.rotation,x=m.strokeLinecap,j=m.textColor,C=m.textSize,M=m.pathColor,S=m.pathTransition,E=m.pathTransitionDuration,N=m.trailColor,T=m.backgroundColor,D=null==O?void 0:"rotate("+O+"turn)",R=null==O?void 0:"center center",{root:{},path:l({stroke:M,strokeLinecap:x,transform:D,transformOrigin:R,transition:S,transitionDuration:null==E?void 0:E+"s"}),trail:l({stroke:N,strokeLinecap:x,transform:D,transformOrigin:R}),text:l({fill:j,fontSize:C}),background:l({fill:T})})}),Object(p.jsx)("div",{style:{marginTop:"20px"},children:r?Object(p.jsx)(b,{onClick:function(){o(!1),v.current=!1}}):Object(p.jsx)(y,{onClick:function(){o(!0),v.current=!0}})}),Object(p.jsx)("div",{style:{marginTop:"20px"},children:Object(p.jsx)(w,{onClick:function(){return e.setShowSettings(!0)}})})]})},S="/Users/brians/git/react-slider/src/components/ReactSlider/ReactSlider.jsx";function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function D(e){return null==e?[]:Array.isArray(e)?e.slice():[e]}function R(e){return null!==e&&1===e.length?e[0]:e.slice()}function _(e){Object.keys(e).forEach((function(t){"undefined"!=typeof document&&document.addEventListener(t,e[t],!1)}))}function z(e,t){return A(function(e,t){var r=e;r<=t.min&&(r=t.min);r>=t.max&&(r=t.max);return r}(e,t),t)}function A(e,t){var r=(e-t.min)%t.step,n=e-r;return 2*Math.abs(r)>=t.step&&(n+=r>0?t.step:-t.step),parseFloat(n.toFixed(5))}var B=function(e){var t,r;function n(t){var r;(r=e.call(this,t)||this).onKeyUp=function(){r.onEnd()},r.onMouseUp=function(){r.onEnd(r.getMouseEventMap())},r.onTouchEnd=function(){r.onEnd(r.getTouchEventMap())},r.onBlur=function(){r.setState({index:-1},r.onEnd(r.getKeyDownEventMap()))},r.onMouseMove=function(e){r.setState({pending:!0});var t=r.getMousePosition(e),n=r.getDiffPosition(t[0]),o=r.getValueFromPosition(n);r.move(o)},r.onTouchMove=function(e){if(!(e.touches.length>1)){r.setState({pending:!0});var t=r.getTouchPosition(e);if(void 0===r.isScrolling){var n=t[0]-r.startPosition[0],o=t[1]-r.startPosition[1];r.isScrolling=Math.abs(o)>Math.abs(n)}if(r.isScrolling)r.setState({index:-1});else{var i=r.getDiffPosition(t[0]),a=r.getValueFromPosition(i);r.move(a)}}},r.onKeyDown=function(e){if(!(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey))switch(r.setState({pending:!0}),e.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":e.preventDefault(),r.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":e.preventDefault(),r.moveUpByStep();break;case"Home":e.preventDefault(),r.move(r.props.min);break;case"End":e.preventDefault(),r.move(r.props.max);break;case"PageDown":e.preventDefault(),r.moveDownByStep(r.props.pageFn(r.props.step));break;case"PageUp":e.preventDefault(),r.moveUpByStep(r.props.pageFn(r.props.step))}},r.onSliderMouseDown=function(e){if(!r.props.disabled&&2!==e.button){if(r.setState({pending:!0}),!r.props.snapDragDisabled){var t=r.getMousePosition(e);r.forceValueFromPosition(t[0],(function(e){r.start(e,t[0]),_(r.getMouseEventMap())}))}T(e)}},r.onSliderClick=function(e){if(!r.props.disabled&&r.props.onSliderClick&&!r.hasMoved){var t=r.getMousePosition(e),n=z(r.calcValue(r.calcOffsetFromPosition(t[0])),r.props);r.props.onSliderClick(n)}},r.createOnKeyDown=function(e){return function(t){r.props.disabled||(r.start(e),_(r.getKeyDownEventMap()),T(t))}},r.createOnMouseDown=function(e){return function(t){if(!r.props.disabled&&2!==t.button){r.setState({pending:!0});var n=r.getMousePosition(t);r.start(e,n[0]),_(r.getMouseEventMap()),T(t)}}},r.createOnTouchStart=function(e){return function(t){if(!(r.props.disabled||t.touches.length>1)){r.setState({pending:!0});var n=r.getTouchPosition(t);r.startPosition=n,r.isScrolling=void 0,r.start(e,n[0]),_(r.getTouchEventMap()),function(e){e.stopPropagation&&e.stopPropagation()}(t)}}},r.handleResize=function(){var e=window.setTimeout((function(){r.pendingResizeTimeouts.shift(),r.resize()}),0);r.pendingResizeTimeouts.push(e)},r.renderThumb=function(e,t){var n=r.props.thumbClassName+" "+r.props.thumbClassName+"-"+t+" "+(r.state.index===t?r.props.thumbActiveClassName:""),o={ref:function(e){r["thumb"+t]=e},key:r.props.thumbClassName+"-"+t,className:n,style:e,onMouseDown:r.createOnMouseDown(t),onTouchStart:r.createOnTouchStart(t),onFocus:r.createOnKeyDown(t),tabIndex:0,role:"slider","aria-orientation":r.props.orientation,"aria-valuenow":r.state.value[t],"aria-valuemin":r.props.min,"aria-valuemax":r.props.max,"aria-label":Array.isArray(r.props.ariaLabel)?r.props.ariaLabel[t]:r.props.ariaLabel,"aria-labelledby":Array.isArray(r.props.ariaLabelledby)?r.props.ariaLabelledby[t]:r.props.ariaLabelledby},i={index:t,value:R(r.state.value),valueNow:r.state.value[t]};return r.props.ariaValuetext&&(o["aria-valuetext"]="string"==typeof r.props.ariaValuetext?r.props.ariaValuetext:r.props.ariaValuetext(i)),r.props.renderThumb(o,i)},r.renderTrack=function(e,t,n){var o={key:r.props.trackClassName+"-"+e,className:r.props.trackClassName+" "+r.props.trackClassName+"-"+e,style:r.buildTrackStyle(t,r.state.upperBound-n)},i={index:e,value:R(r.state.value)};return r.props.renderTrack(o,i)};var n=D(t.value);n.length||(n=D(t.defaultValue)),r.pendingResizeTimeouts=[];for(var o=[],i=0;i<n.length;i+=1)n[i]=z(n[i],t),o.push(i);return r.state={index:-1,upperBound:0,sliderLength:0,value:n,zIndices:o},r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,N(t,r);var i=n.prototype;return i.componentDidMount=function(){"undefined"!=typeof window&&(window.addEventListener("resize",this.handleResize),this.resize())},n.getDerivedStateFromProps=function(e,t){var r=D(e.value);return r.length?t.pending?null:{value:r.map((function(t){return z(t,e)}))}:null},i.componentDidUpdate=function(){0===this.state.upperBound&&this.resize()},i.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)},i.onEnd=function(e){e&&function(e){Object.keys(e).forEach((function(t){"undefined"!=typeof document&&document.removeEventListener(t,e[t],!1)}))}(e),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},i.getValue=function(){return R(this.state.value)},i.getClosestIndex=function(e){for(var t=Number.MAX_VALUE,r=-1,n=this.state.value,o=n.length,i=0;i<o;i+=1){var a=this.calcOffset(n[i]),s=Math.abs(e-a);s<t&&(t=s,r=i)}return r},i.getMousePosition=function(e){return[e["page"+this.axisKey()],e["page"+this.orthogonalAxisKey()]]},i.getTouchPosition=function(e){var t=e.touches[0];return[t["page"+this.axisKey()],t["page"+this.orthogonalAxisKey()]]},i.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},i.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},i.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},i.getValueFromPosition=function(e){var t=e/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return z(this.state.startValue+t,this.props)},i.getDiffPosition=function(e){var t=e-this.state.startPosition;return this.props.invert&&(t*=-1),t},i.resize=function(){var e=this.slider,t=this.thumb0;if(e&&t){var r=this.sizeKey(),n=e.getBoundingClientRect(),o=e[r],i=n[this.posMaxKey()],a=n[this.posMinKey()],s=t.getBoundingClientRect()[r.replace("client","").toLowerCase()],u=o-s,c=Math.abs(i-a);this.state.upperBound===u&&this.state.sliderLength===c&&this.state.thumbSize===s||this.setState({upperBound:u,sliderLength:c,thumbSize:s})}},i.calcOffset=function(e){var t=this.props.max-this.props.min;return 0===t?0:(e-this.props.min)/t*this.state.upperBound},i.calcValue=function(e){return e/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},i.calcOffsetFromPosition=function(e){var t=this.slider.getBoundingClientRect(),r=t[this.posMaxKey()],n=t[this.posMinKey()],o=e-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?r:n));return this.props.invert&&(o=this.state.sliderLength-o),o-=this.state.thumbSize/2},i.forceValueFromPosition=function(e,t){var r=this,n=this.calcOffsetFromPosition(e),o=this.getClosestIndex(n),i=z(this.calcValue(n),this.props),a=this.state.value.slice();a[o]=i;for(var s=0;s<a.length-1;s+=1)if(a[s+1]-a[s]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:a},(function(){t(o),r.fireChangeEvent("onChange")}))},i.clearPendingResizeTimeouts=function(){do{var e=this.pendingResizeTimeouts.shift();clearTimeout(e)}while(this.pendingResizeTimeouts.length)},i.start=function(e,t){var r=this["thumb"+e];r&&r.focus();var n=this.state.zIndices;n.splice(n.indexOf(e),1),n.push(e),this.setState((function(r){return{startValue:r.value[e],startPosition:void 0!==t?t:r.startPosition,index:e,zIndices:n}}))},i.moveUpByStep=function(e){void 0===e&&(e=this.props.step);var t=z(this.state.value[this.state.index]+e,this.props);this.move(Math.min(t,this.props.max))},i.moveDownByStep=function(e){void 0===e&&(e=this.props.step);var t=z(this.state.value[this.state.index]-e,this.props);this.move(Math.max(t,this.props.min))},i.move=function(e){var t=this.state,r=t.index,n=t.value,o=n.length,i=n[r];if(e!==i){this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;var a=this.props,s=a.pearling,u=a.max,c=a.min,l=a.minDistance;if(!s){if(r>0){var p=n[r-1];e<p+l&&(e=p+l)}if(r<o-1){var f=n[r+1];e>f-l&&(e=f-l)}}n[r]=e,s&&o>1&&(e>i?(this.pushSucceeding(n,l,r),function(e,t,r,n){for(var o=0;o<e;o+=1){var i=n-o*r;t[e-1-o]>i&&(t[e-1-o]=i)}}(o,n,l,u)):e<i&&(this.pushPreceding(n,l,r),function(e,t,r,n){for(var o=0;o<e;o+=1){var i=n+o*r;t[o]<i&&(t[o]=i)}}(o,n,l,c))),this.setState({value:n},this.fireChangeEvent.bind(this,"onChange"))}},i.pushSucceeding=function(e,t,r){var n,o;for(o=e[n=r]+t;null!==e[n+1]&&o>e[n+1];o=e[n+=1]+t)e[n+1]=A(o,this.props)},i.pushPreceding=function(e,t,r){for(var n=r,o=e[n]-t;null!==e[n-1]&&o<e[n-1];o=e[n-=1]-t)e[n-1]=A(o,this.props)},i.axisKey=function(){return"vertical"===this.props.orientation?"Y":"X"},i.orthogonalAxisKey=function(){return"vertical"===this.props.orientation?"X":"Y"},i.posMinKey=function(){return"vertical"===this.props.orientation?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},i.posMaxKey=function(){return"vertical"===this.props.orientation?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},i.sizeKey=function(){return"vertical"===this.props.orientation?"clientHeight":"clientWidth"},i.fireChangeEvent=function(e){this.props[e]&&this.props[e](R(this.state.value),this.state.index)},i.buildThumbStyle=function(e,t){var r={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():"",zIndex:this.state.zIndices.indexOf(t)+1};return r[this.posMinKey()]=e+"px",r},i.buildTrackStyle=function(e,t){var r={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():""};return r[this.posMinKey()]=e,r[this.posMaxKey()]=t,r},i.buildMarkStyle=function(e){var t;return(t={position:"absolute"})[this.posMinKey()]=e,t},i.renderThumbs=function(e){for(var t=e.length,r=[],n=0;n<t;n+=1)r[n]=this.buildThumbStyle(e[n],n);for(var o=[],i=0;i<t;i+=1)o[i]=this.renderThumb(r[i],i);return o},i.renderTracks=function(e){var t=[],r=e.length-1;t.push(this.renderTrack(0,0,e[0]));for(var n=0;n<r;n+=1)t.push(this.renderTrack(n+1,e[n],e[n+1]));return t.push(this.renderTrack(r+1,e[r],this.state.upperBound)),t},i.renderMarks=function(){var e=this,t=this.props.marks,r=this.props.max-this.props.min+1;return"boolean"==typeof t?t=Array.from({length:r}).map((function(e,t){return t})):"number"==typeof t&&(t=Array.from({length:r}).map((function(e,t){return t})).filter((function(e){return e%t==0}))),t.map(parseFloat).sort((function(e,t){return e-t})).map((function(t){var r=e.calcOffset(t),n={key:t,className:e.props.markClassName,style:e.buildMarkStyle(r)};return e.props.renderMark(n)}))},i.render=function(){for(var e=this,t=[],r=this.state.value,n=r.length,i=0;i<n;i+=1)t[i]=this.calcOffset(r[i],i);var a=this.props.withTracks?this.renderTracks(t):null,s=this.renderThumbs(t),u=this.props.marks?this.renderMarks():null;return o.a.createElement("div",{ref:function(t){e.slider=t},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},a,s,u)},n}(o.a.Component);B.displayName="ReactSlider",B.defaultProps={min:0,max:100,step:1,pageFn:function(e){return 10*e},minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:function(e){return o.a.createElement("div",E({},e,{__self:B,__source:{fileName:S,lineNumber:353,columnNumber:31}}))},renderTrack:function(e){return o.a.createElement("div",E({},e,{__self:B,__source:{fileName:S,lineNumber:354,columnNumber:31}}))},renderMark:function(e){return o.a.createElement("span",E({},e,{__self:B,__source:{fileName:S,lineNumber:355,columnNumber:30}}))}},B.propTypes={};var K=B;r(10);function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){I(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var V=function(e){return Object(p.jsxs)("button",U(U({},e),{},{className:"with-text",children:[Object(p.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:Object(p.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm.707-10.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L9.414 11H13a1 1 0 100-2H9.414l1.293-1.293z",clipRule:"evenodd"})}),"Back"]}))};var F=function(){var e=Object(n.useContext)(k);return Object(p.jsxs)("div",{style:{textAlign:"left"},children:[Object(p.jsxs)("label",{children:["work: ",e.workMinutes,":00"]}),Object(p.jsx)(K,{className:"slider",thumbClassName:"thumb",trackClassName:"track",value:e.workMinutes,onChange:function(t){return e.setWorkMinutes(t)},min:1,max:120}),Object(p.jsxs)("label",{children:["break: ",e.breakMinutes,":00"]}),Object(p.jsx)(K,{className:"slider green",thumbClassName:"thumb",trackClassName:"track",value:e.breakMinutes,onChange:function(t){return e.setBreakMinutes(t)},min:1,max:120}),Object(p.jsx)("div",{style:{textAlign:"center",marginTop:"20px"},children:Object(p.jsx)(V,{onClick:function(){return e.setShowSettings(!1)}})})]})};function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}t.default=function(){var e=W(Object(n.useState)(!1),2),t=e[0],r=e[1],o=W(Object(n.useState)(45),2),i=o[0],a=o[1],s=W(Object(n.useState)(15),2),u=s[0],c=s[1];return Object(p.jsx)("main",{children:Object(p.jsx)(k.Provider,{value:{showSettings:t,setShowSettings:r,workMinutes:i,breakMinutes:u,setWorkMinutes:a,setBreakMinutes:c},children:t?Object(p.jsx)(F,{}):Object(p.jsx)(M,{})})})}}]);