From 35b10c3005cdc19256e1e1737bf60a068ba2c709 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Tue, 16 Apr 2019 09:39:06 -0700 Subject: [PATCH] Updates --- asset-manifest.json | 4 ++-- index.html | 2 +- service-worker.js | 2 +- static/js/main.45c860f5.js | 2 -- static/js/main.df13b54a.js | 2 ++ static/js/{main.45c860f5.js.map => main.df13b54a.js.map} | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 static/js/main.45c860f5.js create mode 100644 static/js/main.df13b54a.js rename static/js/{main.45c860f5.js.map => main.df13b54a.js.map} (71%) diff --git a/asset-manifest.json b/asset-manifest.json index b051167..cfc0bea 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,6 +1,6 @@ { - "main.js": "/static/js/main.45c860f5.js", - "main.js.map": "/static/js/main.45c860f5.js.map", + "main.js": "/static/js/main.df13b54a.js", + "main.js.map": "/static/js/main.df13b54a.js.map", "static/media/mdwa.eot?62057485": "/static/media/mdwa.34af6454.eot", "static/media/mdwa.svg?62057485": "/static/media/mdwa.c8dbaea5.svg", "static/media/mdwa.ttf?62057485": "/static/media/mdwa.e76431cd.ttf", diff --git a/index.html b/index.html index e58449b..7cd6565 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -The Most Dangerous Writing App
\ No newline at end of file +The Most Dangerous Writing App
\ No newline at end of file diff --git a/service-worker.js b/service-worker.js index a4d3a4e..1b3d96a 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1 +1 @@ -"use strict";var precacheConfig=[["/index.html","3a6d4dcf5b486216f979462d9f5abb7d"],["/static/js/main.45c860f5.js","c90eae772867e9a2238cdace24f625e9"],["/static/media/mdwa.34af6454.eot","34af6454b289c92bf5b2f4533ed70452"],["/static/media/mdwa.ba50e0c5.woff2","ba50e0c5be72b9c956ec6ec3689ee863"],["/static/media/mdwa.c8dbaea5.svg","c8dbaea568e9cd26a28f7aa71f8fa565"],["/static/media/mdwa.e76431cd.ttf","e76431cd22ce7ea2f627b98f512f8d9b"],["/static/media/mdwa.faab8634.woff","faab86340831b4efdd470b06d93b4854"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,n){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return n.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(r){return setOfCachedUrls(r).then(function(n){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!n.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return r.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var n=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!n.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,n=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),r="index.html";(e=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,r),e=urlsToCacheKeys.has(n));var a="/index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(n=new URL(a,self.location).toString(),e=urlsToCacheKeys.has(n)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}}); \ No newline at end of file +"use strict";var precacheConfig=[["/index.html","c97f30ae9f784c4edf01668cb326cd23"],["/static/js/main.df13b54a.js","988f7e564fa2c8c9a161b5431237597d"],["/static/media/mdwa.34af6454.eot","34af6454b289c92bf5b2f4533ed70452"],["/static/media/mdwa.ba50e0c5.woff2","ba50e0c5be72b9c956ec6ec3689ee863"],["/static/media/mdwa.c8dbaea5.svg","c8dbaea568e9cd26a28f7aa71f8fa565"],["/static/media/mdwa.e76431cd.ttf","e76431cd22ce7ea2f627b98f512f8d9b"],["/static/media/mdwa.faab8634.woff","faab86340831b4efdd470b06d93b4854"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,n){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return n.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(r){return setOfCachedUrls(r).then(function(n){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!n.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return r.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var n=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!n.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,n=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),r="index.html";(e=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,r),e=urlsToCacheKeys.has(n));var a="/index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(n=new URL(a,self.location).toString(),e=urlsToCacheKeys.has(n)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}}); \ No newline at end of file diff --git a/static/js/main.45c860f5.js b/static/js/main.45c860f5.js deleted file mode 100644 index ac85bd0..0000000 --- a/static/js/main.45c860f5.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/",o(o.s=60)}([function(e,t,n){"use strict";e.exports=n(54)},function(e,t,n){e.exports=n(38)()},function(e,t,n){var r;!function(){"use strict";var a={}.hasOwnProperty;function l(){for(var e=[],t=0;t=t.status}function l(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof e&&e.global===e?e:void 0,o=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=f.URL||f.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener","string"==typeof e?(o.href=e,o.origin===location.origin?l(o):a(o.href)?c(e,t,n):l(o,o.target="_blank")):(o.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(o.href)},4e4),setTimeout(function(){l(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob((o=e,"undefined"==typeof(i=n)?i={autoBom:!1}:"object"!=typeof i&&(console.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob(["\ufeff",o],{type:o.type}):o),t);else if(a(e))c(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){l(r)})}var o,i}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return c(e,t,n);var o="application/octet-stream"===e.type,i=/constructor/i.test(f.HTMLElement)||f.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||o&&i)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},l.readAsDataURL(e)}else{var u=f.URL||f.webkitURL,s=u.createObjectURL(e);r?r.location=s:location.href=s,r=null,setTimeout(function(){u.revokeObjectURL(s)},4e4)}});f.saveAs=o.saveAs=o,"undefined"!=typeof i&&(i.exports=o)})?t.apply(o,n):t)||(i.exports=r)}).call(this,e(3))},function(e,t,n){"use strict";var r=i(n(30)),o=i(n(10));function i(e){return e&&e.__esModule?e:{default:e}}e.exports={TransitionGroup:o.default,CSSTransitionGroup:r.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],r=t&&t.split("/")||[],o=e&&b(e),i=t&&b(t),a=o||i;if(e&&b(e)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var l=void 0;if(r.length){var u=r[r.length-1];l="."===u||".."===u||""===u}else l=!1;for(var s=0,c=r.length;c>=0;c--){var f=r[c];"."===f?E(r,c):".."===f?(E(r,c),s++):s&&(E(r,c),s--)}if(!a)for(;s--;s)r.unshift("..");!a||""===r[0]||r[0]&&b(r[0])||r.unshift("");var p=r.join("/");return l&&"/"!==p.substr(-1)&&(p+="/"),p},w="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var x=function n(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if(Array.isArray(t))return Array.isArray(r)&&t.length===r.length&&t.every(function(e,t){return n(e,r[t])});var e="undefined"===typeof t?"undefined":w(t);if(e!==("undefined"===typeof r?"undefined":w(r)))return!1;if("object"!==e)return!1;var o=t.valueOf(),i=r.valueOf();if(o!==t||i!==r)return n(o,i);var a=Object.keys(t),l=Object.keys(r);return a.length===l.length&&a.every(function(e){return n(t[e],r[e])})},B="Invariant failed";var I=function(e,t){if(!e)throw new Error(B)};function P(e){return"/"===e.charAt(0)?e:"/"+e}function k(e){return"/"===e.charAt(0)?e.substr(1):e}function _(e,t){return n=e,new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(n)?e.substr(t.length):e;var n}function M(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function O(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function N(e,t,n,r){var o;"string"===typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=S({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=C(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function T(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&x(e.state,t.state)}function R(){var i=null;var r=[];return{setPrompt:function(e){return i=e,function(){i===e&&(i=null)}},confirmTransitionTo:function(e,t,n,r){if(null!=i){var o="function"===typeof i?i(e,t):i;"string"===typeof o?"function"===typeof n?n(o,r):r(!0):r(!1!==o)}else r(!0)},appendListener:function(e){var t=!0;function n(){t&&e.apply(void 0,arguments)}return r.push(n),function(){t=!1,r=r.filter(function(e){return e!==n})}},notifyListeners:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0?t:0)+"#"+e)}function Q(e){void 0===e&&(e={}),D||I(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,l=void 0===r?W:r,o=n.hashType,i=void 0===o?"slash":o,u=e.basename?M(P(e.basename)):"",a=Y[i],s=a.encodePath,c=a.decodePath;function f(){var e=c(q());return u&&(e=_(e,u)),N(e)}var p=R();function d(e){S(B,e),B.length=t.length,p.notifyListeners(B.location,B.action)}var h=!1,A=null;function m(){var e=q(),t=s(e);if(e!==t)H(t);else{var n=f(),r=B.location;if(!h&&T(r,n))return;if(A===O(n))return;A=null,function(t){if(h)h=!1,d();else{p.confirmTransitionTo(t,"POP",l,function(e){e?d({action:"POP",location:t}):function(e){var t=B.location,n=b.lastIndexOf(O(t));-1===n&&(n=0);var r=b.lastIndexOf(O(e));-1===r&&(r=0);var o=n-r;o&&(h=!0,E(o))}(t)})}}(n)}}var g=q(),y=s(g);g!==y&&H(y);var v=f(),b=[O(v)];function E(e){t.go(e)}var C=0;function w(e){1===(C+=e)&&1===e?window.addEventListener(j,m):0===C&&window.removeEventListener(j,m)}var x=!1;var B={length:t.length,action:"POP",location:v,createHref:function(e){return"#"+s(u+O(e))},push:function(e,t){var a=N(e,void 0,void 0,B.location);p.confirmTransitionTo(a,"PUSH",l,function(e){if(e){var t,n=O(a),r=s(u+n);if(q()!==r){A=n,t=r,window.location.hash=t;var o=b.lastIndexOf(O(B.location)),i=b.slice(0,-1===o?0:o+1);i.push(n),b=i,d({action:"PUSH",location:a})}else d()}})},replace:function(e,t){var o="REPLACE",i=N(e,void 0,void 0,B.location);p.confirmTransitionTo(i,o,l,function(e){if(e){var t=O(i),n=s(u+t);q()!==n&&(A=t,H(n));var r=b.indexOf(O(B.location));-1!==r&&(b[r]=t),d({action:o,location:i})}})},go:E,goBack:function(){E(-1)},goForward:function(){E(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return x||(w(1),x=!0),function(){return x&&(x=!1,w(-1)),t()}},listen:function(e){var t=p.appendListener(e);return w(1),function(){w(-1),t()}}};return B}function V(e,t,n){return Math.min(Math.max(e,t),n)}var G=n(7),K=n.n(G);n(11);function X(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n(18);var Z=function(e){var t=v()();return t.Provider.displayName=e+".Provider",t.Consumer.displayName=e+".Consumer",t}("Router"),J=function(n){function e(e){var t;return(t=n.call(this,e)||this).state={location:e.history.location},t._isMounted=!1,t._pendingLocation=null,e.staticContext||(t.unlisten=e.history.listen(function(e){t._isMounted?t.setState({location:e}):t._pendingLocation=e})),t}g(e,n),e.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var t=e.prototype;return t.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},t.componentWillUnmount=function(){this.unlisten&&this.unlisten()},t.render=function(){return f.a.createElement(Z.Provider,{children:this.props.children||null,value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}})},e}(f.a.Component);f.a.Component;f.a.Component;var $={},ee=1e4,te=0;function ne(s,e){void 0===e&&(e={}),"string"===typeof e&&(e={path:e});var t=e,n=t.path,r=t.exact,c=void 0!==r&&r,o=t.strict,f=void 0!==o&&o,i=t.sensitive,p=void 0!==i&&i;return[].concat(n).reduce(function(e,t){if(e)return e;var n=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=$[n]||($[n]={});if(r[e])return r[e];var o=[],i={regexp:K()(e,o,t),keys:o};return te1&&void 0!==arguments[1]?arguments[1]:{};return function(e){function t(){return l(this,t),d(this,h(t).apply(this,arguments))}return m(t,f.a.Component),u(t,[{key:"render",value:function(){return f.a.createElement(ve.Consumer,null,function(e){return f.a.createElement(n,Object.assign({},e,r))})}}]),t}()}var Ee=n(2),Ce=be(function(e){var t=e.progress,n=e.danger,r=e.won;return f.a.createElement("div",{className:Ee("progress",{danger:n,won:r})},f.a.createElement("div",{style:{width:100*t+"%"}}))}),we=be(function(e){var t=e.words;return f.a.createElement("div",{className:"wordcount"},t||0," ",1===t?"word":"words")}),xe=n(16),Be=function(e){var t=e.words,n="https://twitter.com/intent/tweet?text=I+wrote+".concat(t,"+words+using+The+Most+Dangerous+Writing+App+-+until+it+deleted+everything+.+%23MDWA&url=http%3A%2F%2Fwww.themostdangerouswritingapp.com"),r="I wrote ".concat(t," words using The Most Dangerous Writing App - until it deleted everything.");return f.a.createElement("a",{className:"tweet",href:n},r)},ke=be(function(e){e.onReset;var t=e.toggleHelp,n=e.limit,r=e.type,o=e.lost,i=e.words;return f.a.createElement(xe.CSSTransitionGroup,{transitionName:"failure",transitionEnterTimeout:500,transitionLeaveTimeout:100},o&&f.a.createElement("div",{className:"failure",key:"failScreen"},f.a.createElement("a",{className:"navButton helpButton white",onClick:t},"Help"),f.a.createElement("div",{className:"inner"},f.a.createElement("h3",null,"You failed."),f.a.createElement(Be,{words:i}),f.a.createElement(fe,{ghost:!0,noPanel:!0,color:"white",label:"Try Again.",type:r,limit:n}))))}),Te=n(15),Fe=n.n(Te),Se=function(e){function n(e){var t;return l(this,n),(t=d(this,h(n).call(this,e))).download=t.download.bind(p(p(t))),t}return m(n,f.a.Component),u(n,[{key:"download",value:function(){var e=this.props.text.replace(/[",.!-::']/g,""),t=e.indexOf(" ",25),n=e.substr(0,t>0?t:30),r=(new Date).toLocaleDateString(),o=new Blob([this.props.text],{type:"text/plain;charset=utf-8"}),i="".concat(n," (MDWA ").concat(r,").txt");Fe.a.saveAs(o,i)}},{key:"render",value:function(){var n=this;return f.a.createElement(ve.Consumer,null,function(e){var t=e.words;return f.a.createElement("button",{onClick:n.download,className:"tiny light ghost"},"Download ",t||0," ",1===t?"word":"words")})}}]),n}(),Ie=function(e){function n(e){var t;return l(this,n),(t=d(this,h(n).call(this,e))).onChange=t.onChange.bind(p(p(t))),t.onStroke=t.onStroke.bind(p(p(t))),t.clearLetter=t.clearLetter.bind(p(p(t))),t.onScroll=t.onScroll.bind(p(p(t))),t.input=f.a.createRef(),t.wrapper=f.a.createRef(),t.state={cutTop:!1,cutBottom:!1,text:"",letter:"",timerId:null},t.invalid_chars=["Backspace","Tab","Enter","Control","Alt","Meta","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","CapsLock","Shift","Delete"],t.control_keys=["a","c","v","x","f"],t}return m(n,r["Component"]),u(n,[{key:"onScroll",value:function(e){var t=this.input.current,n=t.scrollTop,r=t.scrollHeight,o=this.wrapper.current.clientHeight;this.setState({cutTop:n>0,cutBottom:r-10>o+n&&r>o})}},{key:"componentDidMount",value:function(){this.input.current.focus()}},{key:"onChange",value:function(e){this.setState({text:e.target.value})}},{key:"onStroke",value:function(e){var t=e.key,n=e.ctrlKey||e.metaKey,r=e.metaKey||e.altKey;this.invalid_chars.includes(t)||e.repeat||(!this.props.won&&n&&this.control_keys.includes(t)?e.preventDefault():n&&r&&"n"===t?this.props.onNightMode():n&&r&&"f"===t?this.props.onFullScreen():(clearInterval(this.state.timerId),this.setState({letter:t,timerId:setInterval(this.clearLetter,200)}),this.props.onStroke(t,this.state.text)))}},{key:"clearLetter",value:function(){clearInterval(this.state.timerId),this.setState({letter:""})}},{key:"reset",value:function(){this.setState({cutTop:!1,cutBottom:!1,text:""})}},{key:"render",value:function(){var o=this;return f.a.createElement(ve.Consumer,null,function(e){var t=e.danger,n=e.hardcore,r=e.won;return f.a.createElement("div",{className:de()("editor",{danger:t,hardcore:n&&!r,"cut-top":o.state.cutTop,"cut-bottom":o.state.cutBottom}),ref:o.wrapper},n&&f.a.createElement("div",{className:"hardcore"},o.state.letter),f.a.createElement("textarea",{placeholder:"Start typing...",spellCheck:"false",onKeyDown:o.onStroke,onChange:o.onChange,onScroll:o.onScroll,ref:o.input,value:o.state.text}))})}}]),n}(),Pe=function(e){function a(e){var t;l(this,a);var n=(t=d(this,h(a).call(this,e))).props,r=n.limit,o=n.type,i=n.hardcore;return t.handleStroke=t.handleStroke.bind(p(p(t))),t.reset=t.reset.bind(p(p(t))),t.toggleFullscreen=t.toggleFullscreen.bind(p(p(t))),t.toggleNightMode=t.toggleNightMode.bind(p(p(t))),t.now=t.now.bind(p(p(t))),t.editor=f.a.createRef(),t.state={run:!1,startTime:null,fullscreen:!1,nightMode:"true"===localStorage.getItem("mdwa.night-mode"),progress:0,timeSinceStroke:0,danger:!1,won:!1,lost:!1,fade:2,kill:5,limit:r,type:o,hardcore:i},t}return m(a,f.a.Component),u(a,[{key:"startWriting",value:function(){var e=this;this.setState({run:!0,startTime:this.now(),timerID:setInterval(function(){return e.tick()},100)})}},{key:"toggleNightMode",value:function(){localStorage.setItem("mdwa.night-mode",!this.state.nightMode),this.setState(function(e,t){return{nightMode:!e.nightMode}})}},{key:"toggleFullscreen",value:function(){this.setState(function(e,t){return{fullscreen:!e.fullscreen}})}},{key:"handleStroke",value:function(e,t){this.state.run||this.state.won||this.startWriting(),this.toggleDanger(!1);var n=t.trim().length&&t.trim().split(/\s+/).length;this.setState({text:t,words:n,timeSinceStroke:0})}},{key:"componentDidMount",value:function(){console.log("I mounted")}},{key:"stopWriting",value:function(){clearInterval(this.state.timerID)}},{key:"toggleDanger",value:function(e){this.state.danger!==e&&this.setState({danger:e})}},{key:"now",value:function(){return(new Date).getTime()/1e3}},{key:"win",value:function(){this.stopWriting(),this.setState({won:!0,run:!1})}},{key:"fail",value:function(){this.stopWriting(),this.setState({lost:!0})}},{key:"reset",value:function(e,t,n){this.setState({type:e,limit:t,hardcore:n,won:!1,lost:!1,run:!1,startTime:null,progress:0,timeSinceStroke:0,danger:!1,words:0}),this.editor.current&&this.editor.current.reset()}},{key:"tick",value:function(){var e=this.state,t=e.run,n=e.words,r=e.timeSinceStroke,o=e.startTime,i=e.fade,a=e.type,l=e.limit,u=e.kill;if(t){var s=r>=i;if(r>=u)return this.fail();var c=this.now()-o,f=("minutes"===a?c/60:n)/l;f>=1&&this.win(),this.setState(function(e,t){return{words:n,progress:f,danger:s,timeSinceStroke:e.timeSinceStroke+.1}})}}},{key:"render",value:function(){var e=this.state,t=e.fullscreen,n=e.danger,r=e.won,o=e.lost,i=e.text,a=e.nightMode,l=e.limit,u=e.type,s=e.hardcore,c=de()("app",{"night-mode":a,danger:n});return f.a.createElement(ye.a,{enabled:t},f.a.createElement(ve.Provider,{value:this.state},f.a.createElement("div",{className:c},f.a.createElement(ke,null),f.a.createElement(Ce,null),f.a.createElement("div",{className:"buttons"},r&&f.a.createElement(Se,{text:i}),f.a.createElement("i",{className:"icon-night-mode",onClick:this.toggleNightMode}),f.a.createElement("i",{className:"icon-fullscreen",onClick:this.toggleFullscreen})),!o&&f.a.createElement("div",{className:"content"},f.a.createElement(Ie,{ref:this.editor,won:r,onStroke:this.handleStroke,onNightMode:this.toggleNightMode,onFullScreen:this.toggleFullscreen}),r?f.a.createElement(fe,Object.assign({small:!0,ghost:!0,hidePanel:!0,label:"Start Again"},{limit:l,type:u,hardcore:s})):f.a.createElement(we,null)))))}}]),a}(),_e=function(e){var t=new URLSearchParams(e.location.search),n={limit:parseInt(t.get("limit"),10)||5,type:t.get("type")||"minutes",hardcore:t.get("hardcore")||!1};return f.a.createElement(Pe,Object.assign({key:Math.random()},n))},Me=function(e){function t(){return l(this,t),d(this,h(t).apply(this,arguments))}return m(t,r["Component"]),u(t,[{key:"render",value:function(){return f.a.createElement(ue,null,f.a.createElement(re,{path:"/",exact:!0,component:Ae}),f.a.createElement(re,{path:"/write",component:_e}),f.a.createElement(re,{path:"/help",component:me}))}}]),t}(),Oe=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function Ne(e){navigator.serviceWorker.register(e).then(function(t){t.onupdatefound=function(){var e=t.installing;e.onstatechange=function(){"installed"===e.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(function(e){console.error("Error during service worker registration:",e)})}i.a.render(f.a.createElement(Me,null),document.getElementById("root")),function(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",function(){var t,e="".concat("","/service-worker.js");Oe?(t=e,fetch(t).then(function(e){404===e.status||-1===e.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then(function(e){e.unregister().then(function(){window.location.reload()})}):Ne(t)}).catch(function(){console.log("No internet connection found. App is running in offline mode.")}),navigator.serviceWorker.ready.then(function(){console.log("This web app is being served cache-first by a service worker. To learn more, visit https://goo.gl/SC7cgQ")})):Ne(e)})}}()},function(e,t,n){"use strict";var r=n(4);t.__esModule=!0,t.default=t.animationEnd=t.animationDelay=t.animationTiming=t.animationDuration=t.animationName=t.transitionEnd=t.transitionDuration=t.transitionDelay=t.transitionTiming=t.transitionProperty=t.transform=void 0;var o,i,a,l,u,s,c,f,p,d,h,A=r(n(9)),m="transform";if(t.transform=m,t.animationEnd=a,t.transitionEnd=i,t.transitionDelay=c,t.transitionTiming=s,t.transitionDuration=u,t.transitionProperty=l,t.animationDelay=h,t.animationTiming=d,t.animationDuration=p,t.animationName=f,A.default){var g=function(){for(var e,t,n=document.createElement("div").style,r={O:function(e){return"o"+e.toLowerCase()},Moz:function(e){return e.toLowerCase()},Webkit:function(e){return"webkit"+e},ms:function(e){return"MS"+e}},o=Object.keys(r),i="",a=0;a=0&&l.splice(t,1)}function g(e){var t=document.createElement("style");return e.attrs.type="text/css",y(t,e.attrs),A(e,t),t}function y(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function v(t,e){var n,r,o,i,a,l;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var u=f++;n=c||(c=g(e)),r=C.bind(null,n,u,!1),o=C.bind(null,n,u,!0)}else o=t.sourceMap&&"function"===typeof URL&&"function"===typeof URL.createObjectURL&&"function"===typeof URL.revokeObjectURL&&"function"===typeof Blob&&"function"===typeof btoa?(a=e,l=document.createElement("link"),a.attrs.type="text/css",a.attrs.rel="stylesheet",y(l,a.attrs),A(a,l),r=function(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=p(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}.bind(null,n=l,e),function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),function(){m(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}e.exports=function(e,a){if("undefined"!==typeof DEBUG&&DEBUG&&"object"!==typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(a=a||{}).attrs="object"===typeof a.attrs?a.attrs:{},a.singleton||(a.singleton=s()),a.insertInto||(a.insertInto="head"),a.insertAt||(a.insertAt="bottom");var l=h(e,a);return d(l,a),function(e){for(var t=[],n=0;n=t){n=e;break}e=e.next}while(e!==a);null===n?n=a:n===a&&(a=i,c()),(t=n.previous).next=n.previous=i,i.next=n,i.previous=t}}function p(){if(-1===o&&null!==a&&1===a.priorityLevel){i=!0;try{for(;f(),null!==a&&1===a.priorityLevel;);}finally{i=!1,null!==a?c():s=!1}}}function t(e){i=!0;var t=r;r=e;try{if(e)for(;null!==a;){var n=U.unstable_now();if(!(a.expirationTime<=n))break;for(;f(),null!==a&&a.expirationTime<=n;);}else if(null!==a)for(;f(),null!==a&&!w(););}finally{i=!1,r=t,null!==a?c():s=!1,p()}}var n,d,h=Date,A="function"===typeof setTimeout?setTimeout:void 0,m="function"===typeof clearTimeout?clearTimeout:void 0,g="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,y="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function v(t){n=g(function(e){m(d),t(e)}),d=A(function(){y(n),t(U.unstable_now())},100)}if("object"===typeof performance&&"function"===typeof performance.now){var b=performance;U.unstable_now=function(){return b.now()}}else U.unstable_now=function(){return h.now()};var E,C,w,x=null;if("undefined"!==typeof window?x=window:"undefined"!==typeof e&&(x=e),x&&x._schedMock){var B=x._schedMock;E=B[0],C=B[1],w=B[2],U.unstable_now=B[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var k=null,T=function(e){if(null!==k)try{k(e)}finally{k=null}};E=function(e){null!==k?setTimeout(E,0,e):(k=e,setTimeout(T,0,!1))},C=function(){k=null},w=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof g&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var F=null,S=!1,I=-1,P=!1,_=!1,M=0,O=33,N=33;w=function(){return M<=U.unstable_now()};var R=new MessageChannel,D=R.port2;R.port1.onmessage=function(){S=!1;var e=F,t=I;F=null,I=-1;var n=U.unstable_now(),r=!1;if(0>=M-n){if(!(-1!==t&&t<=n))return P||(P=!0,v(W)),F=e,void(I=t);r=!0}if(null!==e){_=!0;try{e(r)}finally{_=!1}}};var W=function(e){if(null!==F){v(W);var t=e-M+N;tt&&(t=8),N=tt?D.postMessage(void 0):P||(P=!0,v(W))},C=function(){F=null,S=!1,I=-1}}U.unstable_ImmediatePriority=1,U.unstable_UserBlockingPriority=2,U.unstable_NormalPriority=3,U.unstable_IdlePriority=5,U.unstable_LowPriority=4,U.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=l,r=o;l=e,o=U.unstable_now();try{return t()}finally{l=n,o=r,p()}},U.unstable_next=function(e){switch(l){case 1:case 2:case 3:var t=3;break;default:t=l}var n=l,r=o;l=t,o=U.unstable_now();try{return e()}finally{l=n,o=r,p()}},U.unstable_scheduleCallback=function(e,t){var n=-1!==o?o:U.unstable_now();if("object"===typeof t&&null!==t&&"number"===typeof t.timeout)t=n+t.timeout;else switch(l){case 1:t=n+-1;break;case 2:t=n+250;break;case 5:t=n+1073741823;break;case 4:t=n+1e4;break;default:t=n+5e3}if(e={callback:e,priorityLevel:l,expirationTime:t,next:null,previous:null},null===a)a=e.next=e.previous=e,c();else{n=null;var r=a;do{if(r.expirationTime>t){n=r;break}r=r.next}while(r!==a);null===n?n=a:n===a&&(a=e,c()),(t=n.previous).next=n.previous=e,e.next=n,e.previous=t}return e},U.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)a=null;else{e===a&&(a=t);var n=e.previous;(n.next=t).previous=n}e.next=e.previous=null}},U.unstable_wrapCallback=function(n){var r=l;return function(){var e=l,t=o;l=r,o=U.unstable_now();try{return n.apply(this,arguments)}finally{l=e,o=t,p()}}},U.unstable_getCurrentPriorityLevel=function(){return l},U.unstable_shouldYield=function(){return!r&&(null!==a&&a.expirationTimethis.eventPool.length&&this.eventPool.push(e)}function fe(e){e.eventPool=[],e.getPooled=se,e.release=ce}y(ue.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:le,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=le,this._dispatchInstances=this._dispatchListeners=null}}),ue.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ue.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return y(o,n.prototype),((n.prototype=o).constructor=n).Interface=y({},r.Interface,e),n.extend=r.extend,fe(n),n},fe(ue);var pe=ue.extend({data:null}),de=ue.extend({data:null}),he=[9,13,27,32],Ae=H&&"CompositionEvent"in window,me=null;H&&"documentMode"in document&&(me=document.documentMode);var ge=H&&"TextEvent"in window&&!me,ye=H&&(!Ae||me&&8=me),ve=String.fromCharCode(32),be={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Ee=!1;function Ce(e,t){switch(e){case"keyup":return-1!==he.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function we(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var xe=!1;var Be={eventTypes:be,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(Ae)e:{switch(e){case"compositionstart":o=be.compositionStart;break e;case"compositionend":o=be.compositionEnd;break e;case"compositionupdate":o=be.compositionUpdate;break e}o=void 0}else xe?Ce(e,n)&&(o=be.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=be.compositionStart);return i=o?(ye&&"ko"!==n.locale&&(xe||o!==be.compositionStart?o===be.compositionEnd&&xe&&(i=ie()):(re="value"in(ne=r)?ne.value:ne.textContent,xe=!0)),o=pe.getPooled(o,t,n,r),i?o.data=i:null!==(i=we(n))&&(o.data=i),q(o),o):null,(e=ge?function(e,t){switch(e){case"compositionend":return we(t);case"keypress":return 32!==t.which?null:(Ee=!0,ve);case"textInput":return(e=t.data)===ve&&Ee?null:e;default:return null}}(e,n):function(e,t){if(xe)return"compositionend"===e||!Ae&&Ce(e,t)?(e=ie(),oe=re=ne=null,xe=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1