├── .gitignore ├── LICENSE ├── README.md ├── components └── nav.js ├── out ├── .nojekyll ├── 404.html ├── CNAME ├── IBMPlexMono-Regular.woff ├── IBMPlexMono-Regular.woff2 ├── IBMPlexSans-Regular.woff ├── IBMPlexSans-Regular.woff2 ├── IBMPlexSerif-Regular.woff ├── IBMPlexSerif-Regular.woff2 ├── _next │ └── static │ │ ├── PZa48Eu1Xq1KR0uaqScuq │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── chunks │ │ ├── 0.js │ │ ├── 0.js.map │ │ └── commons.ee207d0e464a70a92a54.js │ │ ├── development │ │ ├── dll │ │ │ ├── dll_d6a88dbe3071bd165157.js │ │ │ └── dll_d6a88dbe3071bd165157.js.map │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _app.js.map │ │ │ ├── _error.js │ │ │ ├── _error.js.map │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── nHQpeNZagzw2d5S3_6gA5 │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── o3wOKG0jVbuWMvD0znjMG │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── runtime │ │ ├── amp.js │ │ ├── amp.js.map │ │ ├── main-dea3d76b88b8867bf0cc.js │ │ ├── main.js │ │ ├── main.js.map │ │ ├── polyfills-510791b1bc66cc8557b9.js │ │ ├── polyfills.js │ │ ├── polyfills.js.map │ │ ├── webpack-08f7b238829422e3b9b2.js │ │ ├── webpack.js │ │ └── webpack.js.map │ │ └── webpack │ │ ├── 3ad2843ba247d80b22cd.hot-update.json │ │ ├── d78c17e5974b1cd73546.hot-update.json │ │ └── static │ │ └── development │ │ └── pages │ │ ├── index.js.d78c17e5974b1cd73546.hot-update.js │ │ └── index.js.d78c17e5974b1cd73546.hot-update.js.map ├── christmasst.jpeg ├── diagram.png ├── diagram2.png ├── favicon.ico ├── favicon.png ├── fka.jpg ├── grant.jpg ├── grant.png ├── gray.png ├── index.html ├── lion.jpg ├── matrix.jpg ├── pal.gif ├── pal.png ├── paristx.jpeg ├── scruggs.jpg ├── wick.jpg └── yyy.jpg ├── package-lock.json ├── package.json ├── pages ├── _document.js └── index.js ├── public ├── IBMPlexMono-Regular.woff ├── IBMPlexMono-Regular.woff2 ├── IBMPlexSans-Regular.woff ├── IBMPlexSans-Regular.woff2 ├── IBMPlexSerif-Regular.woff ├── IBMPlexSerif-Regular.woff2 ├── christmasst.jpeg ├── diagram.png ├── diagram2.png ├── favicon.ico ├── favicon.png ├── fka.jpg ├── grant.jpg ├── grant.png ├── gray.png ├── lion.jpg ├── matrix.jpg ├── pal.gif ├── pal.png ├── paristx.jpeg ├── scruggs.jpg ├── wick.jpg └── yyy.jpg ├── s ├── theme_min.js └── themes.js ├── scripts └── data_clean.js └── shaders └── shaders.js /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | 14 | # production 15 | /build 16 | 17 | # misc 18 | .DS_Store 19 | .env* 20 | 21 | # debug 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 constraint systems 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pal 2 | 3 | 6 | 7 | Apply an eight-color terminal palette to an image. Use keyboard controls to choose a theme, set thresholds, and cycle hues. 8 | 9 | https://pal.constraint.systems 10 | 11 | ## How it works 12 | 13 | ### Applying the base colors 14 | 15 | Pal looks at each pixel of the image. It first looks at luminance. If the luminance value is lower than the `lothresh` threshold, the pixel is set to black. If the luminance value is higher than the `hithresh` threshold, the pixel is set to white. If it is between the thresholds, it uses a formula to calculate the hue. The pixel is then set to the closest hue (from red, yellow, green, blue, magenta and cyan). If the color has no hue (if its red, green, and blue values are equal) it is set to black or white based on a luminance threshold of 0.5. 16 | 17 | ### Applying a theme 18 | 19 | To apply a theme Pal uses the palette categories from the base color values: red pixels are set to whatever is in that theme's red slot, etc. An alternative way to do it would be to recalculate the closest hue based on the theme's colors (this is how color palettes are usually applied). But Pal doesn't do that. Pal uses the calculations from the base colors and applies the theme on top of that. For black and white Pal uses the background and foreground colors from the theme. It uses whichever one is darker for the black pixels (so dark themes use the background color for black while light themes use the foreground color). 20 | 21 | `shue` shifts the hue slots according to its value. The background and foreground colors remain the same. 22 | 23 | ### The shader 24 | 25 | I use a [shader](https://github.com/constraint-systems/pal/blob/master/shaders/shaders.js) to apply the themes. Originally I was doing canvas pixel manipulation, but the rendering was taking a long time. Switching to a shader made the theme changes instantaneous. I used [Mike Riethmuller's wonderful guide to get the shader working](https://www.madebymike.com.au/writing/canvas-image-manipulation/), modifying it to fit inside a React app. I'm pretty sure I'm not supposed to use so many if statements in a shader, so if anyone wants to clue me in to a better way to write [the fragment shader](/constraint-systems/pal/blob/master/shaders/shaders.js) I'd be happy to hear it. 26 | 27 | ### Themes 28 | 29 | The themes are from the [Gogh terminal color scheme project](https://github.com/Mayccoll/Gogh). I converted them into a more minimal [JSON file](https://github.com/constraint-systems/pal/blob/master/s/theme_min.js). Let me know if you'd like a theme added and have the color values. 30 | -------------------------------------------------------------------------------- /components/nav.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Link from 'next/link' 3 | 4 | const links = [ 5 | { href: 'https://zeit.co/now', label: 'ZEIT' }, 6 | { href: 'https://github.com/zeit/next.js', label: 'GitHub' }, 7 | ].map(link => { 8 | link.key = `nav-link-${link.href}-${link.label}` 9 | return link 10 | }) 11 | 12 | const Nav = () => ( 13 | 54 | ) 55 | 56 | export default Nav 57 | -------------------------------------------------------------------------------- /out/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/.nojekyll -------------------------------------------------------------------------------- /out/404.html: -------------------------------------------------------------------------------- 1 | Pal

404

This page could not be found.

-------------------------------------------------------------------------------- /out/CNAME: -------------------------------------------------------------------------------- 1 | pal.constraint.systems 2 | -------------------------------------------------------------------------------- /out/IBMPlexMono-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/IBMPlexMono-Regular.woff -------------------------------------------------------------------------------- /out/IBMPlexMono-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/IBMPlexMono-Regular.woff2 -------------------------------------------------------------------------------- /out/IBMPlexSans-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/IBMPlexSans-Regular.woff -------------------------------------------------------------------------------- /out/IBMPlexSans-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/IBMPlexSans-Regular.woff2 -------------------------------------------------------------------------------- /out/IBMPlexSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/IBMPlexSerif-Regular.woff -------------------------------------------------------------------------------- /out/IBMPlexSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/IBMPlexSerif-Regular.woff2 -------------------------------------------------------------------------------- /out/_next/static/PZa48Eu1Xq1KR0uaqScuq/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{B5Ud:function(n,t,e){"use strict";var r=e("/HRN"),u=e("WaGi"),a=e("ZDA2"),o=e("/+P4"),i=e("N9n2"),p=e("ln6h"),c=e("KI45");t.__esModule=!0,t.Container=function(n){0;return n.children},t.createUrl=P,t.default=void 0;var s=c(e("htGi")),l=c(e("+oT+")),f=c(e("q1tI")),h=e("g/15");function d(n){return w.apply(this,arguments)}function w(){return(w=(0,l.default)(p.mark((function n(t){var e,r,u;return p.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.Component,r=t.ctx,n.next=3,(0,h.loadGetInitialProps)(e,r);case 3:return u=n.sent,n.abrupt("return",{pageProps:u});case 5:case"end":return n.stop()}}),n)})))).apply(this,arguments)}t.AppInitialProps=h.AppInitialProps,e("nOHt");var v=function(n){function t(){return r(this,t),a(this,o(t).apply(this,arguments))}return i(t,n),u(t,[{key:"componentDidCatch",value:function(n,t){throw n}},{key:"render",value:function(){var n=this.props,t=n.router,e=n.Component,r=n.pageProps,u=P(t);return f.default.createElement(e,(0,s.default)({},r,{url:u}))}}]),t}(f.default.Component);function P(n){var t=n.pathname,e=n.asPath,r=n.query;return{get query(){return r},get pathname(){return t},get asPath(){return e},back:function(){n.back()},push:function(t,e){return n.push(t,e)},pushTo:function(t,e){var r=e?t:"",u=e||t;return n.push(r,u)},replace:function(t,e){return n.replace(t,e)},replaceTo:function(t,e){var r=e?t:"",u=e||t;return n.replace(r,u)}}}t.default=v,v.origGetInitialProps=d,v.getInitialProps=d},"e9+W":function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("B5Ud")}])}},[["e9+W",0,1]]]); -------------------------------------------------------------------------------- /out/_next/static/PZa48Eu1Xq1KR0uaqScuq/pages/_error.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"/a9y":function(e,t,n){"use strict";var r=n("/HRN"),l=n("WaGi"),i=n("ZDA2"),a=n("/+P4"),o=n("N9n2"),d=n("KI45");t.__esModule=!0,t.default=void 0;var s=d(n("q1tI")),u=d(n("8Kt/")),c={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"},p=function(e){function t(){return r(this,t),i(this,a(t).apply(this,arguments))}return o(t,e),l(t,[{key:"render",value:function(){var e=this.props.statusCode,t=this.props.title||c[e]||"An unexpected error has occurred";return s.default.createElement("div",{style:f.error},s.default.createElement(u.default,null,s.default.createElement("title",null,e,": ",t)),s.default.createElement("div",null,s.default.createElement("style",{dangerouslySetInnerHTML:{__html:"body { margin: 0 }"}}),e?s.default.createElement("h1",{style:f.h1},e):null,s.default.createElement("div",{style:f.desc},s.default.createElement("h2",{style:f.h2},t,"."))))}}],[{key:"getInitialProps",value:function(e){var t=e.res,n=e.err;return{statusCode:t&&t.statusCode?t.statusCode:n?n.statusCode:404}}}]),t}(s.default.Component);t.default=p,p.displayName="ErrorPage";var f={error:{color:"#000",background:"#fff",fontFamily:'-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block",textAlign:"left",lineHeight:"49px",height:"49px",verticalAlign:"middle"},h1:{display:"inline-block",borderRight:"1px solid rgba(0, 0, 0,.3)",margin:0,marginRight:"20px",padding:"10px 23px 10px 0",fontSize:"24px",fontWeight:500,verticalAlign:"top"},h2:{fontSize:"14px",fontWeight:"normal",lineHeight:"inherit",margin:0,padding:0}}},"04ac":function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return n("/a9y")}])}},[["04ac",0,1]]]); -------------------------------------------------------------------------------- /out/_next/static/chunks/0.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{ 2 | 3 | /***/ "./node_modules/next/dist/client/dev/noop.js": 4 | /*!***************************************************!*\ 5 | !*** ./node_modules/next/dist/client/dev/noop.js ***! 6 | \***************************************************/ 7 | /*! no static exports found */ 8 | /***/ (function(module, exports, __webpack_require__) { 9 | 10 | "use strict"; 11 | 12 | 13 | /***/ }) 14 | 15 | }]); 16 | //# sourceMappingURL=0.js.map -------------------------------------------------------------------------------- /out/_next/static/chunks/0.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/chunks/0.js","sources":[],"mappings":";;;;;;;;;;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /out/_next/static/nHQpeNZagzw2d5S3_6gA5/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{B5Ud:function(n,t,e){"use strict";var r=e("/HRN"),u=e("WaGi"),a=e("ZDA2"),o=e("/+P4"),i=e("N9n2"),p=e("ln6h"),c=e("KI45");t.__esModule=!0,t.Container=function(n){0;return n.children},t.createUrl=P,t.default=void 0;var s=c(e("htGi")),l=c(e("+oT+")),f=c(e("q1tI")),h=e("g/15");function d(n){return w.apply(this,arguments)}function w(){return(w=(0,l.default)(p.mark((function n(t){var e,r,u;return p.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.Component,r=t.ctx,n.next=3,(0,h.loadGetInitialProps)(e,r);case 3:return u=n.sent,n.abrupt("return",{pageProps:u});case 5:case"end":return n.stop()}}),n)})))).apply(this,arguments)}t.AppInitialProps=h.AppInitialProps,e("nOHt");var v=function(n){function t(){return r(this,t),a(this,o(t).apply(this,arguments))}return i(t,n),u(t,[{key:"componentDidCatch",value:function(n,t){throw n}},{key:"render",value:function(){var n=this.props,t=n.router,e=n.Component,r=n.pageProps,u=P(t);return f.default.createElement(e,(0,s.default)({},r,{url:u}))}}]),t}(f.default.Component);function P(n){var t=n.pathname,e=n.asPath,r=n.query;return{get query(){return r},get pathname(){return t},get asPath(){return e},back:function(){n.back()},push:function(t,e){return n.push(t,e)},pushTo:function(t,e){var r=e?t:"",u=e||t;return n.push(r,u)},replace:function(t,e){return n.replace(t,e)},replaceTo:function(t,e){var r=e?t:"",u=e||t;return n.replace(r,u)}}}t.default=v,v.origGetInitialProps=d,v.getInitialProps=d},"e9+W":function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("B5Ud")}])}},[["e9+W",0,1]]]); -------------------------------------------------------------------------------- /out/_next/static/nHQpeNZagzw2d5S3_6gA5/pages/_error.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"/a9y":function(e,t,n){"use strict";var r=n("/HRN"),l=n("WaGi"),i=n("ZDA2"),a=n("/+P4"),o=n("N9n2"),d=n("KI45");t.__esModule=!0,t.default=void 0;var s=d(n("q1tI")),u=d(n("8Kt/")),c={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"},p=function(e){function t(){return r(this,t),i(this,a(t).apply(this,arguments))}return o(t,e),l(t,[{key:"render",value:function(){var e=this.props.statusCode,t=this.props.title||c[e]||"An unexpected error has occurred";return s.default.createElement("div",{style:f.error},s.default.createElement(u.default,null,s.default.createElement("title",null,e,": ",t)),s.default.createElement("div",null,s.default.createElement("style",{dangerouslySetInnerHTML:{__html:"body { margin: 0 }"}}),e?s.default.createElement("h1",{style:f.h1},e):null,s.default.createElement("div",{style:f.desc},s.default.createElement("h2",{style:f.h2},t,"."))))}}],[{key:"getInitialProps",value:function(e){var t=e.res,n=e.err;return{statusCode:t&&t.statusCode?t.statusCode:n?n.statusCode:404}}}]),t}(s.default.Component);t.default=p,p.displayName="ErrorPage";var f={error:{color:"#000",background:"#fff",fontFamily:'-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block",textAlign:"left",lineHeight:"49px",height:"49px",verticalAlign:"middle"},h1:{display:"inline-block",borderRight:"1px solid rgba(0, 0, 0,.3)",margin:0,marginRight:"20px",padding:"10px 23px 10px 0",fontSize:"24px",fontWeight:500,verticalAlign:"top"},h2:{fontSize:"14px",fontWeight:"normal",lineHeight:"inherit",margin:0,padding:0}}},"04ac":function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return n("/a9y")}])}},[["04ac",0,1]]]); -------------------------------------------------------------------------------- /out/_next/static/o3wOKG0jVbuWMvD0znjMG/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{B5Ud:function(n,t,e){"use strict";var r=e("/HRN"),u=e("WaGi"),a=e("ZDA2"),o=e("/+P4"),i=e("N9n2"),p=e("ln6h"),c=e("KI45");t.__esModule=!0,t.Container=function(n){0;return n.children},t.createUrl=P,t.default=void 0;var s=c(e("htGi")),l=c(e("+oT+")),f=c(e("q1tI")),h=e("g/15");function d(n){return w.apply(this,arguments)}function w(){return(w=(0,l.default)(p.mark((function n(t){var e,r,u;return p.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.Component,r=t.ctx,n.next=3,(0,h.loadGetInitialProps)(e,r);case 3:return u=n.sent,n.abrupt("return",{pageProps:u});case 5:case"end":return n.stop()}}),n)})))).apply(this,arguments)}t.AppInitialProps=h.AppInitialProps,e("nOHt");var v=function(n){function t(){return r(this,t),a(this,o(t).apply(this,arguments))}return i(t,n),u(t,[{key:"componentDidCatch",value:function(n,t){throw n}},{key:"render",value:function(){var n=this.props,t=n.router,e=n.Component,r=n.pageProps,u=P(t);return f.default.createElement(e,(0,s.default)({},r,{url:u}))}}]),t}(f.default.Component);function P(n){var t=n.pathname,e=n.asPath,r=n.query;return{get query(){return r},get pathname(){return t},get asPath(){return e},back:function(){n.back()},push:function(t,e){return n.push(t,e)},pushTo:function(t,e){var r=e?t:"",u=e||t;return n.push(r,u)},replace:function(t,e){return n.replace(t,e)},replaceTo:function(t,e){var r=e?t:"",u=e||t;return n.replace(r,u)}}}t.default=v,v.origGetInitialProps=d,v.getInitialProps=d},"e9+W":function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("B5Ud")}])}},[["e9+W",0,1]]]); -------------------------------------------------------------------------------- /out/_next/static/o3wOKG0jVbuWMvD0znjMG/pages/_error.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"/a9y":function(e,t,n){"use strict";var r=n("/HRN"),l=n("WaGi"),i=n("ZDA2"),a=n("/+P4"),o=n("N9n2"),d=n("KI45");t.__esModule=!0,t.default=void 0;var s=d(n("q1tI")),u=d(n("8Kt/")),c={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"},p=function(e){function t(){return r(this,t),i(this,a(t).apply(this,arguments))}return o(t,e),l(t,[{key:"render",value:function(){var e=this.props.statusCode,t=this.props.title||c[e]||"An unexpected error has occurred";return s.default.createElement("div",{style:f.error},s.default.createElement(u.default,null,s.default.createElement("title",null,e,": ",t)),s.default.createElement("div",null,s.default.createElement("style",{dangerouslySetInnerHTML:{__html:"body { margin: 0 }"}}),e?s.default.createElement("h1",{style:f.h1},e):null,s.default.createElement("div",{style:f.desc},s.default.createElement("h2",{style:f.h2},t,"."))))}}],[{key:"getInitialProps",value:function(e){var t=e.res,n=e.err;return{statusCode:t&&t.statusCode?t.statusCode:n?n.statusCode:404}}}]),t}(s.default.Component);t.default=p,p.displayName="ErrorPage";var f={error:{color:"#000",background:"#fff",fontFamily:'-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block",textAlign:"left",lineHeight:"49px",height:"49px",verticalAlign:"middle"},h1:{display:"inline-block",borderRight:"1px solid rgba(0, 0, 0,.3)",margin:0,marginRight:"20px",padding:"10px 23px 10px 0",fontSize:"24px",fontWeight:500,verticalAlign:"top"},h2:{fontSize:"14px",fontWeight:"normal",lineHeight:"inherit",margin:0,padding:0}}},"04ac":function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return n("/a9y")}])}},[["04ac",0,1]]]); -------------------------------------------------------------------------------- /out/_next/static/runtime/main-dea3d76b88b8867bf0cc.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"/h46":function(e,t,r){r("cHUd")("Map")},"0IRE":function(e,t,r){"use strict";var n=r("LX0d"),a=r("/HRN"),o=r("WaGi");r("hfKm")(t,"__esModule",{value:!0});var u=function(){function e(t){a(this,e),this.data=new n(t)}return o(e,[{key:"getData",value:function(){return this.data}},{key:"get",value:function(e){return this.data.get(e)}},{key:"set",value:function(e,t){this.data.set(e,t)}},{key:"overwrite",value:function(e){this.data=new n(e)}}]),e}();t.DataManager=u},BMP1:function(e,t,r){"use strict";var n=r("5Uuq")(r("IKlv"));window.next=n,(0,n.default)().catch((function(e){console.error(e.message+"\n"+e.stack)}))},DqTX:function(e,t,r){"use strict";var n=r("/HRN"),a=r("WaGi"),o=r("KI45");t.__esModule=!0,t.default=void 0;var u=o(r("eVuF")),i={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},c=function(){function e(){var t=this;n(this,e),this.updateHead=function(e){var r=t.updatePromise=u.default.resolve().then((function(){r===t.updatePromise&&(t.updatePromise=null,t.doUpdateHead(e))}))},this.updatePromise=null}return a(e,[{key:"doUpdateHead",value:function(e){var t=this,r={};e.forEach((function(e){var t=r[e.type]||[];t.push(e),r[e.type]=t})),this.updateTitle(r.title?r.title[0]:null);["meta","base","link","style","script"].forEach((function(e){t.updateElements(e,r[e]||[])}))}},{key:"updateTitle",value:function(e){var t="";if(e){var r=e.props.children;t="string"===typeof r?r:r.join("")}t!==document.title&&(document.title=t)}},{key:"updateElements",value:function(e,t){var r=document.getElementsByTagName("head")[0],n=r.querySelector("meta[name=next-head-count]");for(var a=Number(n.content),o=[],u=0,i=n.previousElementSibling;u0?arguments[0]:void 0)}}),{get:function(e){var t=n.getEntry(a(this,"Map"),e);return t&&t.v},set:function(e,t){return n.def(a(this,"Map"),0===e?0:e,t)}},n,!0)},qArv:function(e,t,r){"use strict";var n=r("hfKm"),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};n(t,"__esModule",{value:!0});var o=a(r("q1tI"));t.DataManagerContext=o.createContext(null)},yLiY:function(e,t,r){"use strict";var n;r("hfKm")(t,"__esModule",{value:!0}),t.default=function(){return n},t.setConfig=function(e){n=e}},zmvN:function(e,t,r){"use strict";var n=r("ln6h"),a=r("/HRN"),o=r("WaGi"),u=r("KI45");t.__esModule=!0,t.default=void 0;var i=u(r("+oT+")),c=u(r("eVuF")),s=u(r("dZ6Y")),p="preload";var f=function(e){try{return e.relList.supports(p)}catch(t){return!1}}(document.createElement("link"));function d(e,t){var r=document.createElement("link");r.rel=p,r.crossOrigin=void 0,r.href=e,r.as=t,document.head.appendChild(r)}var l=function(){function e(t,r){a(this,e),this.buildId=t,this.assetPrefix=r,this.pageCache={},this.pageRegisterEvents=(0,s.default)(),this.loadingRoutes={}}return o(e,[{key:"getDependencies",value:function(e){return this.promisedBuildManifest.then((function(t){return t[e]&&t[e].map((function(e){return"/_next/"+encodeURI(e)}))||[]}))}},{key:"normalizeRoute",value:function(e){if("/"!==e[0])throw new Error('Route name should start with a "/", got "'+e+'"');return"/"===(e=e.replace(/\/index$/,"/"))?e:e.replace(/\/$/,"")}},{key:"loadPage",value:function(e){return this.loadPageScript(e).then((function(e){return e.page}))}},{key:"loadPageScript",value:function(e){var t=this;return e=this.normalizeRoute(e),new c.default((function(r,n){var a=t.pageCache[e];if(a){var o=a.error,u=a.page,i=a.mod;o?n(o):r({page:u,mod:i})}else t.pageRegisterEvents.on(e,(function a(o){var u=o.error,i=o.page,c=o.mod;t.pageRegisterEvents.off(e,a),delete t.loadingRoutes[e],u?n(u):r({page:i,mod:c})})),document.querySelector('script[data-next-page="'+e+'"]')||t.loadingRoutes[e]||(t.loadRoute(e),t.loadingRoutes[e]=!0)}))}},{key:"loadRoute",value:function(e){var t=this;return(0,i.default)(n.mark((function r(){var a,o;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e=t.normalizeRoute(e),a="/"===e?"/index.js":e+".js",o=t.assetPrefix+"/_next/static/"+encodeURIComponent(t.buildId)+"/pages"+encodeURI(a),t.loadScript(o,e,!0);case 4:case"end":return r.stop()}}),r)})))()}},{key:"loadScript",value:function(e,t,r){var n=this,a=document.createElement("script");a.crossOrigin=void 0,a.src=e,a.onerror=function(){var r=new Error("Error loading script "+e);r.code="PAGE_LOAD_ERROR",n.pageRegisterEvents.emit(t,{error:r})},document.body.appendChild(a)}},{key:"registerPage",value:function(e,t){var r=this;!function(){try{var n=t(),a={page:n.default||n,mod:n};r.pageCache[e]=a,r.pageRegisterEvents.emit(e,a)}catch(o){r.pageCache[e]={error:o},r.pageRegisterEvents.emit(e,{error:o})}}()}},{key:"prefetch",value:function(e,t){var r=this;return(0,i.default)(n.mark((function a(){var o,u,i;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=r.normalizeRoute(e),o=("/"===e?"/index":e)+".js",u=r.assetPrefix+(t?e:"/_next/static/"+encodeURIComponent(r.buildId)+"/pages"+encodeURI(o)),!document.querySelector('link[rel="'+p+'"][href^="'+u+'"], script[data-next-page="'+e+'"]')){n.next=6;break}return n.abrupt("return");case 6:if(!(i=navigator.connection)){n.next=9;break}if(-1===(i.effectiveType||"").indexOf("2g")&&!i.saveData){n.next=9;break}return n.abrupt("return");case 9:n.next=15;break;case 13:n.t0=function(e){r.prefetch(e,!0)},n.sent.forEach(n.t0);case 15:if(!f){n.next=18;break}return d(u,u.match(/\.css$/)?"style":"script"),n.abrupt("return");case 18:if(!t){n.next=20;break}return n.abrupt("return");case 20:if("complete"!==document.readyState){n.next=24;break}return n.abrupt("return",r.loadPage(e).catch((function(){})));case 24:return n.abrupt("return",new c.default((function(t){window.addEventListener("load",(function(){r.loadPage(e).then((function(){return t()}),(function(){return t()}))}))})));case 25:case"end":return n.stop()}}),a)})))()}}]),e}();t.default=l}},[["BMP1",0,1]]]); -------------------------------------------------------------------------------- /out/_next/static/runtime/polyfills-510791b1bc66cc8557b9.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{GkXk:function(t,e,r){!function(t){"use strict";var e={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(e.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function i(t){return"string"!==typeof t&&(t=String(t)),t}function a(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return e.iterable&&(r[Symbol.iterator]=function(){return r}),r}function s(t){this.map={},t instanceof s?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function h(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function f(t){var e=new FileReader,r=h(e);return e.readAsArrayBuffer(t),r}function u(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var r;this._bodyInit=t,t?"string"===typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&(r=t)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=u(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||n(t))?this._bodyArrayBuffer=u(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"===typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=h(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function b(t){var e=new s;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}})),e}function m(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new s(e.headers),this.url=e.url||"",this._initBody(t)}d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},p.call(d.prototype),p.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var v=[301,302,303,307,308];m.redirect=function(t,e){if(-1===v.indexOf(e))throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},t.DOMException=self.DOMException;try{new t.DOMException}catch(g){t.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(r,n){return new Promise((function(o,i){var a=new d(r,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t={status:s.status,statusText:s.statusText,headers:b(s.getAllResponseHeaders()||"")};t.url="responseURL"in s?s.responseURL:t.headers.get("X-Request-URL");var e="response"in s?s.response:s.responseText;o(new m(e,t))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&e.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}w.polyfill=!0,self.fetch||(self.fetch=w,self.Headers=s,self.Request=d,self.Response=m),t.Headers=s,t.Request=d,t.Response=m,t.fetch=w,Object.defineProperty(t,"__esModule",{value:!0})}(e)},MgzW:function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(o){return!1}}()?Object.assign:function(t,e){for(var r,s,c=a(t),h=1;he[0]?1:0})),t._entries&&(t._entries={});for(var r=0;r1?o(n[1]):"")}})}("undefined"!==typeof t?t:"undefined"!==typeof window?window:"undefined"!==typeof self?self:this),function(t){if(function(){try{var e=new t.URL("b","http://a");return e.pathname="c%20d","http://a/c%20d"===e.href&&e.searchParams}catch(r){return!1}}()||function(){var e=t.URL,r=function(e,r){"string"!==typeof e&&(e=String(e));var n,o=document;if(r&&(void 0===t.location||r!==t.location.href)){(n=(o=document.implementation.createHTMLDocument("")).createElement("base")).href=r,o.head.appendChild(n);try{if(0!==n.href.indexOf(r))throw new Error(n.href)}catch(u){throw new Error("URL unable to set base "+r+" due to "+u)}}var i=o.createElement("a");if(i.href=e,n&&(o.body.appendChild(i),i.href=i.href),":"===i.protocol||!/:/.test(i.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:i});var a=new t.URLSearchParams(this.search),s=!0,c=!0,h=this;["append","delete","set"].forEach((function(t){var e=a[t];a[t]=function(){e.apply(a,arguments),s&&(c=!1,h.search=a.toString(),c=!0)}})),Object.defineProperty(this,"searchParams",{value:a,enumerable:!0});var f=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==f&&(f=this.search,c&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})},n=r.prototype;["hash","host","hostname","port","protocol"].forEach((function(t){!function(t){Object.defineProperty(n,t,{get:function(){return this._anchorElement[t]},set:function(e){this._anchorElement[t]=e},enumerable:!0})}(t)})),Object.defineProperty(n,"search",{get:function(){return this._anchorElement.search},set:function(t){this._anchorElement.search=t,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(n,{toString:{get:function(){var t=this;return function(){return t.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(t){this._anchorElement.href=t,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(t){this._anchorElement.pathname=t},enumerable:!0},origin:{get:function(){var t={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],e=this._anchorElement.port!=t&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(e?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(t){},enumerable:!0},username:{get:function(){return""},set:function(t){},enumerable:!0}}),r.createObjectURL=function(t){return e.createObjectURL.apply(e,arguments)},r.revokeObjectURL=function(t){return e.revokeObjectURL.apply(e,arguments)},t.URL=r}(),void 0!==t.location&&!("origin"in t.location)){var e=function(){return t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:"")};try{Object.defineProperty(t.location,"origin",{get:e,enumerable:!0})}catch(r){setInterval((function(){t.location.origin=e()}),100)}}}("undefined"!==typeof t?t:"undefined"!==typeof window?window:"undefined"!==typeof self?self:this)}).call(this,r("yLpj"))},XLER:function(t,e,r){"use strict";r("GkXk"),r("T1qB"),Object.assign=r("MgzW")},yLpj:function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(n){"object"===typeof window&&(r=window)}t.exports=r}},[["XLER",0]]]); -------------------------------------------------------------------------------- /out/_next/static/runtime/polyfills.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/runtime/polyfills.js","sources":["webpack:///./node_modules/next/dist/client/polyfills.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/url-polyfill/url-polyfill.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/whatwg-fetch/dist/fetch.umd.js"],"sourcesContent":["\"use strict\";require(\"__next_polyfill__fetch\");require(\"url-polyfill\");Object.assign=require('__next_polyfill__object_assign');","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","(function(global) {\r\n /**\r\n * Polyfill URLSearchParams\r\n *\r\n * Inspired from : https://github.com/WebReflection/url-search-params/blob/master/src/url-search-params.js\r\n */\r\n\r\n var checkIfIteratorIsSupported = function() {\r\n try {\r\n return !!Symbol.iterator;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n\r\n\r\n var iteratorSupported = checkIfIteratorIsSupported();\r\n\r\n var createIterator = function(items) {\r\n var iterator = {\r\n next: function() {\r\n var value = items.shift();\r\n return { done: value === void 0, value: value };\r\n }\r\n };\r\n\r\n if (iteratorSupported) {\r\n iterator[Symbol.iterator] = function() {\r\n return iterator;\r\n };\r\n }\r\n\r\n return iterator;\r\n };\r\n\r\n /**\r\n * Search param name and values should be encoded according to https://url.spec.whatwg.org/#urlencoded-serializing\r\n * encodeURIComponent() produces the same result except encoding spaces as `%20` instead of `+`.\r\n */\r\n var serializeParam = function(value) {\r\n return encodeURIComponent(value).replace(/%20/g, '+');\r\n };\r\n\r\n var deserializeParam = function(value) {\r\n return decodeURIComponent(String(value).replace(/\\+/g, ' '));\r\n };\r\n\r\n var polyfillURLSearchParams = function() {\r\n\r\n var URLSearchParams = function(searchString) {\r\n Object.defineProperty(this, '_entries', { writable: true, value: {} });\r\n var typeofSearchString = typeof searchString;\r\n\r\n if (typeofSearchString === 'undefined') {\r\n // do nothing\r\n } else if (typeofSearchString === 'string') {\r\n if (searchString !== '') {\r\n this._fromString(searchString);\r\n }\r\n } else if (searchString instanceof URLSearchParams) {\r\n var _this = this;\r\n searchString.forEach(function(value, name) {\r\n _this.append(name, value);\r\n });\r\n } else if ((searchString !== null) && (typeofSearchString === 'object')) {\r\n if (Object.prototype.toString.call(searchString) === '[object Array]') {\r\n for (var i = 0; i < searchString.length; i++) {\r\n var entry = searchString[i];\r\n if ((Object.prototype.toString.call(entry) === '[object Array]') || (entry.length !== 2)) {\r\n this.append(entry[0], entry[1]);\r\n } else {\r\n throw new TypeError('Expected [string, any] as entry at index ' + i + ' of URLSearchParams\\'s input');\r\n }\r\n }\r\n } else {\r\n for (var key in searchString) {\r\n if (searchString.hasOwnProperty(key)) {\r\n this.append(key, searchString[key]);\r\n }\r\n }\r\n }\r\n } else {\r\n throw new TypeError('Unsupported input\\'s type for URLSearchParams');\r\n }\r\n };\r\n\r\n var proto = URLSearchParams.prototype;\r\n\r\n proto.append = function(name, value) {\r\n if (name in this._entries) {\r\n this._entries[name].push(String(value));\r\n } else {\r\n this._entries[name] = [String(value)];\r\n }\r\n };\r\n\r\n proto.delete = function(name) {\r\n delete this._entries[name];\r\n };\r\n\r\n proto.get = function(name) {\r\n return (name in this._entries) ? this._entries[name][0] : null;\r\n };\r\n\r\n proto.getAll = function(name) {\r\n return (name in this._entries) ? this._entries[name].slice(0) : [];\r\n };\r\n\r\n proto.has = function(name) {\r\n return (name in this._entries);\r\n };\r\n\r\n proto.set = function(name, value) {\r\n this._entries[name] = [String(value)];\r\n };\r\n\r\n proto.forEach = function(callback, thisArg) {\r\n var entries;\r\n for (var name in this._entries) {\r\n if (this._entries.hasOwnProperty(name)) {\r\n entries = this._entries[name];\r\n for (var i = 0; i < entries.length; i++) {\r\n callback.call(thisArg, entries[i], name, this);\r\n }\r\n }\r\n }\r\n };\r\n\r\n proto.keys = function() {\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push(name);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n proto.values = function() {\r\n var items = [];\r\n this.forEach(function(value) {\r\n items.push(value);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n proto.entries = function() {\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push([name, value]);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n if (iteratorSupported) {\r\n proto[Symbol.iterator] = proto.entries;\r\n }\r\n\r\n proto.toString = function() {\r\n var searchArray = [];\r\n this.forEach(function(value, name) {\r\n searchArray.push(serializeParam(name) + '=' + serializeParam(value));\r\n });\r\n return searchArray.join('&');\r\n };\r\n\r\n\r\n global.URLSearchParams = URLSearchParams;\r\n };\r\n\r\n var checkIfURLSearchParamsSupported = function() {\r\n try {\r\n var URLSearchParams = global.URLSearchParams;\r\n\r\n return (new URLSearchParams('?a=1').toString() === 'a=1') && (typeof URLSearchParams.prototype.set === 'function');\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n if (!checkIfURLSearchParamsSupported()) {\r\n polyfillURLSearchParams();\r\n }\r\n\r\n var proto = global.URLSearchParams.prototype;\r\n\r\n if (typeof proto.sort !== 'function') {\r\n proto.sort = function() {\r\n var _this = this;\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push([name, value]);\r\n if (!_this._entries) {\r\n _this.delete(name);\r\n }\r\n });\r\n items.sort(function(a, b) {\r\n if (a[0] < b[0]) {\r\n return -1;\r\n } else if (a[0] > b[0]) {\r\n return +1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n if (_this._entries) { // force reset because IE keeps keys index\r\n _this._entries = {};\r\n }\r\n for (var i = 0; i < items.length; i++) {\r\n this.append(items[i][0], items[i][1]);\r\n }\r\n };\r\n }\r\n\r\n if (typeof proto._fromString !== 'function') {\r\n Object.defineProperty(proto, '_fromString', {\r\n enumerable: false,\r\n configurable: false,\r\n writable: false,\r\n value: function(searchString) {\r\n if (this._entries) {\r\n this._entries = {};\r\n } else {\r\n var keys = [];\r\n this.forEach(function(value, name) {\r\n keys.push(name);\r\n });\r\n for (var i = 0; i < keys.length; i++) {\r\n this.delete(keys[i]);\r\n }\r\n }\r\n\r\n searchString = searchString.replace(/^\\?/, '');\r\n var attributes = searchString.split('&');\r\n var attribute;\r\n for (var i = 0; i < attributes.length; i++) {\r\n attribute = attributes[i].split('=');\r\n this.append(\r\n deserializeParam(attribute[0]),\r\n (attribute.length > 1) ? deserializeParam(attribute[1]) : ''\r\n );\r\n }\r\n }\r\n });\r\n }\r\n\r\n // HTMLAnchorElement\r\n\r\n})(\r\n (typeof global !== 'undefined') ? global\r\n : ((typeof window !== 'undefined') ? window\r\n : ((typeof self !== 'undefined') ? self : this))\r\n);\r\n\r\n(function(global) {\r\n /**\r\n * Polyfill URL\r\n *\r\n * Inspired from : https://github.com/arv/DOM-URL-Polyfill/blob/master/src/url.js\r\n */\r\n\r\n var checkIfURLIsSupported = function() {\r\n try {\r\n var u = new global.URL('b', 'http://a');\r\n u.pathname = 'c%20d';\r\n return (u.href === 'http://a/c%20d') && u.searchParams;\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n\r\n var polyfillURL = function() {\r\n var _URL = global.URL;\r\n\r\n var URL = function(url, base) {\r\n if (typeof url !== 'string') url = String(url);\r\n\r\n // Only create another document if the base is different from current location.\r\n var doc = document, baseElement;\r\n if (base && (global.location === void 0 || base !== global.location.href)) {\r\n doc = document.implementation.createHTMLDocument('');\r\n baseElement = doc.createElement('base');\r\n baseElement.href = base;\r\n doc.head.appendChild(baseElement);\r\n try {\r\n if (baseElement.href.indexOf(base) !== 0) throw new Error(baseElement.href);\r\n } catch (err) {\r\n throw new Error('URL unable to set base ' + base + ' due to ' + err);\r\n }\r\n }\r\n\r\n var anchorElement = doc.createElement('a');\r\n anchorElement.href = url;\r\n if (baseElement) {\r\n doc.body.appendChild(anchorElement);\r\n anchorElement.href = anchorElement.href; // force href to refresh\r\n }\r\n\r\n if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href)) {\r\n throw new TypeError('Invalid URL');\r\n }\r\n\r\n Object.defineProperty(this, '_anchorElement', {\r\n value: anchorElement\r\n });\r\n\r\n\r\n // create a linked searchParams which reflect its changes on URL\r\n var searchParams = new global.URLSearchParams(this.search);\r\n var enableSearchUpdate = true;\r\n var enableSearchParamsUpdate = true;\r\n var _this = this;\r\n ['append', 'delete', 'set'].forEach(function(methodName) {\r\n var method = searchParams[methodName];\r\n searchParams[methodName] = function() {\r\n method.apply(searchParams, arguments);\r\n if (enableSearchUpdate) {\r\n enableSearchParamsUpdate = false;\r\n _this.search = searchParams.toString();\r\n enableSearchParamsUpdate = true;\r\n }\r\n };\r\n });\r\n\r\n Object.defineProperty(this, 'searchParams', {\r\n value: searchParams,\r\n enumerable: true\r\n });\r\n\r\n var search = void 0;\r\n Object.defineProperty(this, '_updateSearchParams', {\r\n enumerable: false,\r\n configurable: false,\r\n writable: false,\r\n value: function() {\r\n if (this.search !== search) {\r\n search = this.search;\r\n if (enableSearchParamsUpdate) {\r\n enableSearchUpdate = false;\r\n this.searchParams._fromString(this.search);\r\n enableSearchUpdate = true;\r\n }\r\n }\r\n }\r\n });\r\n };\r\n\r\n var proto = URL.prototype;\r\n\r\n var linkURLWithAnchorAttribute = function(attributeName) {\r\n Object.defineProperty(proto, attributeName, {\r\n get: function() {\r\n return this._anchorElement[attributeName];\r\n },\r\n set: function(value) {\r\n this._anchorElement[attributeName] = value;\r\n },\r\n enumerable: true\r\n });\r\n };\r\n\r\n ['hash', 'host', 'hostname', 'port', 'protocol']\r\n .forEach(function(attributeName) {\r\n linkURLWithAnchorAttribute(attributeName);\r\n });\r\n\r\n Object.defineProperty(proto, 'search', {\r\n get: function() {\r\n return this._anchorElement['search'];\r\n },\r\n set: function(value) {\r\n this._anchorElement['search'] = value;\r\n this._updateSearchParams();\r\n },\r\n enumerable: true\r\n });\r\n\r\n Object.defineProperties(proto, {\r\n\r\n 'toString': {\r\n get: function() {\r\n var _this = this;\r\n return function() {\r\n return _this.href;\r\n };\r\n }\r\n },\r\n\r\n 'href': {\r\n get: function() {\r\n return this._anchorElement.href.replace(/\\?$/, '');\r\n },\r\n set: function(value) {\r\n this._anchorElement.href = value;\r\n this._updateSearchParams();\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'pathname': {\r\n get: function() {\r\n return this._anchorElement.pathname.replace(/(^\\/?)/, '/');\r\n },\r\n set: function(value) {\r\n this._anchorElement.pathname = value;\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'origin': {\r\n get: function() {\r\n // get expected port from protocol\r\n var expectedPort = { 'http:': 80, 'https:': 443, 'ftp:': 21 }[this._anchorElement.protocol];\r\n // add port to origin if, expected port is different than actual port\r\n // and it is not empty f.e http://foo:8080\r\n // 8080 != 80 && 8080 != ''\r\n var addPortToOrigin = this._anchorElement.port != expectedPort &&\r\n this._anchorElement.port !== '';\r\n\r\n return this._anchorElement.protocol +\r\n '//' +\r\n this._anchorElement.hostname +\r\n (addPortToOrigin ? (':' + this._anchorElement.port) : '');\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'password': { // TODO\r\n get: function() {\r\n return '';\r\n },\r\n set: function(value) {\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'username': { // TODO\r\n get: function() {\r\n return '';\r\n },\r\n set: function(value) {\r\n },\r\n enumerable: true\r\n },\r\n });\r\n\r\n URL.createObjectURL = function(blob) {\r\n return _URL.createObjectURL.apply(_URL, arguments);\r\n };\r\n\r\n URL.revokeObjectURL = function(url) {\r\n return _URL.revokeObjectURL.apply(_URL, arguments);\r\n };\r\n\r\n global.URL = URL;\r\n\r\n };\r\n\r\n if (!checkIfURLIsSupported()) {\r\n polyfillURL();\r\n }\r\n\r\n if ((global.location !== void 0) && !('origin' in global.location)) {\r\n var getOrigin = function() {\r\n return global.location.protocol + '//' + global.location.hostname + (global.location.port ? (':' + global.location.port) : '');\r\n };\r\n\r\n try {\r\n Object.defineProperty(global.location, 'origin', {\r\n get: getOrigin,\r\n enumerable: true\r\n });\r\n } catch (e) {\r\n setInterval(function() {\r\n global.location.origin = getOrigin();\r\n }, 100);\r\n }\r\n }\r\n\r\n})(\r\n (typeof global !== 'undefined') ? global\r\n : ((typeof window !== 'undefined') ? window\r\n : ((typeof self !== 'undefined') ? self : this))\r\n);\r\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (factory((global.WHATWGFetch = {})));\n}(this, (function (exports) { 'use strict';\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n"],"mappings":";;;;;;;;;;AAAA;AACA;AADA;AACA;AADA;AACA;AADA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACleA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AACA;AACA,WACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /out/_next/static/runtime/webpack-08f7b238829422e3b9b2.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c= 0) hot._disposeHandlers.splice(idx, 1);\n \t\t\t},\n\n \t\t\t// Management API\n \t\t\tcheck: hotCheck,\n \t\t\tapply: hotApply,\n \t\t\tstatus: function(l) {\n \t\t\t\tif (!l) return hotStatus;\n \t\t\t\thotStatusHandlers.push(l);\n \t\t\t},\n \t\t\taddStatusHandler: function(l) {\n \t\t\t\thotStatusHandlers.push(l);\n \t\t\t},\n \t\t\tremoveStatusHandler: function(l) {\n \t\t\t\tvar idx = hotStatusHandlers.indexOf(l);\n \t\t\t\tif (idx >= 0) hotStatusHandlers.splice(idx, 1);\n \t\t\t},\n\n \t\t\t//inherit from previous dispose call\n \t\t\tdata: hotCurrentModuleData[moduleId]\n \t\t};\n \t\thotCurrentChildModule = undefined;\n \t\treturn hot;\n \t}\n\n \tvar hotStatusHandlers = [];\n \tvar hotStatus = \"idle\";\n\n \tfunction hotSetStatus(newStatus) {\n \t\thotStatus = newStatus;\n \t\tfor (var i = 0; i < hotStatusHandlers.length; i++)\n \t\t\thotStatusHandlers[i].call(null, newStatus);\n \t}\n\n \t// while downloading\n \tvar hotWaitingFiles = 0;\n \tvar hotChunksLoading = 0;\n \tvar hotWaitingFilesMap = {};\n \tvar hotRequestedFilesMap = {};\n \tvar hotAvailableFilesMap = {};\n \tvar hotDeferred;\n\n \t// The update info\n \tvar hotUpdate, hotUpdateNewHash;\n\n \tfunction toModuleId(id) {\n \t\tvar isNumber = +id + \"\" === id;\n \t\treturn isNumber ? +id : id;\n \t}\n\n \tfunction hotCheck(apply) {\n \t\tif (hotStatus !== \"idle\") {\n \t\t\tthrow new Error(\"check() is only allowed in idle status\");\n \t\t}\n \t\thotApplyOnUpdate = apply;\n \t\thotSetStatus(\"check\");\n \t\treturn hotDownloadManifest(hotRequestTimeout).then(function(update) {\n \t\t\tif (!update) {\n \t\t\t\thotSetStatus(\"idle\");\n \t\t\t\treturn null;\n \t\t\t}\n \t\t\thotRequestedFilesMap = {};\n \t\t\thotWaitingFilesMap = {};\n \t\t\thotAvailableFilesMap = update.c;\n \t\t\thotUpdateNewHash = update.h;\n\n \t\t\thotSetStatus(\"prepare\");\n \t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\thotDeferred = {\n \t\t\t\t\tresolve: resolve,\n \t\t\t\t\treject: reject\n \t\t\t\t};\n \t\t\t});\n \t\t\thotUpdate = {};\n \t\t\tfor(var chunkId in installedChunks)\n \t\t\t// eslint-disable-next-line no-lone-blocks\n \t\t\t{\n \t\t\t\t/*globals chunkId */\n \t\t\t\thotEnsureUpdateChunk(chunkId);\n \t\t\t}\n \t\t\tif (\n \t\t\t\thotStatus === \"prepare\" &&\n \t\t\t\thotChunksLoading === 0 &&\n \t\t\t\thotWaitingFiles === 0\n \t\t\t) {\n \t\t\t\thotUpdateDownloaded();\n \t\t\t}\n \t\t\treturn promise;\n \t\t});\n \t}\n\n \t// eslint-disable-next-line no-unused-vars\n \tfunction hotAddUpdateChunk(chunkId, moreModules) {\n \t\tif (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])\n \t\t\treturn;\n \t\thotRequestedFilesMap[chunkId] = false;\n \t\tfor (var moduleId in moreModules) {\n \t\t\tif (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\thotUpdate[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif (--hotWaitingFiles === 0 && hotChunksLoading === 0) {\n \t\t\thotUpdateDownloaded();\n \t\t}\n \t}\n\n \tfunction hotEnsureUpdateChunk(chunkId) {\n \t\tif (!hotAvailableFilesMap[chunkId]) {\n \t\t\thotWaitingFilesMap[chunkId] = true;\n \t\t} else {\n \t\t\thotRequestedFilesMap[chunkId] = true;\n \t\t\thotWaitingFiles++;\n \t\t\thotDownloadUpdateChunk(chunkId);\n \t\t}\n \t}\n\n \tfunction hotUpdateDownloaded() {\n \t\thotSetStatus(\"ready\");\n \t\tvar deferred = hotDeferred;\n \t\thotDeferred = null;\n \t\tif (!deferred) return;\n \t\tif (hotApplyOnUpdate) {\n \t\t\t// Wrap deferred object in Promise to mark it as a well-handled Promise to\n \t\t\t// avoid triggering uncaught exception warning in Chrome.\n \t\t\t// See https://bugs.chromium.org/p/chromium/issues/detail?id=465666\n \t\t\tPromise.resolve()\n \t\t\t\t.then(function() {\n \t\t\t\t\treturn hotApply(hotApplyOnUpdate);\n \t\t\t\t})\n \t\t\t\t.then(\n \t\t\t\t\tfunction(result) {\n \t\t\t\t\t\tdeferred.resolve(result);\n \t\t\t\t\t},\n \t\t\t\t\tfunction(err) {\n \t\t\t\t\t\tdeferred.reject(err);\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t} else {\n \t\t\tvar outdatedModules = [];\n \t\t\tfor (var id in hotUpdate) {\n \t\t\t\tif (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {\n \t\t\t\t\toutdatedModules.push(toModuleId(id));\n \t\t\t\t}\n \t\t\t}\n \t\t\tdeferred.resolve(outdatedModules);\n \t\t}\n \t}\n\n \tfunction hotApply(options) {\n \t\tif (hotStatus !== \"ready\")\n \t\t\tthrow new Error(\"apply() is only allowed in ready status\");\n \t\toptions = options || {};\n\n \t\tvar cb;\n \t\tvar i;\n \t\tvar j;\n \t\tvar module;\n \t\tvar moduleId;\n\n \t\tfunction getAffectedStuff(updateModuleId) {\n \t\t\tvar outdatedModules = [updateModuleId];\n \t\t\tvar outdatedDependencies = {};\n\n \t\t\tvar queue = outdatedModules.map(function(id) {\n \t\t\t\treturn {\n \t\t\t\t\tchain: [id],\n \t\t\t\t\tid: id\n \t\t\t\t};\n \t\t\t});\n \t\t\twhile (queue.length > 0) {\n \t\t\t\tvar queueItem = queue.pop();\n \t\t\t\tvar moduleId = queueItem.id;\n \t\t\t\tvar chain = queueItem.chain;\n \t\t\t\tmodule = installedModules[moduleId];\n \t\t\t\tif (!module || module.hot._selfAccepted) continue;\n \t\t\t\tif (module.hot._selfDeclined) {\n \t\t\t\t\treturn {\n \t\t\t\t\t\ttype: \"self-declined\",\n \t\t\t\t\t\tchain: chain,\n \t\t\t\t\t\tmoduleId: moduleId\n \t\t\t\t\t};\n \t\t\t\t}\n \t\t\t\tif (module.hot._main) {\n \t\t\t\t\treturn {\n \t\t\t\t\t\ttype: \"unaccepted\",\n \t\t\t\t\t\tchain: chain,\n \t\t\t\t\t\tmoduleId: moduleId\n \t\t\t\t\t};\n \t\t\t\t}\n \t\t\t\tfor (var i = 0; i < module.parents.length; i++) {\n \t\t\t\t\tvar parentId = module.parents[i];\n \t\t\t\t\tvar parent = installedModules[parentId];\n \t\t\t\t\tif (!parent) continue;\n \t\t\t\t\tif (parent.hot._declinedDependencies[moduleId]) {\n \t\t\t\t\t\treturn {\n \t\t\t\t\t\t\ttype: \"declined\",\n \t\t\t\t\t\t\tchain: chain.concat([parentId]),\n \t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\tparentId: parentId\n \t\t\t\t\t\t};\n \t\t\t\t\t}\n \t\t\t\t\tif (outdatedModules.indexOf(parentId) !== -1) continue;\n \t\t\t\t\tif (parent.hot._acceptedDependencies[moduleId]) {\n \t\t\t\t\t\tif (!outdatedDependencies[parentId])\n \t\t\t\t\t\t\toutdatedDependencies[parentId] = [];\n \t\t\t\t\t\taddAllToSet(outdatedDependencies[parentId], [moduleId]);\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tdelete outdatedDependencies[parentId];\n \t\t\t\t\toutdatedModules.push(parentId);\n \t\t\t\t\tqueue.push({\n \t\t\t\t\t\tchain: chain.concat([parentId]),\n \t\t\t\t\t\tid: parentId\n \t\t\t\t\t});\n \t\t\t\t}\n \t\t\t}\n\n \t\t\treturn {\n \t\t\t\ttype: \"accepted\",\n \t\t\t\tmoduleId: updateModuleId,\n \t\t\t\toutdatedModules: outdatedModules,\n \t\t\t\toutdatedDependencies: outdatedDependencies\n \t\t\t};\n \t\t}\n\n \t\tfunction addAllToSet(a, b) {\n \t\t\tfor (var i = 0; i < b.length; i++) {\n \t\t\t\tvar item = b[i];\n \t\t\t\tif (a.indexOf(item) === -1) a.push(item);\n \t\t\t}\n \t\t}\n\n \t\t// at begin all updates modules are outdated\n \t\t// the \"outdated\" status can propagate to parents if they don't accept the children\n \t\tvar outdatedDependencies = {};\n \t\tvar outdatedModules = [];\n \t\tvar appliedUpdate = {};\n\n \t\tvar warnUnexpectedRequire = function warnUnexpectedRequire() {\n \t\t\tconsole.warn(\n \t\t\t\t\"[HMR] unexpected require(\" + result.moduleId + \") to disposed module\"\n \t\t\t);\n \t\t};\n\n \t\tfor (var id in hotUpdate) {\n \t\t\tif (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {\n \t\t\t\tmoduleId = toModuleId(id);\n \t\t\t\t/** @type {TODO} */\n \t\t\t\tvar result;\n \t\t\t\tif (hotUpdate[id]) {\n \t\t\t\t\tresult = getAffectedStuff(moduleId);\n \t\t\t\t} else {\n \t\t\t\t\tresult = {\n \t\t\t\t\t\ttype: \"disposed\",\n \t\t\t\t\t\tmoduleId: id\n \t\t\t\t\t};\n \t\t\t\t}\n \t\t\t\t/** @type {Error|false} */\n \t\t\t\tvar abortError = false;\n \t\t\t\tvar doApply = false;\n \t\t\t\tvar doDispose = false;\n \t\t\t\tvar chainInfo = \"\";\n \t\t\t\tif (result.chain) {\n \t\t\t\t\tchainInfo = \"\\nUpdate propagation: \" + result.chain.join(\" -> \");\n \t\t\t\t}\n \t\t\t\tswitch (result.type) {\n \t\t\t\t\tcase \"self-declined\":\n \t\t\t\t\t\tif (options.onDeclined) options.onDeclined(result);\n \t\t\t\t\t\tif (!options.ignoreDeclined)\n \t\t\t\t\t\t\tabortError = new Error(\n \t\t\t\t\t\t\t\t\"Aborted because of self decline: \" +\n \t\t\t\t\t\t\t\t\tresult.moduleId +\n \t\t\t\t\t\t\t\t\tchainInfo\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"declined\":\n \t\t\t\t\t\tif (options.onDeclined) options.onDeclined(result);\n \t\t\t\t\t\tif (!options.ignoreDeclined)\n \t\t\t\t\t\t\tabortError = new Error(\n \t\t\t\t\t\t\t\t\"Aborted because of declined dependency: \" +\n \t\t\t\t\t\t\t\t\tresult.moduleId +\n \t\t\t\t\t\t\t\t\t\" in \" +\n \t\t\t\t\t\t\t\t\tresult.parentId +\n \t\t\t\t\t\t\t\t\tchainInfo\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"unaccepted\":\n \t\t\t\t\t\tif (options.onUnaccepted) options.onUnaccepted(result);\n \t\t\t\t\t\tif (!options.ignoreUnaccepted)\n \t\t\t\t\t\t\tabortError = new Error(\n \t\t\t\t\t\t\t\t\"Aborted because \" + moduleId + \" is not accepted\" + chainInfo\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"accepted\":\n \t\t\t\t\t\tif (options.onAccepted) options.onAccepted(result);\n \t\t\t\t\t\tdoApply = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase \"disposed\":\n \t\t\t\t\t\tif (options.onDisposed) options.onDisposed(result);\n \t\t\t\t\t\tdoDispose = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tdefault:\n \t\t\t\t\t\tthrow new Error(\"Unexception type \" + result.type);\n \t\t\t\t}\n \t\t\t\tif (abortError) {\n \t\t\t\t\thotSetStatus(\"abort\");\n \t\t\t\t\treturn Promise.reject(abortError);\n \t\t\t\t}\n \t\t\t\tif (doApply) {\n \t\t\t\t\tappliedUpdate[moduleId] = hotUpdate[moduleId];\n \t\t\t\t\taddAllToSet(outdatedModules, result.outdatedModules);\n \t\t\t\t\tfor (moduleId in result.outdatedDependencies) {\n \t\t\t\t\t\tif (\n \t\t\t\t\t\t\tObject.prototype.hasOwnProperty.call(\n \t\t\t\t\t\t\t\tresult.outdatedDependencies,\n \t\t\t\t\t\t\t\tmoduleId\n \t\t\t\t\t\t\t)\n \t\t\t\t\t\t) {\n \t\t\t\t\t\t\tif (!outdatedDependencies[moduleId])\n \t\t\t\t\t\t\t\toutdatedDependencies[moduleId] = [];\n \t\t\t\t\t\t\taddAllToSet(\n \t\t\t\t\t\t\t\toutdatedDependencies[moduleId],\n \t\t\t\t\t\t\t\tresult.outdatedDependencies[moduleId]\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (doDispose) {\n \t\t\t\t\taddAllToSet(outdatedModules, [result.moduleId]);\n \t\t\t\t\tappliedUpdate[moduleId] = warnUnexpectedRequire;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// Store self accepted outdated modules to require them later by the module system\n \t\tvar outdatedSelfAcceptedModules = [];\n \t\tfor (i = 0; i < outdatedModules.length; i++) {\n \t\t\tmoduleId = outdatedModules[i];\n \t\t\tif (\n \t\t\t\tinstalledModules[moduleId] &&\n \t\t\t\tinstalledModules[moduleId].hot._selfAccepted &&\n \t\t\t\t// removed self-accepted modules should not be required\n \t\t\t\tappliedUpdate[moduleId] !== warnUnexpectedRequire\n \t\t\t) {\n \t\t\t\toutdatedSelfAcceptedModules.push({\n \t\t\t\t\tmodule: moduleId,\n \t\t\t\t\terrorHandler: installedModules[moduleId].hot._selfAccepted\n \t\t\t\t});\n \t\t\t}\n \t\t}\n\n \t\t// Now in \"dispose\" phase\n \t\thotSetStatus(\"dispose\");\n \t\tObject.keys(hotAvailableFilesMap).forEach(function(chunkId) {\n \t\t\tif (hotAvailableFilesMap[chunkId] === false) {\n \t\t\t\thotDisposeChunk(chunkId);\n \t\t\t}\n \t\t});\n\n \t\tvar idx;\n \t\tvar queue = outdatedModules.slice();\n \t\twhile (queue.length > 0) {\n \t\t\tmoduleId = queue.pop();\n \t\t\tmodule = installedModules[moduleId];\n \t\t\tif (!module) continue;\n\n \t\t\tvar data = {};\n\n \t\t\t// Call dispose handlers\n \t\t\tvar disposeHandlers = module.hot._disposeHandlers;\n \t\t\tfor (j = 0; j < disposeHandlers.length; j++) {\n \t\t\t\tcb = disposeHandlers[j];\n \t\t\t\tcb(data);\n \t\t\t}\n \t\t\thotCurrentModuleData[moduleId] = data;\n\n \t\t\t// disable module (this disables requires from this module)\n \t\t\tmodule.hot.active = false;\n\n \t\t\t// remove module from cache\n \t\t\tdelete installedModules[moduleId];\n\n \t\t\t// when disposing there is no need to call dispose handler\n \t\t\tdelete outdatedDependencies[moduleId];\n\n \t\t\t// remove \"parents\" references from all children\n \t\t\tfor (j = 0; j < module.children.length; j++) {\n \t\t\t\tvar child = installedModules[module.children[j]];\n \t\t\t\tif (!child) continue;\n \t\t\t\tidx = child.parents.indexOf(moduleId);\n \t\t\t\tif (idx >= 0) {\n \t\t\t\t\tchild.parents.splice(idx, 1);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// remove outdated dependency from module children\n \t\tvar dependency;\n \t\tvar moduleOutdatedDependencies;\n \t\tfor (moduleId in outdatedDependencies) {\n \t\t\tif (\n \t\t\t\tObject.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)\n \t\t\t) {\n \t\t\t\tmodule = installedModules[moduleId];\n \t\t\t\tif (module) {\n \t\t\t\t\tmoduleOutdatedDependencies = outdatedDependencies[moduleId];\n \t\t\t\t\tfor (j = 0; j < moduleOutdatedDependencies.length; j++) {\n \t\t\t\t\t\tdependency = moduleOutdatedDependencies[j];\n \t\t\t\t\t\tidx = module.children.indexOf(dependency);\n \t\t\t\t\t\tif (idx >= 0) module.children.splice(idx, 1);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// Now in \"apply\" phase\n \t\thotSetStatus(\"apply\");\n\n \t\thotCurrentHash = hotUpdateNewHash;\n\n \t\t// insert new code\n \t\tfor (moduleId in appliedUpdate) {\n \t\t\tif (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) {\n \t\t\t\tmodules[moduleId] = appliedUpdate[moduleId];\n \t\t\t}\n \t\t}\n\n \t\t// call accept handlers\n \t\tvar error = null;\n \t\tfor (moduleId in outdatedDependencies) {\n \t\t\tif (\n \t\t\t\tObject.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)\n \t\t\t) {\n \t\t\t\tmodule = installedModules[moduleId];\n \t\t\t\tif (module) {\n \t\t\t\t\tmoduleOutdatedDependencies = outdatedDependencies[moduleId];\n \t\t\t\t\tvar callbacks = [];\n \t\t\t\t\tfor (i = 0; i < moduleOutdatedDependencies.length; i++) {\n \t\t\t\t\t\tdependency = moduleOutdatedDependencies[i];\n \t\t\t\t\t\tcb = module.hot._acceptedDependencies[dependency];\n \t\t\t\t\t\tif (cb) {\n \t\t\t\t\t\t\tif (callbacks.indexOf(cb) !== -1) continue;\n \t\t\t\t\t\t\tcallbacks.push(cb);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tfor (i = 0; i < callbacks.length; i++) {\n \t\t\t\t\t\tcb = callbacks[i];\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tcb(moduleOutdatedDependencies);\n \t\t\t\t\t\t} catch (err) {\n \t\t\t\t\t\t\tif (options.onErrored) {\n \t\t\t\t\t\t\t\toptions.onErrored({\n \t\t\t\t\t\t\t\t\ttype: \"accept-errored\",\n \t\t\t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\t\t\tdependencyId: moduleOutdatedDependencies[i],\n \t\t\t\t\t\t\t\t\terror: err\n \t\t\t\t\t\t\t\t});\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tif (!options.ignoreErrored) {\n \t\t\t\t\t\t\t\tif (!error) error = err;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// Load self accepted modules\n \t\tfor (i = 0; i < outdatedSelfAcceptedModules.length; i++) {\n \t\t\tvar item = outdatedSelfAcceptedModules[i];\n \t\t\tmoduleId = item.module;\n \t\t\thotCurrentParents = [moduleId];\n \t\t\ttry {\n \t\t\t\t__webpack_require__(moduleId);\n \t\t\t} catch (err) {\n \t\t\t\tif (typeof item.errorHandler === \"function\") {\n \t\t\t\t\ttry {\n \t\t\t\t\t\titem.errorHandler(err);\n \t\t\t\t\t} catch (err2) {\n \t\t\t\t\t\tif (options.onErrored) {\n \t\t\t\t\t\t\toptions.onErrored({\n \t\t\t\t\t\t\t\ttype: \"self-accept-error-handler-errored\",\n \t\t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\t\terror: err2,\n \t\t\t\t\t\t\t\toriginalError: err\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (!options.ignoreErrored) {\n \t\t\t\t\t\t\tif (!error) error = err2;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (!error) error = err;\n \t\t\t\t\t}\n \t\t\t\t} else {\n \t\t\t\t\tif (options.onErrored) {\n \t\t\t\t\t\toptions.onErrored({\n \t\t\t\t\t\t\ttype: \"self-accept-errored\",\n \t\t\t\t\t\t\tmoduleId: moduleId,\n \t\t\t\t\t\t\terror: err\n \t\t\t\t\t\t});\n \t\t\t\t\t}\n \t\t\t\t\tif (!options.ignoreErrored) {\n \t\t\t\t\t\tif (!error) error = err;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t// handle errors in accept handlers and self accepted module load\n \t\tif (error) {\n \t\t\thotSetStatus(\"fail\");\n \t\t\treturn Promise.reject(error);\n \t\t}\n\n \t\thotSetStatus(\"idle\");\n \t\treturn new Promise(function(resolve) {\n \t\t\tresolve(outdatedModules);\n \t\t});\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"static/runtime/webpack.js\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"static/chunks/\" + ({}[chunkId]||chunkId) + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {},\n \t\t\thot: hotCreateModule(moduleId),\n \t\t\tparents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),\n \t\t\tchildren: []\n \t\t};\n\n \t\t// Execute the module function\n \t\tvar threw = true;\n \t\ttry {\n \t\t\tmodules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));\n \t\t\tthrew = false;\n \t\t} finally {\n \t\t\tif(threw) delete installedModules[moduleId];\n \t\t}\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \t// __webpack_hash__\n \t__webpack_require__.h = function() { return hotCurrentHash; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /out/_next/static/webpack/3ad2843ba247d80b22cd.hot-update.json: -------------------------------------------------------------------------------- 1 | {"h":"d78c17e5974b1cd73546","c":{}} -------------------------------------------------------------------------------- /out/_next/static/webpack/d78c17e5974b1cd73546.hot-update.json: -------------------------------------------------------------------------------- 1 | {"h":"3db80471138892d3182a","c":{"static/development/pages/index.js":true}} -------------------------------------------------------------------------------- /out/_next/static/webpack/static/development/pages/index.js.d78c17e5974b1cd73546.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.d78c17e5974b1cd73546.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport Head from 'next/head'\nimport { themes } from '../s/theme_min.js'\nimport { fragment_shader, vertex_shader } from '../shaders/shaders.js'\nimport * as chroma from 'chroma-js'\n\nlet fs = 15\nlet lh = 1.5\nlet rlh = fs * lh\n\nlet theme_names = themes.map(t => t.name)\n\nlet Keycap = ({ k, fg, bg, clickKey, inline = false }) => {\n return (\n {\n clickKey(k)\n }}\n >\n {k}\n \n )\n}\n\nconsole.log('keys used:', 'asdfhlow?xjk')\n\nconst Home = ({ pick_serve }) => {\n let [pick, setPick] = useState(0)\n let [hue_shift, setHueShift] = useState(0)\n let keymap_ref = useRef({})\n let c_holder_ref = useRef(null)\n let program_ref = useRef({})\n let container_ref = useRef({})\n let [load, setLoad] = useState(false)\n let [lthresh, setLthresh] = useState(0.2)\n let [hthresh, setHthresh] = useState(0.8)\n let [show_info, setShowInfo] = useState(true)\n\n function clickKey(key) {\n let km = keymap_ref.current\n km[key] = true\n keyAction({ key }, false)\n setTimeout(() => {\n km[key] = false\n }, 0)\n }\n\n function initImage(src, first_load = false) {\n let img = new Image()\n img.onload = () => {\n setLoad(true)\n\n let w = window.innerWidth - 18 * 2\n let h = window.innerHeight - rlh\n\n let iw = img.width\n let ih = img.height\n\n let wa = w / h\n let ia = iw / ih\n\n let resize_check = false\n let rw, rh\n if (ia >= wa) {\n if (iw > w) {\n resize_check = true\n rw = w\n rh = Math.round(w / ia)\n }\n } else {\n if (ih > h) {\n resize_check = true\n rh = h\n rw = Math.round(h * ia)\n }\n }\n\n if (resize_check) {\n let confirm_check = true\n if (!first_load) {\n confirm_check = confirm(\n `The image you selected is larger (${iw}x${ih}) than the browser window. Resize it to fit (${rw}x${rh})? Choose cancel to import it at full size.`\n )\n }\n if (confirm_check) {\n img.width = rw\n img.height = rh\n }\n }\n\n let c_holder = c_holder_ref.current\n c_holder.innerHTML = ''\n\n container_ref.current.style.minWidth = img.width + 18 + 'px'\n\n let c = document.createElement('canvas')\n c.width = img.width\n c.height = img.height\n c_holder.appendChild(c)\n\n let ctx = c.getContext('webgl', { preserveDrawingBuffer: true })\n\n function compileShader(shaderSource, shaderType) {\n let shader = ctx.createShader(shaderType)\n ctx.shaderSource(shader, shaderSource)\n ctx.compileShader(shader)\n return shader\n }\n\n let program = ctx.createProgram()\n program_ref.current = program\n ctx.attachShader(program, compileShader(vertex_shader, ctx.VERTEX_SHADER))\n ctx.attachShader(\n program,\n compileShader(fragment_shader, ctx.FRAGMENT_SHADER)\n )\n ctx.linkProgram(program)\n ctx.useProgram(program)\n\n let thresh_location = ctx.getUniformLocation(program, 'u_thresh')\n ctx.uniform2f(thresh_location, lthresh, hthresh)\n\n let palette_location = ctx.getUniformLocation(program, 'u_palette')\n let picked = themes[pick]\n let hues = picked.hues.map(k =>\n chroma(k)\n .gl()\n .slice(0, 3)\n )\n let arranged = [\n chroma(picked.bg)\n .gl()\n .slice(0, 3),\n chroma(picked.fg)\n .gl()\n .slice(0, 3),\n ...hues,\n ]\n\n ctx.uniform3fv(palette_location, new Float32Array(arranged.flat()))\n\n let resolution_location = ctx.getUniformLocation(program, 'u_resolution')\n ctx.uniform2f(resolution_location, c.width, c.height)\n\n let position_location = ctx.getAttribLocation(program, 'a_position')\n let buffer = ctx.createBuffer()\n ctx.bindBuffer(ctx.ARRAY_BUFFER, buffer)\n ctx.bufferData(\n ctx.ARRAY_BUFFER,\n new Float32Array([\n 0,\n 0,\n img.width,\n 0,\n 0,\n img.height,\n 0,\n img.height,\n img.width,\n 0,\n img.width,\n img.height,\n ]),\n ctx.STATIC_DRAW\n )\n ctx.enableVertexAttribArray(position_location)\n ctx.vertexAttribPointer(position_location, 2, ctx.FLOAT, false, 0, 0)\n\n let tex_coord_location = ctx.getAttribLocation(program, 'a_texCoord')\n let tex_coord_buffer = ctx.createBuffer()\n ctx.bindBuffer(ctx.ARRAY_BUFFER, tex_coord_buffer)\n ctx.bufferData(\n ctx.ARRAY_BUFFER,\n new Float32Array([\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 1.0,\n 1.0,\n 0.0,\n 1.0,\n 1.0,\n ]),\n ctx.STATIC_DRAW\n )\n ctx.enableVertexAttribArray(tex_coord_location)\n ctx.vertexAttribPointer(tex_coord_location, 2, ctx.FLOAT, false, 0, 0)\n\n let texture = ctx.createTexture()\n ctx.bindTexture(ctx.TEXTURE_2D, texture)\n ctx.bindTexture(ctx.TEXTURE_2D, texture)\n\n ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_S, ctx.CLAMP_TO_EDGE)\n ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_T, ctx.CLAMP_TO_EDGE)\n ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MIN_FILTER, ctx.NEAREST)\n ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MAG_FILTER, ctx.NEAREST)\n ctx.texImage2D(\n ctx.TEXTURE_2D,\n 0,\n ctx.RGBA,\n ctx.RGBA,\n ctx.UNSIGNED_BYTE,\n img\n )\n\n ctx.drawArrays(ctx.TRIANGLES, 0, 6)\n }\n img.src = src\n }\n\n useEffect(() => {\n initImage('scruggs.jpg', true)\n }, [])\n\n function selectTheme(name) {\n let index = theme_names.indexOf(name)\n setPick(index)\n }\n\n function keyAction(e) {\n let key = e.key.toLowerCase()\n let repeat = e.repeat\n let keymap = keymap_ref.current\n if (key === 'o' && !repeat) {\n let input = document.createElement('input')\n input.setAttribute('type', 'file')\n input.dispatchEvent(\n new MouseEvent(`click`, {\n bubbles: true,\n cancelable: true,\n view: window,\n })\n )\n\n function handleChange(e) {\n for (const item of this.files) {\n if (item.type.indexOf('image') < 0) {\n continue\n }\n let src = URL.createObjectURL(item)\n initImage(src)\n }\n this.removeEventListener('change', handleChange)\n }\n input.addEventListener('change', handleChange)\n }\n if (key === 'w' && !repeat) {\n let link = document.createElement('a')\n\n var revokeURL = function() {\n let me = this\n requestAnimationFrame(function() {\n URL.revokeObjectURL(me.href)\n me.href = null\n })\n this.removeEventListener('click', revokeURL)\n }\n\n c_holder_ref.current.childNodes[0].toBlob(function(blob) {\n link.setAttribute(\n 'download',\n `pal-${themes[pick].name\n .replace(' ', '_')\n .toLowerCase()}-l${lthresh\n .toString()\n .replace('0.', '')}-h${hthresh\n .toString()\n .replace('0.', '')}-s${hue_shift}-${new Date()\n .toISOString()\n .slice(0, -4)\n .replace(/-/g, '')\n .replace(/:/g, '')\n .replace(/_/g, '')\n .replace(/\\./g, '')}Z.png`\n )\n link.setAttribute('href', URL.createObjectURL(blob))\n link.addEventListener('click', revokeURL)\n link.dispatchEvent(\n new MouseEvent(`click`, {\n bubbles: true,\n cancelable: true,\n view: window,\n })\n )\n })\n }\n if (key === 'x') {\n setShowInfo(false)\n }\n if (key === '?') {\n setShowInfo(prev => !prev)\n }\n\n if (keymap['j']) {\n setPick(prevState => {\n let nstate = prevState + 1\n if (nstate === themes.length) nstate = 0\n return nstate\n })\n }\n if (keymap['k']) {\n setPick(prevState => {\n let nstate = prevState - 1\n if (nstate < 0) nstate = themes.length - 1\n return nstate\n })\n }\n if (keymap['h']) {\n setHueShift(prevState => {\n let n = prevState - 1\n if (n < 0) n = themes[0].hues.length - 1\n return n\n })\n }\n if (keymap['l']) {\n setHueShift(prevState => {\n return (prevState + 1) % themes[0].hues.length\n })\n }\n if (keymap['a']) {\n setLthresh(prevState => {\n return Math.max(0, prevState - 0.0125)\n })\n }\n if (keymap['s']) {\n setLthresh(prevState => {\n return Math.min(hthresh, prevState + 0.0125)\n })\n }\n if (keymap['d']) {\n setHthresh(prevState => {\n return Math.max(lthresh, prevState - 0.0125)\n })\n }\n if (keymap['f']) {\n setHthresh(prevState => {\n return Math.min(1, prevState + 0.0125)\n })\n }\n }\n\n useEffect(() => {\n if (load) {\n let c = c_holder_ref.current.childNodes[0]\n let ctx = c.getContext('webgl', { preserveDrawingBuffer: true })\n let program = program_ref.current\n\n let thresh_location = ctx.getUniformLocation(program, 'u_thresh')\n ctx.uniform2f(thresh_location, lthresh, hthresh)\n\n let picked = themes[pick]\n let hues = picked.hues.map(k =>\n chroma(k)\n .gl()\n .slice(0, 3)\n )\n\n let hues_a = hues.slice(0, hue_shift)\n let hues_b = hues.slice(hue_shift)\n let arranged = [\n chroma(picked.bg)\n .gl()\n .slice(0, 3),\n chroma(picked.fg)\n .gl()\n .slice(0, 3),\n ...hues_b,\n ...hues_a,\n ]\n\n let palette_location = ctx.getUniformLocation(program, 'u_palette')\n ctx.uniform3fv(palette_location, new Float32Array(arranged.flat()))\n\n ctx.drawArrays(ctx.TRIANGLES, 0, 6)\n }\n }, [lthresh, hthresh, pick, hue_shift])\n\n function downHandler(e) {\n let key = e.key.toLowerCase()\n keymap_ref.current[key] = true\n keyAction(e)\n }\n\n function upHandler(e) {\n let key = e.key.toLowerCase()\n keymap_ref.current[key] = false\n }\n\n function onPaste(e) {\n e.preventDefault()\n e.stopPropagation()\n for (const item of e.clipboardData.items) {\n if (item.type.indexOf('image') < 0) {\n continue\n }\n let file = item.getAsFile()\n let src = URL.createObjectURL(file)\n initImage(src)\n }\n }\n\n function onDrag(e) {\n e.stopPropagation()\n e.preventDefault()\n e.dataTransfer.dropEffect = 'copy'\n }\n\n function onDrop(e) {\n e.preventDefault()\n e.stopPropagation()\n let file = e.dataTransfer.files[0]\n let filename = file.path ? file.path : file.name ? file.name : ''\n let src = URL.createObjectURL(file)\n initImage(src)\n }\n\n useEffect(() => {\n window.addEventListener('keydown', downHandler)\n window.addEventListener('keyup', upHandler)\n window.addEventListener('paste', onPaste, false)\n window.addEventListener('dragover', onDrag, false)\n window.addEventListener('drop', onDrop, false)\n return () => {\n window.removeEventListener('keydown', downHandler)\n window.removeEventListener('keyup', upHandler)\n window.removeEventListener('paste', onPaste)\n window.removeEventListener('dragover', onDrag, false)\n window.removeEventListener('drop', onDrop, false)\n }\n }, [lthresh, hthresh, pick])\n\n let picked = themes[pick]\n let fg = picked.fg\n let bg = picked.bg\n let sorted = [...themes.slice(pick), ...themes.slice(0, pick)]\n return (\n
\n \n Pal\n \n \n\n \n \n
\n
\n
Pal
\n
\n
\n \n
open file
\n
\n
\n \n
save png
\n
\n
\n \n
show info
\n
\n
\n
\n\n \n \n \n\n \n
\n
lothresh
\n
\n \n \n {lthresh.toFixed(4)}\n
\n \n
\n \n
\n
hithresh
\n
\n \n \n {hthresh.toFixed(4)}\n
\n \n
\n \n
\n
shue
\n
\n \n \n {hue_shift}\n
\n \n
\n \n \n\n \n
theme
\n {sorted.map((t, i) => (\n \n {\n selectTheme(t.name)\n }}\n >\n \n \n {/* resorting hues */}\n {[0, 2, 1, 5, 3, 4].map(i => {\n let k = t.hues[i]\n return (\n \n )\n })}\n \n
\n {\n selectTheme(t.name)\n }}\n >\n {t.name}\n
\n \n {i === 0 ? (\n
\n \n \n
\n ) : null}\n \n ))}\n \n\n {show_info ? (\n {\n setShowInfo(false)\n }}\n >\n {\n e.stopPropagation()\n }}\n >\n \n
Info
\n \n \n \n
\n Pal let's you apply an eight-color terminal color palette to\n an image. Use the keyboard controls to choose a theme, set\n thresholds, and cycle hues.\n
\n
\n You can load your own image by pressing{' '}\n \n , pasting, or dragging and dropping.\n
\n\n
\n You can read more about how it works and view the code{' '}\n \n on github\n \n .\n
\n \n \n \n ) : null}\n \n\n \n \n )\n}\n\nexport default Home\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA;AAcA;AACA;AACA;AAjBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBA;AACA;AACA;AACA;AACA;AAAA;AACA;AADA;AAAA;AAAA;AACA;AADA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAPA;AAAA;AAAA;AACA;AADA;AAAA;AAAA;AACA;AADA;AAAA;AAAA;AACA;AADA;AAAA;AAAA;AACA;AAWA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AAKA;AAUA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAkBA;AACA;AAEA;AACA;AACA;AACA;AAkBA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAWA;AAAA;AAAA;AACA;AADA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AAPA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAOA;AACA;AACA;AApBA;AACA;AACA;AAEA;AACA;AACA;AAHA;AAiBA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AAEA;AACA;AACA;AAHA;AAMA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AAWA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAFA;AAAA;AAAA;AACA;AADA;AAGA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAVA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AACA;AACA;AAFA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;AACA;AACA;AACA;AAJA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AACA;AACA;AAFA;AAIA;AALA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AACA;AACA;AACA;AACA;AAJA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAFA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAFA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAFA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AAJA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAJA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAJA;AAMA;AACA;AACA;AATA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AArDA;AA8DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA;AAWA;AACA;AACA;AAdA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAQA;AACA;AACA;AAXA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA;AACA;AACA;AACA;AACA;AAJA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AAJA;AADA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AALA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AACA;AAAA;AAAA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA3PA;AAAA;AAAA;AAAA;AAsSA;AACA;AACA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /out/christmasst.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/christmasst.jpeg -------------------------------------------------------------------------------- /out/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/diagram.png -------------------------------------------------------------------------------- /out/diagram2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/diagram2.png -------------------------------------------------------------------------------- /out/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/favicon.ico -------------------------------------------------------------------------------- /out/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/favicon.png -------------------------------------------------------------------------------- /out/fka.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/fka.jpg -------------------------------------------------------------------------------- /out/grant.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/grant.jpg -------------------------------------------------------------------------------- /out/grant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/grant.png -------------------------------------------------------------------------------- /out/gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/gray.png -------------------------------------------------------------------------------- /out/lion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/lion.jpg -------------------------------------------------------------------------------- /out/matrix.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/matrix.jpg -------------------------------------------------------------------------------- /out/pal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/pal.gif -------------------------------------------------------------------------------- /out/pal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/pal.png -------------------------------------------------------------------------------- /out/paristx.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/paristx.jpeg -------------------------------------------------------------------------------- /out/scruggs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/scruggs.jpg -------------------------------------------------------------------------------- /out/wick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/wick.jpg -------------------------------------------------------------------------------- /out/yyy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/out/yyy.jpg -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pal", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "export": "next export", 9 | "start": "next start", 10 | "deploy": "next build && next export && touch out/.nojekyll && touch out/CNAME && echo \"pal.constraint.systems\" >> out/CNAME && git add out/ && git commit -m \"Deploy to gh-pages\" && git subtree push --prefix out origin gh-pages" 11 | }, 12 | "dependencies": { 13 | "chroma-js": "^2.1.0", 14 | "next": "9.1.6", 15 | "react": "16.12.0", 16 | "react-dom": "16.12.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pages/_document.js: -------------------------------------------------------------------------------- 1 | import Document, { Html, Head, Main, NextScript } from 'next/document' 2 | 3 | class MyDocument extends Document { 4 | static async getInitialProps(ctx) { 5 | const initialProps = await Document.getInitialProps(ctx) 6 | return { ...initialProps } 7 | } 8 | 9 | render() { 10 | let title = 'Pal' 11 | let description = 12 | 'Apply eight-color palettes to any image. Use keyboard controls to choose a theme, set thresholds, and cycle hues.' 13 | return ( 14 | 15 | 16 | 17 | 18 | 22 | 23 | {title} 24 | 25 | 26 | 27 | 31 | 32 | 33 | 34 | 35 |
36 | 37 | 38 | 39 | ) 40 | } 41 | } 42 | 43 | export default MyDocument 44 | -------------------------------------------------------------------------------- /pages/index.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useRef, useState } from 'react' 2 | import Head from 'next/head' 3 | import { themes } from '../s/theme_min.js' 4 | import { fragment_shader, vertex_shader } from '../shaders/shaders.js' 5 | import * as chroma from 'chroma-js' 6 | 7 | let fs = 15 8 | let lh = 1.5 9 | let rlh = fs * lh 10 | 11 | let theme_names = themes.map(t => t.name) 12 | 13 | let Keycap = ({ k, fg, bg, clickKey, inline = false }) => { 14 | return ( 15 | 34 | ) 35 | } 36 | 37 | console.log('keys used:', 'asdfhlow?xjk') 38 | 39 | const Home = ({ pick_serve }) => { 40 | let [pick, setPick] = useState(0) 41 | let [hue_shift, setHueShift] = useState(0) 42 | let keymap_ref = useRef({}) 43 | let c_holder_ref = useRef(null) 44 | let program_ref = useRef({}) 45 | let container_ref = useRef({}) 46 | let [load, setLoad] = useState(false) 47 | let [lthresh, setLthresh] = useState(0.2) 48 | let [hthresh, setHthresh] = useState(0.8) 49 | let [show_info, setShowInfo] = useState(true) 50 | 51 | function clickKey(key) { 52 | let km = keymap_ref.current 53 | km[key] = true 54 | keyAction({ key }, false) 55 | setTimeout(() => { 56 | km[key] = false 57 | }, 0) 58 | } 59 | 60 | function initImage(src, first_load = false) { 61 | let img = new Image() 62 | img.onload = () => { 63 | setLoad(true) 64 | 65 | let w = window.innerWidth - 18 * 2 66 | let h = window.innerHeight - rlh 67 | 68 | let iw = img.width 69 | let ih = img.height 70 | 71 | let wa = w / h 72 | let ia = iw / ih 73 | 74 | let resize_check = false 75 | let rw, rh 76 | if (ia >= wa) { 77 | if (iw > w) { 78 | resize_check = true 79 | rw = w 80 | rh = Math.round(w / ia) 81 | } 82 | } else { 83 | if (ih > h) { 84 | resize_check = true 85 | rh = h 86 | rw = Math.round(h * ia) 87 | } 88 | } 89 | 90 | if (resize_check) { 91 | let confirm_check = true 92 | if (!first_load) { 93 | confirm_check = confirm( 94 | `The image you selected is larger (${iw}x${ih}) than the browser window. Resize it to fit (${rw}x${rh})? Choose cancel to import it at full size.` 95 | ) 96 | } 97 | if (confirm_check) { 98 | img.width = rw 99 | img.height = rh 100 | } 101 | } 102 | 103 | let c_holder = c_holder_ref.current 104 | c_holder.innerHTML = '' 105 | 106 | container_ref.current.style.minWidth = img.width + 18 + 'px' 107 | 108 | let c = document.createElement('canvas') 109 | c.width = img.width 110 | c.height = img.height 111 | c_holder.appendChild(c) 112 | 113 | let ctx = c.getContext('webgl', { preserveDrawingBuffer: true }) 114 | 115 | function compileShader(shaderSource, shaderType) { 116 | let shader = ctx.createShader(shaderType) 117 | ctx.shaderSource(shader, shaderSource) 118 | ctx.compileShader(shader) 119 | return shader 120 | } 121 | 122 | let program = ctx.createProgram() 123 | program_ref.current = program 124 | ctx.attachShader(program, compileShader(vertex_shader, ctx.VERTEX_SHADER)) 125 | ctx.attachShader( 126 | program, 127 | compileShader(fragment_shader, ctx.FRAGMENT_SHADER) 128 | ) 129 | ctx.linkProgram(program) 130 | ctx.useProgram(program) 131 | 132 | let thresh_location = ctx.getUniformLocation(program, 'u_thresh') 133 | ctx.uniform2f(thresh_location, lthresh, hthresh) 134 | 135 | let palette_location = ctx.getUniformLocation(program, 'u_palette') 136 | let picked = themes[pick] 137 | let hues = picked.hues.map(k => 138 | chroma(k) 139 | .gl() 140 | .slice(0, 3) 141 | ) 142 | let arranged = [ 143 | chroma(picked.bg) 144 | .gl() 145 | .slice(0, 3), 146 | chroma(picked.fg) 147 | .gl() 148 | .slice(0, 3), 149 | ...hues, 150 | ] 151 | 152 | ctx.uniform3fv(palette_location, new Float32Array(arranged.flat())) 153 | 154 | let resolution_location = ctx.getUniformLocation(program, 'u_resolution') 155 | ctx.uniform2f(resolution_location, c.width, c.height) 156 | 157 | let position_location = ctx.getAttribLocation(program, 'a_position') 158 | let buffer = ctx.createBuffer() 159 | ctx.bindBuffer(ctx.ARRAY_BUFFER, buffer) 160 | ctx.bufferData( 161 | ctx.ARRAY_BUFFER, 162 | new Float32Array([ 163 | 0, 164 | 0, 165 | img.width, 166 | 0, 167 | 0, 168 | img.height, 169 | 0, 170 | img.height, 171 | img.width, 172 | 0, 173 | img.width, 174 | img.height, 175 | ]), 176 | ctx.STATIC_DRAW 177 | ) 178 | ctx.enableVertexAttribArray(position_location) 179 | ctx.vertexAttribPointer(position_location, 2, ctx.FLOAT, false, 0, 0) 180 | 181 | let tex_coord_location = ctx.getAttribLocation(program, 'a_texCoord') 182 | let tex_coord_buffer = ctx.createBuffer() 183 | ctx.bindBuffer(ctx.ARRAY_BUFFER, tex_coord_buffer) 184 | ctx.bufferData( 185 | ctx.ARRAY_BUFFER, 186 | new Float32Array([ 187 | 0.0, 188 | 0.0, 189 | 1.0, 190 | 0.0, 191 | 0.0, 192 | 1.0, 193 | 0.0, 194 | 1.0, 195 | 1.0, 196 | 0.0, 197 | 1.0, 198 | 1.0, 199 | ]), 200 | ctx.STATIC_DRAW 201 | ) 202 | ctx.enableVertexAttribArray(tex_coord_location) 203 | ctx.vertexAttribPointer(tex_coord_location, 2, ctx.FLOAT, false, 0, 0) 204 | 205 | let texture = ctx.createTexture() 206 | ctx.bindTexture(ctx.TEXTURE_2D, texture) 207 | ctx.bindTexture(ctx.TEXTURE_2D, texture) 208 | 209 | ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_S, ctx.CLAMP_TO_EDGE) 210 | ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_T, ctx.CLAMP_TO_EDGE) 211 | ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MIN_FILTER, ctx.NEAREST) 212 | ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MAG_FILTER, ctx.NEAREST) 213 | ctx.texImage2D( 214 | ctx.TEXTURE_2D, 215 | 0, 216 | ctx.RGBA, 217 | ctx.RGBA, 218 | ctx.UNSIGNED_BYTE, 219 | img 220 | ) 221 | 222 | ctx.drawArrays(ctx.TRIANGLES, 0, 6) 223 | } 224 | img.src = src 225 | } 226 | 227 | useEffect(() => { 228 | initImage('scruggs.jpg', true) 229 | }, []) 230 | 231 | function selectTheme(name) { 232 | let index = theme_names.indexOf(name) 233 | setPick(index) 234 | } 235 | 236 | function keyAction(e) { 237 | let key = e.key.toLowerCase() 238 | let repeat = e.repeat 239 | let keymap = keymap_ref.current 240 | if (key === 'o' && !repeat) { 241 | let input = document.createElement('input') 242 | input.setAttribute('type', 'file') 243 | input.dispatchEvent( 244 | new MouseEvent(`click`, { 245 | bubbles: true, 246 | cancelable: true, 247 | view: window, 248 | }) 249 | ) 250 | 251 | function handleChange(e) { 252 | for (const item of this.files) { 253 | if (item.type.indexOf('image') < 0) { 254 | continue 255 | } 256 | let src = URL.createObjectURL(item) 257 | initImage(src) 258 | } 259 | this.removeEventListener('change', handleChange) 260 | } 261 | input.addEventListener('change', handleChange) 262 | } 263 | if (key === 'w' && !repeat) { 264 | let link = document.createElement('a') 265 | 266 | var revokeURL = function() { 267 | let me = this 268 | requestAnimationFrame(function() { 269 | URL.revokeObjectURL(me.href) 270 | me.href = null 271 | }) 272 | this.removeEventListener('click', revokeURL) 273 | } 274 | 275 | c_holder_ref.current.childNodes[0].toBlob(function(blob) { 276 | link.setAttribute( 277 | 'download', 278 | `pal-${themes[pick].name 279 | .replace(' ', '_') 280 | .toLowerCase()}-l${lthresh 281 | .toString() 282 | .replace('0.', '')}-h${hthresh 283 | .toString() 284 | .replace('0.', '')}-s${hue_shift}-${new Date() 285 | .toISOString() 286 | .slice(0, -4) 287 | .replace(/-/g, '') 288 | .replace(/:/g, '') 289 | .replace(/_/g, '') 290 | .replace(/\./g, '')}Z.png` 291 | ) 292 | link.setAttribute('href', URL.createObjectURL(blob)) 293 | link.addEventListener('click', revokeURL) 294 | link.dispatchEvent( 295 | new MouseEvent(`click`, { 296 | bubbles: true, 297 | cancelable: true, 298 | view: window, 299 | }) 300 | ) 301 | }) 302 | } 303 | if (key === 'x') { 304 | setShowInfo(false) 305 | } 306 | if (key === '?') { 307 | setShowInfo(prev => !prev) 308 | } 309 | 310 | if (keymap['j']) { 311 | setPick(prevState => { 312 | let nstate = prevState + 1 313 | if (nstate === themes.length) nstate = 0 314 | return nstate 315 | }) 316 | } 317 | if (keymap['k']) { 318 | setPick(prevState => { 319 | let nstate = prevState - 1 320 | if (nstate < 0) nstate = themes.length - 1 321 | return nstate 322 | }) 323 | } 324 | if (keymap['h']) { 325 | setHueShift(prevState => { 326 | let n = prevState - 1 327 | if (n < 0) n = themes[0].hues.length - 1 328 | return n 329 | }) 330 | } 331 | if (keymap['l']) { 332 | setHueShift(prevState => { 333 | return (prevState + 1) % themes[0].hues.length 334 | }) 335 | } 336 | if (keymap['a']) { 337 | setLthresh(prevState => { 338 | return Math.max(0, prevState - 0.0125) 339 | }) 340 | } 341 | if (keymap['s']) { 342 | setLthresh(prevState => { 343 | return Math.min(hthresh, prevState + 0.0125) 344 | }) 345 | } 346 | if (keymap['d']) { 347 | setHthresh(prevState => { 348 | return Math.max(lthresh, prevState - 0.0125) 349 | }) 350 | } 351 | if (keymap['f']) { 352 | setHthresh(prevState => { 353 | return Math.min(1, prevState + 0.0125) 354 | }) 355 | } 356 | } 357 | 358 | useEffect(() => { 359 | if (load) { 360 | let c = c_holder_ref.current.childNodes[0] 361 | let ctx = c.getContext('webgl', { preserveDrawingBuffer: true }) 362 | let program = program_ref.current 363 | 364 | let thresh_location = ctx.getUniformLocation(program, 'u_thresh') 365 | ctx.uniform2f(thresh_location, lthresh, hthresh) 366 | 367 | let picked = themes[pick] 368 | let hues = picked.hues.map(k => 369 | chroma(k) 370 | .gl() 371 | .slice(0, 3) 372 | ) 373 | 374 | let hues_a = hues.slice(0, hue_shift) 375 | let hues_b = hues.slice(hue_shift) 376 | let arranged = [ 377 | chroma(picked.bg) 378 | .gl() 379 | .slice(0, 3), 380 | chroma(picked.fg) 381 | .gl() 382 | .slice(0, 3), 383 | ...hues_b, 384 | ...hues_a, 385 | ] 386 | 387 | let palette_location = ctx.getUniformLocation(program, 'u_palette') 388 | ctx.uniform3fv(palette_location, new Float32Array(arranged.flat())) 389 | 390 | ctx.drawArrays(ctx.TRIANGLES, 0, 6) 391 | } 392 | }, [lthresh, hthresh, pick, hue_shift]) 393 | 394 | function downHandler(e) { 395 | let key = e.key.toLowerCase() 396 | keymap_ref.current[key] = true 397 | keyAction(e) 398 | } 399 | 400 | function upHandler(e) { 401 | let key = e.key.toLowerCase() 402 | keymap_ref.current[key] = false 403 | } 404 | 405 | function onPaste(e) { 406 | e.preventDefault() 407 | e.stopPropagation() 408 | for (const item of e.clipboardData.items) { 409 | if (item.type.indexOf('image') < 0) { 410 | continue 411 | } 412 | let file = item.getAsFile() 413 | let src = URL.createObjectURL(file) 414 | initImage(src) 415 | } 416 | } 417 | 418 | function onDrag(e) { 419 | e.stopPropagation() 420 | e.preventDefault() 421 | e.dataTransfer.dropEffect = 'copy' 422 | } 423 | 424 | function onDrop(e) { 425 | e.preventDefault() 426 | e.stopPropagation() 427 | let file = e.dataTransfer.files[0] 428 | let filename = file.path ? file.path : file.name ? file.name : '' 429 | let src = URL.createObjectURL(file) 430 | initImage(src) 431 | } 432 | 433 | useEffect(() => { 434 | window.addEventListener('keydown', downHandler) 435 | window.addEventListener('keyup', upHandler) 436 | window.addEventListener('paste', onPaste, false) 437 | window.addEventListener('dragover', onDrag, false) 438 | window.addEventListener('drop', onDrop, false) 439 | return () => { 440 | window.removeEventListener('keydown', downHandler) 441 | window.removeEventListener('keyup', upHandler) 442 | window.removeEventListener('paste', onPaste) 443 | window.removeEventListener('dragover', onDrag, false) 444 | window.removeEventListener('drop', onDrop, false) 445 | } 446 | }, [lthresh, hthresh, pick]) 447 | 448 | let picked = themes[pick] 449 | let fg = picked.fg 450 | let bg = picked.bg 451 | let sorted = [...themes.slice(pick), ...themes.slice(0, pick)] 452 | return ( 453 |
454 | 455 | Pal 456 | 457 | 458 | 459 |
466 |
474 |
475 |
476 |
Pal
477 |
478 |
479 | 480 |
open file
481 |
482 |
483 | 484 |
save png
485 |
486 |
487 | 488 |
show info
489 |
490 |
491 |
492 | 493 |
503 |
510 |
511 | 512 |
520 |
521 |
lothresh
522 |
523 | 524 |
530 | {lthresh.toFixed(4)} 531 |
532 | 533 |
534 |
535 |
536 |
hithresh
537 |
538 | 539 |
545 | {hthresh.toFixed(4)} 546 |
547 | 548 |
549 |
550 |
551 |
shue
552 |
553 | 554 |
560 | {hue_shift} 561 |
562 | 563 |
564 |
565 |
566 | 567 |
575 |
theme
576 | {sorted.map((t, i) => ( 577 |
588 |
{ 591 | selectTheme(t.name) 592 | }} 593 | > 594 |
597 |
600 | {/* resorting hues */} 601 | {[0, 2, 1, 5, 3, 4].map(i => { 602 | let k = t.hues[i] 603 | return ( 604 |
608 | ) 609 | })} 610 |
611 |
612 |
{ 620 | selectTheme(t.name) 621 | }} 622 | > 623 | {t.name} 624 |
625 |
626 | {i === 0 ? ( 627 |
628 | 629 | 630 |
631 | ) : null} 632 |
633 | ))} 634 |
635 | 636 | {show_info ? ( 637 |
{ 650 | setShowInfo(false) 651 | }} 652 | > 653 |
{ 663 | e.stopPropagation() 664 | }} 665 | > 666 |
674 |
Info
675 | 676 |
677 |
685 |
686 | Pal let's you apply an eight-color terminal color palette to 687 | an image. Use the keyboard controls to choose a theme, set 688 | thresholds, and cycle hues. 689 |
690 |
691 | You can load your own image by pressing{' '} 692 | 699 | , pasting, or dragging and dropping. 700 |
701 | 702 |
703 | You can read more about how it works and view the code{' '} 704 | 708 | on github 709 | 710 | . 711 |
712 |
713 |
714 |
715 | ) : null} 716 |
717 | 718 | 745 |
746 | ) 747 | } 748 | 749 | export default Home 750 | -------------------------------------------------------------------------------- /public/IBMPlexMono-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/IBMPlexMono-Regular.woff -------------------------------------------------------------------------------- /public/IBMPlexMono-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/IBMPlexMono-Regular.woff2 -------------------------------------------------------------------------------- /public/IBMPlexSans-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/IBMPlexSans-Regular.woff -------------------------------------------------------------------------------- /public/IBMPlexSans-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/IBMPlexSans-Regular.woff2 -------------------------------------------------------------------------------- /public/IBMPlexSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/IBMPlexSerif-Regular.woff -------------------------------------------------------------------------------- /public/IBMPlexSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/IBMPlexSerif-Regular.woff2 -------------------------------------------------------------------------------- /public/christmasst.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/christmasst.jpeg -------------------------------------------------------------------------------- /public/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/diagram.png -------------------------------------------------------------------------------- /public/diagram2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/diagram2.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/favicon.ico -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/favicon.png -------------------------------------------------------------------------------- /public/fka.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/fka.jpg -------------------------------------------------------------------------------- /public/grant.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/grant.jpg -------------------------------------------------------------------------------- /public/grant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/grant.png -------------------------------------------------------------------------------- /public/gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/gray.png -------------------------------------------------------------------------------- /public/lion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/lion.jpg -------------------------------------------------------------------------------- /public/matrix.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/matrix.jpg -------------------------------------------------------------------------------- /public/pal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/pal.gif -------------------------------------------------------------------------------- /public/pal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/pal.png -------------------------------------------------------------------------------- /public/paristx.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/paristx.jpeg -------------------------------------------------------------------------------- /public/scruggs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/scruggs.jpg -------------------------------------------------------------------------------- /public/wick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/wick.jpg -------------------------------------------------------------------------------- /public/yyy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/constraint-systems/pal/7cdc1d2006735674f419e2a8fcbbd1ef86f4246e/public/yyy.jpg -------------------------------------------------------------------------------- /s/theme_min.js: -------------------------------------------------------------------------------- 1 | export let themes = [ 2 | { 3 | name: 'Base', 4 | bg: '#000', 5 | fg: '#fff', 6 | hues: ['#ff0000', '#00ff00', '#ffff00', '#0000ff', '#ff00ff', '#00ffff'], 7 | }, 8 | { 9 | name: '3024 Day', 10 | bg: '#f7f7f7', 11 | fg: '#4a4543', 12 | hues: ['#db2d20', '#01a252', '#fded02', '#01a0e4', '#a16a94', '#b5e4f4'], 13 | }, 14 | { 15 | name: '3024 Night', 16 | bg: '#090300', 17 | fg: '#a5a2a2', 18 | hues: ['#db2d20', '#01a252', '#fded02', '#01a0e4', '#a16a94', '#b5e4f4'], 19 | }, 20 | { 21 | name: 'Aci', 22 | bg: '#0d1926', 23 | fg: '#b4e1fd', 24 | hues: ['#ff0883', '#83ff08', '#ff8308', '#0883ff', '#8308ff', '#08ff83'], 25 | }, 26 | { 27 | name: 'Aco', 28 | bg: '#1f1305', 29 | fg: '#b4e1fd', 30 | hues: ['#ff0883', '#83ff08', '#ff8308', '#0883ff', '#8308ff', '#08ff83'], 31 | }, 32 | { 33 | name: 'Adventure Time', 34 | bg: '#1f1d45', 35 | fg: '#f8dcc0', 36 | hues: ['#bd0013', '#4ab118', '#e7741e', '#0f4ac6', '#665993', '#70a598'], 37 | }, 38 | { 39 | name: 'Afterglow', 40 | bg: '#222222', 41 | fg: '#d0d0d0', 42 | hues: ['#a53c23', '#7b9246', '#d3a04d', '#6c99bb', '#9f4e85', '#7dd6cf'], 43 | }, 44 | { 45 | name: 'Alien Blood', 46 | bg: '#0f1610', 47 | fg: '#637d75', 48 | hues: ['#7f2b27', '#2f7e25', '#717f24', '#2f6a7f', '#47587f', '#327f77'], 49 | }, 50 | { 51 | name: 'Argonaut', 52 | bg: '#0e1019', 53 | fg: '#fffaf4', 54 | hues: ['#ff000f', '#8ce10b', '#ffb900', '#008df8', '#6d43a6', '#00d8eb'], 55 | }, 56 | { 57 | name: 'Arthur', 58 | bg: '#1c1c1c', 59 | fg: '#ddeedd', 60 | hues: ['#cd5c5c', '#86af80', '#e8ae5b', '#6495ed', '#deb887', '#b0c4de'], 61 | }, 62 | { 63 | name: 'Atom', 64 | bg: '#161719', 65 | fg: '#c5c8c6', 66 | hues: ['#fd5ff1', '#87c38a', '#ffd7b1', '#85befd', '#b9b6fc', '#85befd'], 67 | }, 68 | { 69 | name: 'Azu', 70 | bg: '#09111a', 71 | fg: '#d9e6f2', 72 | hues: ['#ac6d74', '#74ac6d', '#aca46d', '#6d74ac', '#a46dac', '#6daca4'], 73 | }, 74 | { 75 | name: '_bash', 76 | bg: '#292D3E', 77 | fg: '#BFC7D5', 78 | hues: ['#F07178', '#C3E88D', '#FFCB6B', '#82AAFF', '#C792EA', '#60ADEC'], 79 | }, 80 | { 81 | name: 'Belafonte Day', 82 | bg: '#d5ccba', 83 | fg: '#45373c', 84 | hues: ['#be100e', '#858162', '#eaa549', '#426a79', '#97522c', '#989a9c'], 85 | }, 86 | { 87 | name: 'Belafonte Night', 88 | bg: '#20111b', 89 | fg: '#968c83', 90 | hues: ['#be100e', '#858162', '#eaa549', '#426a79', '#97522c', '#989a9c'], 91 | }, 92 | { 93 | name: 'Bim', 94 | bg: '#012849', 95 | fg: '#a9bed8', 96 | hues: ['#f557a0', '#a9ee55', '#f5a255', '#5ea2ec', '#a957ec', '#5eeea0'], 97 | }, 98 | { 99 | name: 'Birds Of Paradise', 100 | bg: '#2a1f1d', 101 | fg: '#e0dbb7', 102 | hues: ['#be2d26', '#6ba18a', '#e99d2a', '#5a86ad', '#ac80a6', '#74a6ad'], 103 | }, 104 | { 105 | name: 'Blazer', 106 | bg: '#0d1926', 107 | fg: '#d9e6f2', 108 | hues: ['#b87a7a', '#7ab87a', '#b8b87a', '#7a7ab8', '#b87ab8', '#7ab8b8'], 109 | }, 110 | { 111 | name: 'Borland', 112 | bg: '#0000a4', 113 | fg: '#ffff4e', 114 | hues: ['#ff6c60', '#a8ff60', '#ffffb6', '#96cbfe', '#ff73fd', '#c6c5fe'], 115 | }, 116 | { 117 | name: 'Broadcast', 118 | bg: '#2b2b2b', 119 | fg: '#e6e1dc', 120 | hues: ['#da4939', '#519f50', '#ffd24a', '#6d9cbe', '#d0d0ff', '#6e9cbe'], 121 | }, 122 | { 123 | name: 'Brogrammer', 124 | bg: '#131313', 125 | fg: '#d6dbe5', 126 | hues: ['#f81118', '#2dc55e', '#ecba0f', '#2a84d2', '#4e5ab7', '#1081d6'], 127 | }, 128 | { 129 | name: 'C64', 130 | bg: '#40318d', 131 | fg: '#7869c4', 132 | hues: ['#883932', '#55a049', '#bfce72', '#40318d', '#8b3f96', '#67b6bd'], 133 | }, 134 | { 135 | name: 'Cai', 136 | bg: '#09111a', 137 | fg: '#d9e6f2', 138 | hues: ['#ca274d', '#4dca27', '#caa427', '#274dca', '#a427ca', '#27caa4'], 139 | }, 140 | { 141 | name: 'Chalkboard', 142 | bg: '#29262f', 143 | fg: '#d9e6f2', 144 | hues: ['#c37372', '#72c373', '#c2c372', '#7372c3', '#c372c2', '#72c2c3'], 145 | }, 146 | { 147 | name: 'Chalk', 148 | bg: '#2D2D2D', 149 | fg: '#D4D4D4', 150 | hues: ['#F58E8E', '#A9D3AB', '#FED37E', '#7AABD4', '#D6ADD5', '#79D4D5'], 151 | }, 152 | { 153 | name: 'Ciapre', 154 | bg: '#191c27', 155 | fg: '#aea47a', 156 | hues: ['#810009', '#48513b', '#cc8b3f', '#576d8c', '#724d7c', '#5c4f4b'], 157 | }, 158 | { 159 | name: 'Clone of Ubuntu', 160 | bg: '#300a24', 161 | fg: '#ffffff', 162 | hues: ['#CC0000', '#4E9A06', '#C4A000', '#3465A4', '#75507B', '#06989A'], 163 | }, 164 | { 165 | name: 'CLRS', 166 | bg: '#ffffff', 167 | fg: '#262626', 168 | hues: ['#f8282a', '#328a5d', '#fa701d', '#135cd0', '#9f00bd', '#33c3c1'], 169 | }, 170 | { 171 | name: 'Cobalt 2', 172 | bg: '#132738', 173 | fg: '#ffffff', 174 | hues: ['#ff0000', '#38de21', '#ffe50a', '#1460d2', '#ff005d', '#00bbbb'], 175 | }, 176 | { 177 | name: 'Cobalt Neon', 178 | bg: '#142838', 179 | fg: '#8ff586', 180 | hues: ['#ff2320', '#3ba5ff', '#e9e75c', '#8ff586', '#781aa0', '#8ff586'], 181 | }, 182 | { 183 | name: 'Colorcli', 184 | bg: '#FFFFFF', 185 | fg: '#005F87', 186 | hues: ['#D70000', '#5FAF00', '#5FAF00', '#005F87', '#D70000', '#5F5F5F'], 187 | }, 188 | { 189 | name: 'Crayon Pony Fish', 190 | bg: '#150707', 191 | fg: '#68525a', 192 | hues: ['#91002b', '#579524', '#ab311b', '#8c87b0', '#692f50', '#e8a866'], 193 | }, 194 | { 195 | name: 'Dark Pastel', 196 | bg: '#000000', 197 | fg: '#ffffff', 198 | hues: ['#ff5555', '#55ff55', '#ffff55', '#5555ff', '#ff55ff', '#55ffff'], 199 | }, 200 | { 201 | name: 'Darkside', 202 | bg: '#222324', 203 | fg: '#bababa', 204 | hues: ['#e8341c', '#68c256', '#f2d42c', '#1c98e8', '#8e69c9', '#1c98e8'], 205 | }, 206 | { 207 | name: 'Desert', 208 | bg: '#333333', 209 | fg: '#ffffff', 210 | hues: ['#ff2b2b', '#98fb98', '#f0e68c', '#cd853f', '#ffdead', '#ffa0a0'], 211 | }, 212 | { 213 | name: 'Dimmed Monokai', 214 | bg: '#1f1f1f', 215 | fg: '#b9bcba', 216 | hues: ['#be3f48', '#879a3b', '#c5a635', '#4f76a1', '#855c8d', '#578fa4'], 217 | }, 218 | { 219 | name: 'Dracula', 220 | bg: '#282a36', 221 | fg: '#94A3A5', 222 | hues: ['#ff5555', '#50fa7b', '#ffb86c', '#8be9fd', '#bd93f9', '#ff79c6'], 223 | }, 224 | { 225 | name: 'Earthsong', 226 | bg: '#292520', 227 | fg: '#e5c7a9', 228 | hues: ['#c94234', '#85c54c', '#f5ae2e', '#1398b9', '#d0633d', '#509552'], 229 | }, 230 | { 231 | name: 'Elemental', 232 | bg: '#22211d', 233 | fg: '#807a74', 234 | hues: ['#98290f', '#479a43', '#7f7111', '#497f7d', '#7f4e2f', '#387f58'], 235 | }, 236 | { 237 | name: 'Elementary', 238 | bg: '#101010', 239 | fg: '#f2f2f2', 240 | hues: ['#e1321a', '#6ab017', '#ffc005', '#004f9e', '#ec0048', '#2aa7e7'], 241 | }, 242 | { 243 | name: 'Elic', 244 | bg: '#4A453E', 245 | fg: '#f2f2f2', 246 | hues: ['#e1321a', '#6ab017', '#ffc005', '#729FCF', '#ec0048', '#f2f2f2'], 247 | }, 248 | { 249 | name: 'Elio', 250 | bg: '#041A3B', 251 | fg: '#f2f2f2', 252 | hues: ['#e1321a', '#6ab017', '#ffc005', '#729FCF', '#ec0048', '#2aa7e7'], 253 | }, 254 | { 255 | name: 'Espresso Libre', 256 | bg: '#2a211c', 257 | fg: '#b8a898', 258 | hues: ['#cc0000', '#1a921c', '#f0e53a', '#0066ff', '#c5656b', '#06989a'], 259 | }, 260 | { 261 | name: 'Espresso', 262 | bg: '#323232', 263 | fg: '#ffffff', 264 | hues: ['#d25252', '#a5c261', '#ffc66d', '#6c99bb', '#d197d9', '#bed6ff'], 265 | }, 266 | { 267 | name: 'Fishtank', 268 | bg: '#232537', 269 | fg: '#ecf0fe', 270 | hues: ['#c6004a', '#acf157', '#fecd5e', '#525fb8', '#986f82', '#968763'], 271 | }, 272 | { 273 | name: 'Flatland', 274 | bg: '#1d1f21', 275 | fg: '#b8dbef', 276 | hues: ['#f18339', '#9fd364', '#f4ef6d', '#5096be', '#695abc', '#d63865'], 277 | }, 278 | { 279 | name: 'Flat', 280 | bg: '#1F2D3A', 281 | fg: '#1abc9c', 282 | hues: ['#c0392b', '#27ae60', '#f39c12', '#2980b9', '#8e44ad', '#16a085'], 283 | }, 284 | { 285 | name: 'Foxnightly', 286 | bg: '#2A2A2E', 287 | fg: '#D7D7DB', 288 | hues: ['#B98EFF', '#FF7DE9', '#729FCF', '#66A05B', '#75507B', '#ACACAE'], 289 | }, 290 | { 291 | name: 'Freya', 292 | bg: '#252e32', 293 | fg: '#94a3a5', 294 | hues: ['#dc322f', '#859900', '#b58900', '#268bd2', '#ec0048', '#2aa198'], 295 | }, 296 | { 297 | name: 'Frontend Delight', 298 | bg: '#1b1c1d', 299 | fg: '#adadad', 300 | hues: ['#f8511b', '#565747', '#fa771d', '#2c70b7', '#f02e4f', '#3ca1a6'], 301 | }, 302 | { 303 | name: 'Frontend Fun Forrest', 304 | bg: '#251200', 305 | fg: '#dec165', 306 | hues: ['#d6262b', '#919c00', '#be8a13', '#4699a3', '#8d4331', '#da8213'], 307 | }, 308 | { 309 | name: 'Frontend Galaxy', 310 | bg: '#1d2837', 311 | fg: '#ffffff', 312 | hues: ['#f9555f', '#21b089', '#fef02a', '#589df6', '#944d95', '#1f9ee7'], 313 | }, 314 | { 315 | name: 'Github', 316 | bg: '#f4f4f4', 317 | fg: '#3e3e3e', 318 | hues: ['#970b16', '#07962a', '#f8eec7', '#003e8a', '#e94691', '#89d1ec'], 319 | }, 320 | { 321 | name: 'gooey', 322 | bg: '#0D101B', 323 | fg: '#EBEEF9', 324 | hues: ['#BB4F6C', '#72CCAE', '#C65E3D', '#58B6CA', '#6488C4', '#8D84C6'], 325 | }, 326 | { 327 | name: 'base16: Google (dark)', 328 | bg: '#1D1F21', 329 | fg: '#B4B7B4', 330 | hues: ['#CC342B', '#198844', '#FBA922', '#3971ED', '#A36AC7', '#3971ED'], 331 | }, 332 | { 333 | name: 'base16: Google (light)', 334 | bg: '#FFFFFF', 335 | fg: '#373B41', 336 | hues: ['#CC342B', '#198844', '#FBA921', '#3870ED', '#A26AC7', '#3870ED'], 337 | }, 338 | { 339 | name: 'gotham', 340 | bg: '#0a0f14', 341 | fg: '#98d1ce', 342 | hues: ['#c33027', '#26a98b', '#edb54b', '#195465', '#4e5165', '#33859d'], 343 | }, 344 | { 345 | name: 'Grape', 346 | bg: '#171423', 347 | fg: '#9f9fa1', 348 | hues: ['#ed2261', '#1fa91b', '#8ddc20', '#487df4', '#8d35c9', '#3bdeed'], 349 | }, 350 | { 351 | name: 'Grass', 352 | bg: '#13773d', 353 | fg: '#fff0a5', 354 | hues: ['#bb0000', '#00bb00', '#e7b000', '#0000a3', '#950062', '#00bbbb'], 355 | }, 356 | { 357 | name: 'Gruvbox Dark', 358 | bg: '#282828', 359 | fg: '#ebdbb2', 360 | hues: ['#cc241d', '#98971a', '#d79921', '#458588', '#b16286', '#689d6a'], 361 | }, 362 | { 363 | name: 'Gruvbox', 364 | bg: '#fbf1c7', 365 | fg: '#3c3836', 366 | hues: ['#cc241d', '#98971a', '#d79921', '#458588', '#b16286', '#689d6a'], 367 | }, 368 | { 369 | name: 'Hardcore', 370 | bg: '#121212', 371 | fg: '#a0a0a0', 372 | hues: ['#f92672', '#a6e22e', '#fd971f', '#66d9ef', '#9e6ffe', '#5e7175'], 373 | }, 374 | { 375 | name: 'Harper', 376 | bg: '#010101', 377 | fg: '#a8a49d', 378 | hues: ['#f8b63f', '#7fb5e1', '#d6da25', '#489e48', '#b296c6', '#f5bfd7'], 379 | }, 380 | { 381 | name: 'Hemisu Dark', 382 | bg: '#000000', 383 | fg: '#FFFFFF', 384 | hues: ['#FF0054', '#B1D630', '#9D895E', '#67BEE3', '#B576BC', '#569A9F'], 385 | }, 386 | { 387 | name: 'Hemisu Light', 388 | bg: '#EFEFEF', 389 | fg: '#444444', 390 | hues: ['#FF0055', '#739100', '#503D15', '#538091', '#5B345E', '#538091'], 391 | }, 392 | { 393 | name: 'Highway', 394 | bg: '#222225', 395 | fg: '#ededed', 396 | hues: ['#d00e18', '#138034', '#ffcb3e', '#006bb3', '#6b2775', '#384564'], 397 | }, 398 | { 399 | name: 'Hipster Green', 400 | bg: '#100b05', 401 | fg: '#84c138', 402 | hues: ['#b6214a', '#00a600', '#bfbf00', '#246eb2', '#b200b2', '#00a6b2'], 403 | }, 404 | { 405 | name: 'Homebrew', 406 | bg: '#000000', 407 | fg: '#00ff00', 408 | hues: ['#990000', '#00a600', '#999900', '#0000b2', '#b200b2', '#00a6b2'], 409 | }, 410 | { 411 | name: 'Hurtado', 412 | bg: '#000000', 413 | fg: '#dbdbdb', 414 | hues: ['#ff1b00', '#a5e055', '#fbe74a', '#496487', '#fd5ff1', '#86e9fe'], 415 | }, 416 | { 417 | name: 'Hybrid', 418 | bg: '#141414', 419 | fg: '#94a3a5', 420 | hues: ['#A54242', '#8C9440', '#de935f', '#5F819D', '#85678F', '#5E8D87'], 421 | }, 422 | { 423 | name: 'ibm3270', 424 | bg: '#000000', 425 | fg: '#FDFDFD', 426 | hues: ['#F01818', '#24D830', '#F0D824', '#7890F0', '#F078D8', '#54E4E4'], 427 | }, 428 | { 429 | name: 'IC Green PPL', 430 | bg: '#3a3d3f', 431 | fg: '#d9efd3', 432 | hues: ['#fb002a', '#339c24', '#659b25', '#149b45', '#53b82c', '#2cb868'], 433 | }, 434 | { 435 | name: 'IC Orange PPL', 436 | bg: '#262626', 437 | fg: '#ffcb83', 438 | hues: ['#c13900', '#a4a900', '#caaf00', '#bd6d00', '#fc5e00', '#f79500'], 439 | }, 440 | { 441 | name: 'Idle Toes', 442 | bg: '#323232', 443 | fg: '#ffffff', 444 | hues: ['#d25252', '#7fe173', '#ffc66d', '#4099ff', '#f680ff', '#bed6ff'], 445 | }, 446 | { 447 | name: 'Ir Black', 448 | bg: '#000000', 449 | fg: '#eeeeee', 450 | hues: ['#ff6c60', '#a8ff60', '#ffffb6', '#69cbfe', '#ff73Fd', '#c6c5fe'], 451 | }, 452 | { 453 | name: 'Jackie Brown', 454 | bg: '#2c1d16', 455 | fg: '#ffcc2f', 456 | hues: ['#ef5734', '#2baf2b', '#bebf00', '#246eb2', '#d05ec1', '#00acee'], 457 | }, 458 | { 459 | name: 'Japanesque', 460 | bg: '#1e1e1e', 461 | fg: '#f7f6ec', 462 | hues: ['#cf3f61', '#7bb75b', '#e9b32a', '#4c9ad4', '#a57fc4', '#389aad'], 463 | }, 464 | { 465 | name: 'Jellybeans', 466 | bg: '#121212', 467 | fg: '#dedede', 468 | hues: ['#e27373', '#94b979', '#ffba7b', '#97bedc', '#e1c0fa', '#00988e'], 469 | }, 470 | { 471 | name: 'Jup', 472 | bg: '#758480', 473 | fg: '#23476a', 474 | hues: ['#dd006f', '#6fdd00', '#dd6f00', '#006fdd', '#6f00dd', '#00dd6f'], 475 | }, 476 | { 477 | name: 'Kibble', 478 | bg: '#0e100a', 479 | fg: '#f7f7f7', 480 | hues: ['#c70031', '#29cf13', '#d8e30e', '#3449d1', '#8400ff', '#0798ab'], 481 | }, 482 | { 483 | name: 'kokuban', 484 | bg: '#0D4A08', 485 | fg: '#D8E2D7', 486 | hues: ['#D84E4C', '#95DA5A', '#D6E264', '#4B9ED7', '#945FC5', '#D89B25'], 487 | }, 488 | { 489 | name: 'Later This Evening', 490 | bg: '#222222', 491 | fg: '#959595', 492 | hues: ['#d45a60', '#afba67', '#e5d289', '#a0bad6', '#c092d6', '#91bfb7'], 493 | }, 494 | { 495 | name: 'Lavandula', 496 | bg: '#050014', 497 | fg: '#736e7d', 498 | hues: ['#7d1625', '#337e6f', '#7f6f49', '#4f4a7f', '#5a3f7f', '#58777f'], 499 | }, 500 | { 501 | name: 'Liquid Carbon', 502 | bg: '#303030', 503 | fg: '#afc2c2', 504 | hues: ['#ff3030', '#559a70', '#ccac00', '#0099cc', '#cc69c8', '#7ac4cc'], 505 | }, 506 | { 507 | name: 'Liquid Carbon Transparent', 508 | bg: '#000000', 509 | fg: '#afc2c2', 510 | hues: ['#ff3030', '#559a70', '#ccac00', '#0099cc', '#cc69c8', '#7ac4cc'], 511 | }, 512 | { 513 | name: 'Maia', 514 | bg: '#31363B', 515 | fg: '#BDC3C7', 516 | hues: ['#BA2922', '#7E807E', '#4C4F4D', '#16A085', '#43746A', '#00CCCC'], 517 | }, 518 | { 519 | name: 'Man Page', 520 | bg: '#fef49c', 521 | fg: '#000000', 522 | hues: ['#cc0000', '#00a600', '#999900', '#0000b2', '#b200b2', '#00a6b2'], 523 | }, 524 | { 525 | name: 'Mar', 526 | bg: '#ffffff', 527 | fg: '#23476a', 528 | hues: ['#b5407b', '#7bb540', '#b57b40', '#407bb5', '#7b40b5', '#40b57b'], 529 | }, 530 | { 531 | name: 'Material', 532 | bg: '#1E282C', 533 | fg: '#C3C7D1', 534 | hues: ['#EB606B', '#C3E88D', '#F7EB95', '#80CBC3', '#FF2490', '#AEDDFF'], 535 | }, 536 | { 537 | name: 'Mathias', 538 | bg: '#000000', 539 | fg: '#bbbbbb', 540 | hues: ['#e52222', '#a6e32d', '#fc951e', '#c48dff', '#fa2573', '#67d9f0'], 541 | }, 542 | { 543 | name: 'Medallion', 544 | bg: '#1d1908', 545 | fg: '#cac296', 546 | hues: ['#b64c00', '#7c8b16', '#d3bd26', '#616bb0', '#8c5a90', '#916c25'], 547 | }, 548 | { 549 | name: 'Misterioso', 550 | bg: '#2d3743', 551 | fg: '#e1e1e0', 552 | hues: ['#ff4242', '#74af68', '#ffad29', '#338f86', '#9414e6', '#23d7d7'], 553 | }, 554 | { 555 | name: 'Miu', 556 | bg: '#0d1926', 557 | fg: '#d9e6f2', 558 | hues: ['#b87a7a', '#7ab87a', '#b8b87a', '#7a7ab8', '#b87ab8', '#7ab8b8'], 559 | }, 560 | { 561 | name: 'Molokai', 562 | bg: '#1b1d1e', 563 | fg: '#BBBBBB', 564 | hues: ['#7325FA', '#23E298', '#60D4DF', '#D08010', '#FF0087', '#D0A843'], 565 | }, 566 | { 567 | name: 'Mona Lisa', 568 | bg: '#120b0d', 569 | fg: '#f7d66a', 570 | hues: ['#9b291c', '#636232', '#c36e28', '#515c5d', '#9b1d29', '#588056'], 571 | }, 572 | { 573 | name: 'mono-amber', 574 | bg: '#2B1900', 575 | fg: '#FF9400', 576 | hues: ['#FF9400', '#FF9400', '#FF9400', '#FF9400', '#FF9400', '#FF9400'], 577 | }, 578 | { 579 | name: 'mono-cyan', 580 | bg: '#00222B', 581 | fg: '#00CCFF', 582 | hues: ['#00CCFF', '#00CCFF', '#00CCFF', '#00CCFF', '#00CCFF', '#00CCFF'], 583 | }, 584 | { 585 | name: 'mono-green', 586 | bg: '#022B00', 587 | fg: '#0BFF00', 588 | hues: ['#0BFF00', '#0BFF00', '#0BFF00', '#0BFF00', '#0BFF00', '#0BFF00'], 589 | }, 590 | { 591 | name: 'Monokai Dark', 592 | bg: '#272822', 593 | fg: '#f8f8f2', 594 | hues: ['#f92672', '#a6e22e', '#f4bf75', '#66d9ef', '#ae81ff', '#2AA198'], 595 | }, 596 | { 597 | name: 'Monokai Soda', 598 | bg: '#1a1a1a', 599 | fg: '#c4c5b5', 600 | hues: ['#f4005f', '#98e024', '#fa8419', '#9d65ff', '#f4005f', '#58d1eb'], 601 | }, 602 | { 603 | name: 'mono-red', 604 | bg: '#2B0C00', 605 | fg: '#FF3600', 606 | hues: ['#FF3600', '#FF3600', '#FF3600', '#FF3600', '#FF3600', '#FF3600'], 607 | }, 608 | { 609 | name: 'mono-white', 610 | bg: '#262626', 611 | fg: '#FAFAFA', 612 | hues: ['#FAFAFA', '#FAFAFA', '#FAFAFA', '#FAFAFA', '#FAFAFA', '#FAFAFA'], 613 | }, 614 | { 615 | name: 'mono-yellow', 616 | bg: '#2B2400', 617 | fg: '#FFD300', 618 | hues: ['#FFD300', '#FFD300', '#FFD300', '#FFD300', '#FFD300', '#FFD300'], 619 | }, 620 | { 621 | name: 'N0tch2k', 622 | bg: '#222222', 623 | fg: '#a0a0a0', 624 | hues: ['#a95551', '#666666', '#a98051', '#657d3e', '#767676', '#c9c9c9'], 625 | }, 626 | { 627 | name: 'neon-night', 628 | bg: '#20242d', 629 | fg: '#C7C8FF', 630 | hues: ['#FF8E8E', '#7EFDD0', '#FCAD3F', '#69B4F9', '#DD92F6', '#8CE8ff'], 631 | }, 632 | { 633 | name: 'Neopolitan', 634 | bg: '#271f19', 635 | fg: '#ffffff', 636 | hues: ['#800000', '#61ce3c', '#fbde2d', '#253b76', '#ff0080', '#8da6ce'], 637 | }, 638 | { 639 | name: 'Nep', 640 | bg: '#758480', 641 | fg: '#23476a', 642 | hues: ['#dd6f00', '#00dd6f', '#6fdd00', '#6f00dd', '#dd006f', '#006fdd'], 643 | }, 644 | { 645 | name: 'Neutron', 646 | bg: '#1c1e22', 647 | fg: '#e6e8ef', 648 | hues: ['#b54036', '#5ab977', '#deb566', '#6a7c93', '#a4799d', '#3f94a8'], 649 | }, 650 | { 651 | name: 'Nightlion V1', 652 | bg: '#000000', 653 | fg: '#bbbbbb', 654 | hues: ['#bb0000', '#5fde8f', '#f3f167', '#276bd8', '#bb00bb', '#00dadf'], 655 | }, 656 | { 657 | name: 'Nightlion V2', 658 | bg: '#171717', 659 | fg: '#bbbbbb', 660 | hues: ['#bb0000', '#04f623', '#f3f167', '#64d0f0', '#ce6fdb', '#00dadf'], 661 | }, 662 | { 663 | name: 'Night Owl', 664 | bg: '#011627', 665 | fg: '#d6deeb', 666 | hues: ['#EF5350', '#22da6e', '#addb67', '#82aaff', '#c792ea', '#21c7a8'], 667 | }, 668 | { 669 | name: 'nighty', 670 | bg: '#2F2F2F', 671 | fg: '#DFDFDF', 672 | hues: ['#9B3E46', '#095B32', '#808020', '#1D3E6F', '#823065', '#3A7458'], 673 | }, 674 | { 675 | name: 'Nord Light', 676 | bg: '#ebeaf2', 677 | fg: '#004f7c', 678 | hues: ['#E64569', '#89D287', '#DAB752', '#439ECF', '#D961DC', '#64AAAF'], 679 | }, 680 | { 681 | name: 'Nord', 682 | bg: '#004f7c', 683 | fg: '#ebeaf2', 684 | hues: ['#E64569', '#89D287', '#DAB752', '#439ECF', '#D961DC', '#64AAAF'], 685 | }, 686 | { 687 | name: 'Novel', 688 | bg: '#dfdbc3', 689 | fg: '#3b2322', 690 | hues: ['#cc0000', '#009600', '#d06b00', '#0000cc', '#cc00cc', '#0087cc'], 691 | }, 692 | { 693 | name: 'Obsidian', 694 | bg: '#283033', 695 | fg: '#cdcdcd', 696 | hues: ['#a60001', '#00bb00', '#fecd22', '#3a9bdb', '#bb00bb', '#00bbbb'], 697 | }, 698 | { 699 | name: 'Ocean Dark', 700 | bg: '#1C1F27', 701 | fg: '#979CAC', 702 | hues: ['#AF4B57', '#AFD383', '#E5C079', '#7D90A4', '#A4799D', '#85A6A5'], 703 | }, 704 | { 705 | name: 'Oceanic Next', 706 | bg: '#121b21', 707 | fg: '#b3b8c3', 708 | hues: ['#E44754', '#89BD82', '#F7BD51', '#5486C0', '#B77EB8', '#50A5A4'], 709 | }, 710 | { 711 | name: 'Ocean', 712 | bg: '#224fbc', 713 | fg: '#ffffff', 714 | hues: ['#990000', '#00a600', '#999900', '#0000b2', '#b200b2', '#00a6b2'], 715 | }, 716 | { 717 | name: 'Ollie', 718 | bg: '#222125', 719 | fg: '#8a8dae', 720 | hues: ['#ac2e31', '#31ac61', '#ac4300', '#2d57ac', '#b08528', '#1fa6ac'], 721 | }, 722 | { 723 | name: 'One Dark', 724 | bg: '#1E2127', 725 | fg: '#5C6370', 726 | hues: ['#E06C75', '#98C379', '#D19A66', '#61AFEF', '#C678DD', '#56B6C2'], 727 | }, 728 | { 729 | name: 'One Half Black', 730 | bg: '#000000', 731 | fg: '#dcdfe4', 732 | hues: ['#e06c75', '#98c379', '#e5c07b', '#61afef', '#c678dd', '#56b6c2'], 733 | }, 734 | { 735 | name: 'One Light', 736 | bg: '#F8F8F8', 737 | fg: '#2A2B32', 738 | hues: ['#DA3E39', '#41933E', '#855504', '#315EEE', '#930092', '#0E6FAD'], 739 | }, 740 | { 741 | name: 'palenight', 742 | bg: '#292D3E', 743 | fg: '#BFC7D5', 744 | hues: ['#F07178', '#C3E88D', '#FFCB6B', '#82AAFF', '#C792EA', '#60ADEC'], 745 | }, 746 | { 747 | name: 'Pali', 748 | bg: '#232E37', 749 | fg: '#d9e6f2', 750 | hues: ['#ab8f74', '#74ab8f', '#8fab74', '#8f74ab', '#ab748f', '#748fab'], 751 | }, 752 | { 753 | name: 'PaperColor Dark', 754 | bg: '#1C1C1C', 755 | fg: '#D0D0D0', 756 | hues: ['#AF005F', '#5FAF00', '#D7AF5F', '#5FAFD7', '#808080', '#D7875F'], 757 | }, 758 | { 759 | name: 'PaperColor Light', 760 | bg: '#EEEEEE', 761 | fg: '#444444', 762 | hues: ['#AF0000', '#008700', '#5F8700', '#0087AF', '#878787', '#005F87'], 763 | }, 764 | { 765 | name: 'Paraiso Dark', 766 | bg: '#2f1e2e', 767 | fg: '#a39e9b', 768 | hues: ['#ef6155', '#48b685', '#fec418', '#06b6ef', '#815ba4', '#5bc4bf'], 769 | }, 770 | { 771 | name: 'Paul Millr', 772 | bg: '#000000', 773 | fg: '#f2f2f2', 774 | hues: ['#ff0000', '#79ff0f', '#d3bf00', '#396bd7', '#b449be', '#66ccff'], 775 | }, 776 | { 777 | name: 'Pencil Dark', 778 | bg: '#212121', 779 | fg: '#f1f1f1', 780 | hues: ['#c30771', '#10a778', '#a89c14', '#008ec4', '#523c79', '#20a5ba'], 781 | }, 782 | { 783 | name: 'Pencil Light', 784 | bg: '#f1f1f1', 785 | fg: '#424242', 786 | hues: ['#c30771', '#10a778', '#a89c14', '#008ec4', '#523c79', '#20a5ba'], 787 | }, 788 | { 789 | name: 'Peppermint', 790 | bg: '#000000', 791 | fg: '#C7C7C7', 792 | hues: ['#E64569', '#89D287', '#DAB752', '#439ECF', '#D961DC', '#64AAAF'], 793 | }, 794 | { 795 | name: 'Pnevma', 796 | bg: '#1c1c1c', 797 | fg: '#d0d0d0', 798 | hues: ['#a36666', '#90a57d', '#d7af87', '#7fa5bd', '#c79ec4', '#8adbb4'], 799 | }, 800 | { 801 | name: 'Pro', 802 | bg: '#000000', 803 | fg: '#f2f2f2', 804 | hues: ['#990000', '#00a600', '#999900', '#2009db', '#b200b2', '#00a6b2'], 805 | }, 806 | { 807 | name: 'Red Alert', 808 | bg: '#762423', 809 | fg: '#ffffff', 810 | hues: ['#d62e4e', '#71be6b', '#beb86b', '#489bee', '#e979d7', '#6bbeb8'], 811 | }, 812 | { 813 | name: 'Red Sands', 814 | bg: '#7a251e', 815 | fg: '#d7c9a7', 816 | hues: ['#ff3f00', '#00bb00', '#e7b000', '#0072ff', '#bb00bb', '#00bbbb'], 817 | }, 818 | { 819 | name: 'Relaxed', 820 | bg: '#353A44', 821 | fg: '#D9D9D9', 822 | hues: ['#BC5653', '#909D63', '#EBC17A', '#6A8799', '#B06698', '#C9DFFF'], 823 | }, 824 | { 825 | name: 'Rippedcasts', 826 | bg: '#2b2b2b', 827 | fg: '#ffffff', 828 | hues: ['#cdaf95', '#a8ff60', '#bfbb1f', '#75a5b0', '#ff73fd', '#5a647e'], 829 | }, 830 | { 831 | name: 'Royal', 832 | bg: '#100815', 833 | fg: '#514968', 834 | hues: ['#91284c', '#23801c', '#b49d27', '#6580b0', '#674d96', '#8aaabe'], 835 | }, 836 | { 837 | name: 'Sat', 838 | bg: '#758480', 839 | fg: '#23476a', 840 | hues: ['#dd0007', '#07dd00', '#ddd600', '#0007dd', '#d600dd', '#00ddd6'], 841 | }, 842 | { 843 | name: 'Seafoam Pastel', 844 | bg: '#243435', 845 | fg: '#d4e7d4', 846 | hues: ['#825d4d', '#728c62', '#ada16d', '#4d7b82', '#8a7267', '#729494'], 847 | }, 848 | { 849 | name: 'Sea Shells', 850 | bg: '#09141b', 851 | fg: '#deb88d', 852 | hues: ['#d15123', '#027c9b', '#fca02f', '#1e4950', '#68d4f1', '#50a3b5'], 853 | }, 854 | { 855 | name: 'Seti', 856 | bg: '#111213', 857 | fg: '#cacecd', 858 | hues: ['#c22832', '#8ec43d', '#e0c64f', '#43a5d5', '#8b57b5', '#8ec43d'], 859 | }, 860 | { 861 | name: 'Shaman', 862 | bg: '#001015', 863 | fg: '#405555', 864 | hues: ['#b2302d', '#00a941', '#5e8baa', '#449a86', '#00599d', '#5d7e19'], 865 | }, 866 | { 867 | name: 'Shel', 868 | bg: '#2a201f', 869 | fg: '#4882cd', 870 | hues: ['#ab2463', '#6ca323', '#ab6423', '#2c64a2', '#6c24a2', '#2ca363'], 871 | }, 872 | { 873 | name: 'Slate', 874 | bg: '#222222', 875 | fg: '#35b1d2', 876 | hues: ['#e2a8bf', '#81d778', '#c4c9c0', '#264b49', '#a481d3', '#15ab9c'], 877 | }, 878 | { 879 | name: 'Smyck', 880 | bg: '#242424', 881 | fg: '#F7F7F7', 882 | hues: ['#C75646', '#8EB33B', '#D0B03C', '#72B3CC', '#C8A0D1', '#218693'], 883 | }, 884 | { 885 | name: 'Snazzy', 886 | bg: '#282a36', 887 | fg: '#eff0eb', 888 | hues: ['#FF5C57', '#5AF78E', '#F3F99D', '#57C7FF', '#FF6AC1', '#9AEDFE'], 889 | }, 890 | { 891 | name: 'Soft Server', 892 | bg: '#242626', 893 | fg: '#99a3a2', 894 | hues: ['#a2686a', '#9aa56a', '#a3906a', '#6b8fa3', '#6a71a3', '#6ba58f'], 895 | }, 896 | { 897 | name: 'Solarized Darcula', 898 | bg: '#3d3f41', 899 | fg: '#d2d8d9', 900 | hues: ['#f24840', '#629655', '#b68800', '#2075c7', '#797fd4', '#15968d'], 901 | }, 902 | { 903 | name: 'Solarized Dark Higher Contrast', 904 | bg: '#001e27', 905 | fg: '#9cc2c3', 906 | hues: ['#d11c24', '#6cbe6c', '#a57706', '#2176c7', '#c61c6f', '#259286'], 907 | }, 908 | { 909 | name: 'Solarized Dark', 910 | bg: '#002B36', 911 | fg: '#839496', 912 | hues: ['#DC322F', '#859900', '#CF9A6B', '#268BD2', '#D33682', '#2AA198'], 913 | }, 914 | { 915 | name: 'Solarized Light', 916 | bg: '#FDF6E3', 917 | fg: '#657B83', 918 | hues: ['#DC322F', '#859900', '#B58900', '#268BD2', '#D33682', '#2AA198'], 919 | }, 920 | { 921 | name: 'Spacedust', 922 | bg: '#0a1e24', 923 | fg: '#ecf0c1', 924 | hues: ['#e35b00', '#5cab96', '#e3cd7b', '#0f548b', '#e35b00', '#06afc7'], 925 | }, 926 | { 927 | name: 'SpaceGray Eighties Dull', 928 | bg: '#222222', 929 | fg: '#c9c6bc', 930 | hues: ['#b24a56', '#92b477', '#c6735a', '#7c8fa5', '#a5789e', '#80cdcb'], 931 | }, 932 | { 933 | name: 'SpaceGray Eighties', 934 | bg: '#222222', 935 | fg: '#bdbaae', 936 | hues: ['#ec5f67', '#81a764', '#fec254', '#5486c0', '#bf83c1', '#57c2c1'], 937 | }, 938 | { 939 | name: 'SpaceGray', 940 | bg: '#20242d', 941 | fg: '#b3b8c3', 942 | hues: ['#b04b57', '#87b379', '#e5c179', '#7d8fa4', '#a47996', '#85a7a5'], 943 | }, 944 | { 945 | name: 'Spring', 946 | bg: '#0a1e24', 947 | fg: '#ecf0c1', 948 | hues: ['#ff4d83', '#1f8c3b', '#1fc95b', '#1dd3ee', '#8959a8', '#3e999f'], 949 | }, 950 | { 951 | name: 'Square', 952 | bg: '#0a1e24', 953 | fg: '#e2e2e2', 954 | hues: ['#e9897c', '#b6377d', '#ecebbe', '#a9cdeb', '#75507b', '#c9caec'], 955 | }, 956 | { 957 | name: 'Srcery', 958 | bg: '#282828', 959 | fg: '#ebdbb2', 960 | hues: ['#FF3128', '#519F50', '#FBB829', '#5573A3', '#E02C6D', '#0AAEB3'], 961 | }, 962 | { 963 | name: 'Sundried', 964 | bg: '#1a1818', 965 | fg: '#c9c9c9', 966 | hues: ['#a7463d', '#587744', '#9d602a', '#485b98', '#864651', '#9c814f'], 967 | }, 968 | { 969 | name: 'Symphonic', 970 | bg: '#000000', 971 | fg: '#ffffff', 972 | hues: ['#dc322f', '#56db3a', '#ff8400', '#0084d4', '#b729d9', '#ccccff'], 973 | }, 974 | { 975 | name: 'Teerb', 976 | bg: '#262626', 977 | fg: '#d0d0d0', 978 | hues: ['#d68686', '#aed686', '#d7af87', '#86aed6', '#d6aed6', '#8adbb4'], 979 | }, 980 | { 981 | name: 'Terminal Basic', 982 | bg: '#ffffff', 983 | fg: '#000000', 984 | hues: ['#990000', '#00a600', '#999900', '#0000b2', '#b200b2', '#00a6b2'], 985 | }, 986 | { 987 | name: 'Terminix Dark', 988 | bg: '#091116', 989 | fg: '#868A8C', 990 | hues: ['#a54242', '#a1b56c', '#de935f', '#225555', '#85678f', '#5e8d87'], 991 | }, 992 | { 993 | name: 'Thayer Bright', 994 | bg: '#1b1d1e', 995 | fg: '#f8f8f8', 996 | hues: ['#f92672', '#4df840', '#f4fd22', '#2757d6', '#8c54fe', '#38c8b5'], 997 | }, 998 | { 999 | name: 'Tin', 1000 | bg: '#2e2e35', 1001 | fg: '#ffffff', 1002 | hues: ['#8d534e', '#4e8d53', '#888d4e', '#534e8d', '#8d4e88', '#4e888d'], 1003 | }, 1004 | { 1005 | name: 'Tomorrow Night Blue', 1006 | bg: '#002451', 1007 | fg: '#FFFEFE', 1008 | hues: ['#FF9DA3', '#D1F1A9', '#FFEEAD', '#BBDAFF', '#EBBBFF', '#99FFFF'], 1009 | }, 1010 | { 1011 | name: 'Tomorrow Night Bright', 1012 | bg: '#000000', 1013 | fg: '#E9E9E9', 1014 | hues: ['#D54E53', '#B9CA49', '#E7C547', '#79A6DA', '#C397D8', '#70C0B1'], 1015 | }, 1016 | { 1017 | name: 'Tomorrow Night Eighties', 1018 | bg: '#2C2C2C', 1019 | fg: '#CCCCCC', 1020 | hues: ['#F27779', '#99CC99', '#FFCC66', '#6699CC', '#CC99CC', '#66CCCC'], 1021 | }, 1022 | { 1023 | name: 'Tomorrow Night', 1024 | bg: '#1D1F21', 1025 | fg: '#C5C8C6', 1026 | hues: ['#CC6666', '#B5BD68', '#F0C674', '#81A2BE', '#B293BB', '#8ABEB7'], 1027 | }, 1028 | { 1029 | name: 'Tomorrow', 1030 | bg: '#FFFFFF', 1031 | fg: '#4D4D4C', 1032 | hues: ['#C82828', '#718C00', '#EAB700', '#4171AE', '#8959A8', '#3E999F'], 1033 | }, 1034 | { 1035 | name: 'Toy Chest', 1036 | bg: '#24364b', 1037 | fg: '#31d07b', 1038 | hues: ['#be2d26', '#1a9172', '#db8e27', '#325d96', '#8a5edc', '#35a08f'], 1039 | }, 1040 | { 1041 | name: 'Treehouse', 1042 | bg: '#191919', 1043 | fg: '#786b53', 1044 | hues: ['#b2270e', '#44a900', '#aa820c', '#58859a', '#97363d', '#b25a1e'], 1045 | }, 1046 | { 1047 | name: 'Twilight', 1048 | bg: '#141414', 1049 | fg: '#ffffd4', 1050 | hues: ['#c06d44', '#afb97a', '#c2a86c', '#44474a', '#b4be7c', '#778385'], 1051 | }, 1052 | { 1053 | name: 'Ura', 1054 | bg: '#feffee', 1055 | fg: '#23476a', 1056 | hues: ['#c21b6f', '#6fc21b', '#c26f1b', '#1b6fc2', '#6f1bc2', '#1bc26f'], 1057 | }, 1058 | { 1059 | name: 'Urple', 1060 | bg: '#1b1b23', 1061 | fg: '#877a9b', 1062 | hues: ['#b0425b', '#37a415', '#ad5c42', '#564d9b', '#6c3ca1', '#808080'], 1063 | }, 1064 | { 1065 | name: 'Vag', 1066 | bg: '#191f1d', 1067 | fg: '#d9e6f2', 1068 | hues: ['#a87139', '#39a871', '#71a839', '#7139a8', '#a83971', '#3971a8'], 1069 | }, 1070 | { 1071 | name: 'Vaughn', 1072 | bg: '#25234f', 1073 | fg: '#dcdccc', 1074 | hues: ['#705050', '#60b48a', '#dfaf8f', '#5555ff', '#f08cc3', '#8cd0d3'], 1075 | }, 1076 | { 1077 | name: 'Vibrant Ink', 1078 | bg: '#000000', 1079 | fg: '#ffffff', 1080 | hues: ['#ff6600', '#ccff04', '#ffcc00', '#44b4cc', '#9933cc', '#44b4cc'], 1081 | }, 1082 | { 1083 | name: 'VS Code Dark+', 1084 | bg: '#1E1E1E', 1085 | fg: '#CCCCCC', 1086 | hues: ['#E9653B', '#39E9A8', '#E5B684', '#44AAE6', '#E17599', '#3DD5E7'], 1087 | }, 1088 | { 1089 | name: 'Warm Neon', 1090 | bg: '#404040', 1091 | fg: '#afdab6', 1092 | hues: ['#e24346', '#39b13a', '#dae145', '#4261c5', '#f920fb', '#2abbd4'], 1093 | }, 1094 | { 1095 | name: 'Wez', 1096 | bg: '#000000', 1097 | fg: '#b3b3b3', 1098 | hues: ['#cc5555', '#55cc55', '#cdcd55', '#5555cc', '#cc55cc', '#7acaca'], 1099 | }, 1100 | { 1101 | name: 'Wild Cherry', 1102 | bg: '#1f1726', 1103 | fg: '#dafaff', 1104 | hues: ['#d94085', '#2ab250', '#ffd16f', '#883cdc', '#ececec', '#c1b8b7'], 1105 | }, 1106 | { 1107 | name: 'Wombat', 1108 | bg: '#171717', 1109 | fg: '#dedacf', 1110 | hues: ['#ff615a', '#b1e969', '#ebd99c', '#5da9f6', '#e86aff', '#82fff7'], 1111 | }, 1112 | { 1113 | name: 'Wryan', 1114 | bg: '#101010', 1115 | fg: '#999993', 1116 | hues: ['#8c4665', '#287373', '#7c7c99', '#395573', '#5e468c', '#31658c'], 1117 | }, 1118 | { 1119 | name: 'Zenburn', 1120 | bg: '#3f3f3f', 1121 | fg: '#dcdccc', 1122 | hues: ['#705050', '#60b48a', '#f0dfaf', '#506070', '#dc8cc3', '#8cd0d3'], 1123 | }, 1124 | ] 1125 | -------------------------------------------------------------------------------- /scripts/data_clean.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const fs = require('fs') 4 | const themes = require('../s/themes.js') 5 | 6 | let converted = themes.map(o => { 7 | return { 8 | name: o.PROFILE_NAME, 9 | bg: o.BACKGROUND_COLOR, 10 | fg: o.FOREGROUND_COLOR, 11 | hues: [ 12 | o.COLOR_02, 13 | o.COLOR_03, 14 | o.COLOR_04, 15 | o.COLOR_05, 16 | o.COLOR_06, 17 | o.COLOR_07, 18 | ], 19 | } 20 | }) 21 | 22 | fs.writeFileSync( 23 | '../s/theme_min.js', 24 | 'export let themes = ' + JSON.stringify(converted) 25 | ) 26 | -------------------------------------------------------------------------------- /shaders/shaders.js: -------------------------------------------------------------------------------- 1 | export let vertex_shader = `attribute vec2 a_position; 2 | attribute vec2 a_texCoord; 3 | varying vec2 v_texCoord; 4 | uniform vec2 u_resolution; 5 | 6 | void main() { 7 | vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; // convert the rectangle from pixels to clipspace 8 | gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); 9 | v_texCoord = a_texCoord; // pass the texCoord to the fragment shader 10 | }` 11 | 12 | export let fragment_shader = `precision mediump float; 13 | uniform sampler2D u_image; 14 | uniform vec2 u_thresh; 15 | uniform vec3 u_palette[8]; 16 | varying vec2 v_texCoord; 17 | vec3 rgb2hsv(vec3 c) { 18 | vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 19 | vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); 20 | vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); 21 | float d = q.x - min(q.w, q.y); 22 | float e = 1.0e-10; 23 | return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 24 | } 25 | void main() { 26 | vec4 color = texture2D(u_image, v_texCoord); 27 | vec3 hsv = rgb2hsv(color.rgb); 28 | float lum = dot(color.rgb, vec3(0.2125, 0.7154, 0.0721)); 29 | float bg = dot(color.rgb, u_palette[0]); 30 | float fg = dot(color.rgb, u_palette[1]); 31 | vec3 hued = vec3(1.0, 1.0, 1.0); 32 | if (lum <= u_thresh[0]) { 33 | if (bg <= fg) { 34 | hued = u_palette[0]; 35 | } else { 36 | hued = u_palette[1]; 37 | } 38 | } else if (lum >= u_thresh[1]) { 39 | if (bg <= fg) { 40 | hued = u_palette[1]; 41 | } else { 42 | hued = u_palette[0]; 43 | } 44 | } else if (color.r == color.g && color.g == color.b) { 45 | if (lum >= 0.5) { 46 | if (bg <= fg) { 47 | hued = u_palette[0]; 48 | } else { 49 | hued = u_palette[1]; 50 | } 51 | } else { 52 | if (bg <= fg) { 53 | hued = u_palette[1]; 54 | } else { 55 | hued = u_palette[0]; 56 | } 57 | } 58 | } else { 59 | if (hsv[0] <= 0.0833) { 60 | hued = u_palette[2]; 61 | } else if (hsv[0] <= 0.25) { 62 | hued = u_palette[4]; 63 | } else if (hsv[0] <= 0.4166) { 64 | hued = u_palette[3]; 65 | } else if (hsv[0] <= 0.5833) { 66 | hued = u_palette[7]; 67 | } else if (hsv[0] <= 0.75) { 68 | hued = u_palette[5]; 69 | } else if (hsv[0] <= 0.9166) { 70 | hued = u_palette[6]; 71 | } else { 72 | hued = u_palette[2]; 73 | } 74 | } 75 | gl_FragColor = vec4(hued, 1.0); 76 | }` 77 | --------------------------------------------------------------------------------