text: !function(e){var n={};function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)t.d(r,a,function(n){return e[n]}.bind(null,a));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/dist/",t(t.s=8)}([function(e,n){e.exports=require("react")},function(e,n){e.exports=require("styled-components")},function(e,n){e.exports=require("react-icons/fa")},function(e,n){e.exports=require("express")},function(e,n){e.exports=require("path")},function(e,n){e.exports=require("react-dom/server")},function(e,n,t){},function(e,n){e.exports=require("fs")},function(e,n,t){"use strict";t.r(n);var r=t(3),a=t.n(r),i=t(0),o=t.n(i),c=t(5),l=t.n(c),u=t(1),f=t.n(u),s=(t(6),t(2));function d(e,n){var t=Object.keys(e);return Object.getOwnPropertySymbols&&t.push.apply(t,Object.getOwnPropertySymbols(e)),n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t}function p(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(t,!0).forEach(function(n){m(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function m(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g(e){return function(e){if(Array.isArray(e)){for(var n=0,t=new Array(e.length);n<e.length;n++)t[n]=e[n];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function v(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=[],r=!0,a=!1,i=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(t.push(o.value),!n||t.length!==n);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw i}}return t}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(){var e=E(["\n    display: flex;\n    flex-direction: column;\n    justify-content: center;\n    align-items: center;\n    color: ",";\n    background: ",";\n    border: 1px solid #d7d7d7;\n    padding: 5px;\n    height: 20px;\n    width: 20px;\n    border-radius: 2px;\n    cursor: pointer;\n"]);return b=function(){return e},e}function h(){var e=E(["\n    display: flex;\n    padding: 5px;\n    border: 1px solid #d7d7d7;\n    border-radius: 2px;\n    width: 30px;\n    height: 30px;\n    justify-content: center;\n    align-items: center;\n"]);return h=function(){return e},e}function y(){var e=E(["\n    display: flex;\n    flex-direction: row;\n    justify-content: space-between;\n    padding: 10px;\n    background: #fff;\n    border-bottom: 1px solid #d7d7d7;\n    &:last-child {\n        border-bottom: none;\n    }\n"]);return y=function(){return e},e}function x(){var e=E(["\n    width: 100%;\n    border: none;\n    background: #fff;\n    height: 40px;\n    padding: 10px;\n    border-bottom: ",";\n"]);return x=function(){return e},e}function w(){var e=E(["\n    display: flex;\n    flex-direction: column;\n    font-size: 16px;\n    background-color: #909090;\n    color: #fff;\n    height: 50px;\n    padding: 10px;\n    font-weight: 600;\n"]);return w=function(){return e},e}function O(){var e=E(["\n    display: flex;\n    flex-direction: column;\n    width: 300px;\n    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);\n"]);return O=function(){return e},e}function E(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var j=f.a.div(O()),S=f.a.div(w()),C=f.a.input(x(),function(e){return e.showDivider&&"1px solid #d7d7d7"}),F=f.a.div(y()),N=f.a.div(h()),P=f.a.div(b(),function(e){return e.active?"#fff":"#909090"},function(e){return e.active?"#909090":"#fff"}),k=function(){var e=v(Object(i.useState)([]),2),n=e[0],t=e[1],r=v(Object(i.useState)(""),2),a=r[0],c=r[1],l=v(Object(i.useState)(1),2),u=l[0],f=l[1],d=v(Object(i.useState)(Math.ceil(n.length/2)||1),2),m=d[0],b=d[1],h=function(e){return t(n.map(function(n){return n.id===e.id?p({},n,{isFav:!n.isFav}):n}))},y=function(e){return t(n.map(function(n){return n.id===e.id?p({},n,{sex:"M"===n.sex?"F":"M"}):n}))},x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+"-"+(new Date).getTime()},w=function(e){return[(u-1)*e,u*e]};return o.a.createElement("div",{className:"max-width-container fcol center margin-t-50"},console.log(m),o.a.createElement(j,null,o.a.createElement(S,null,"The FriendList"),o.a.createElement(C,{showDivider:!!n.length,placeholder:"Type the name of a friend",value:a,onChange:function(e){return c(e.target.value)},onKeyDown:function(e){var r;"Enter"===e.key&&e.target.value.length&&(r=e.target.value.trim(),t([{id:x("friend"),name:r,isFav:!1,mutual:"xx",sex:"M"}].concat(g(n))),c(""),b(Math.ceil((n.length+1)/2)||1))}}),!!n.length&&n.slice.apply(n,g(w(2))).map(function(e,r){return o.a.createElement(F,{key:r},o.a.createElement("div",{className:"detail fcol"},o.a.createElement("span",{className:"regular text-bold"},e.name),o.a.createElement("div",{className:"frow"},o.a.createElement(P,{active:"M"===e.sex,onClick:function(){return y(e)}},"M"),o.a.createElement(P,{active:"F"===e.sex,onClick:function(){return y(e)}},"F")),o.a.createElement("span",{className:"small margin-t-5"},e.mutual+" friends in common")),o.a.createElement("div",{className:"actions frow align-items"},o.a.createElement(N,{className:"margin-r-5"},e.isFav?o.a.createElement(s.FaStar,{className:"regular solid pointer",onClick:function(){return h(e)}}):o.a.createElement(s.FaRegStar,{className:"regular solid pointer",onClick:function(){return h(e)}})),o.a.createElement(N,null,o.a.createElement(s.FaTrashAlt,{className:"regular solid pointer",onClick:function(){var r;r=e,t(n.filter(function(e){return e.id!==r.id})),n.slice.apply(n,g(w(2))).length-1||(b(m-1||1),f(u-1||1))}}))))})),o.a.createElement("div",{className:"margin-t-5 frow center",style:{width:"300px"}},u>1?o.a.createElement(s.FaChevronCircleLeft,{className:"regular pointer margin-r-5",onClick:function(){return f(u-1)}}):o.a.createElement(s.FaChevronCircleLeft,{className:"regular margin-r-5 light-gray"}),o.a.createElement("span",{className:"small"},u,"/",m),n.length>2&&u<m?o.a.createElement(s.FaChevronCircleRight,{className:"regular pointer margin-l-5",onClick:function(){return f(u+1)}}):o.a.createElement(s.FaChevronCircleRight,{className:"regular light-gray margin-l-5"})))},M=function(){return o.a.createElement("div",null,o.a.createElement(k,null))},T=t(4),A=t(7),D=t(4),q=a()();q.get("/",function(e,n,t){var r=new u.ServerStyleSheet,a=T.resolve("dist/index.html");A.readFile(a,"utf8",function(e,t){if(e)return console.error("err",e),n.status(404).end();var a=l.a.renderToString(o.a.createElement(M,null)),i=r.getStyleTags();return n.send(t.replace('<div id="root"></div>','<div id="root">'.concat(a,"</div>").concat(i)))})}),q.use(a.a.static(D.resolve("dist"))),q.listen(3e3,function(e){if(e)return console.log("Could not start the app",e);console.log("Listening on 3000...")})}]);