text: (this.webpackJsonpfront=this.webpackJsonpfront||[]).push([[0],{12:function(e,a,t){e.exports=t.p+"static/media/icuymaslogo.4e9241e7.png"},24:function(e,a){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAJ80lEQVRo3r1ZaVBUVxZ+lj+marakUjVVM6n8mkpNzZLf82emUqlRURhFRVZTg4JsQrMoS5jCCC5xKdzXcUlcJ7JINICYMprSjJoxIIrs+9LQ0E3TdAMSlm7OfOf2ez00NPAeaF7VV+/1e/fd933nnnvuuaeltrZmaSpaW5uk7u5OqaenS+rq0ouzwdApdXa2S3p9m9TR0SquGXyN9m/j2h/vpBsM+is4l+KdNqAXMAMduF/e1dWRD2zHdQj6eRfnxdxfe3uL6Efpl7/H30dbF4/W1maprq5Gqq+vdYO0AAG/AELwkVw8bwd+AEaBccABTAAkY0K+Ny634bY9+EYR+oqGgLd/TAFv6PXtad3dXbVGo2EQGJtEVCtY0BC+pUffByDkndcqANcRuF+J3wMLID0TXqLvJrhVBs4/faUCYO3fwdI5+N33GohPhQ34Bt9//1UJ8IGAxwt0lfmgBqMRtiABIB2Mc818COA9FxYgogtIVi2AwxlDFhAEAfVaSeMdslh6qb/f7EJfn4nMZiP19vaIMz/ndmr6RDsOxUktLU2eBTQ3N7jQ1FQvzhDhw0OohTgTGxqyks3WRxh6Qh8EoxCiimjDIlgMt9M6KhBhQPTbWFtbPV0Ak1bQ0MA3a/6E5t9psBBIW4RVnz0ro5ycf9OJE8foyJGDdPjwATp+/AidOXOKLl78lC5fvkCffXZO3Cst/S+ZTN2qRoLbQHQjOHoxz8bG/8NNQF1d9SJYLgcvOObqmK3ILjEw0E8YWrpy5SJlZX1M8fFxtHlzlBvi4mJIp9sswL8jI8PpwYNvxKiwCLWGQlR6CJ6/muw1LvKNjXXs++FoOKyGvOLLbMn9+/cKYtHREZSYqKOtWxPdsGVLAiUlxQvEx8dSQkIsPX78HyGejaBWAGDHap2tuLoQoFzAfd4Cs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YgI+N8AeZ1GzEWMhMFleg9IH5M4a2ppCQoMv4G+pdzDfebL06AbduFUpxcZsllALfi46OuoCPWfDhYXzYoca6M2AC77MxrJs2hRempqa8HxMTLZ0/f1Z6LQJiY2OkmJgoKTExQYqP172Hj2VFRkY8lYWM4DwOMg4mJsNFlIHnLNaOEDyK9sMhIcHVOl3sUdSY/oKi2KKkpCQJxvlxBOh0cRLI8/XPt23L+BsEpWJR+jww0L88KCigEYTZ1cwyejBJW0D4OdrcCAvbuA3vr/roo9Q3U1K2SsnJW6SEBJ00HwH/Azst0qNerB/CAAAAAElFTkSuQmCC"},27:function(e,a,t){e.exports=t.p+"static/media/libreta.2b657359.png"},28:function(e,a,t){e.exports=t(40)},33:function(e,a,t){},40:function(e,a,t){"use strict";t.r(a);var n=t(1),r=t.n(n),l=t(22),c=t.n(l),s=t(3),i=t(7),o=t(8),m=(t(33),t(14));var u=function(){console.log("login");var e=Object(n.useState)(!0),a=Object(s.a)(e,2),t=a[0],l=a[1];return t?r.a.createElement("div",{className:"wrapper vh-100 Login"},r.a.createElement("div",{className:"box"},r.a.createElement("p",{className:"title"},"Iniciar Sesi\xf3n"),r.a.createElement("form",{action:"/auth/login",method:"post"},r.a.createElement("div",{className:"inputBox"},r.a.createElement("input",{type:"email",name:"username",required:!0}),r.a.createElement("label",null,"Email")),r.a.createElement("div",{className:"inputBox"},r.a.createElement("input",{type:"password",name:"password",required:!0}),r.a.createElement("label",null,"Contrase\xf1a")),r.a.createElement("button",{className:"btn btn-primary centrado-h submit",type:"submit"},"Ingresar"),r.a.createElement("button",{onClick:function(){return window.location.href="/auth/google"},className:"btn btn-light centrado-h google"},r.a.createElement(m.a,null)," Ingresa con Google")),r.a.createElement("div",{className:"text-light"},"\xbfNo tienes una cuenta?",r.a.createElement("button",{className:"btn btn-link btn-secondary",onClick:function(){return l(!1)}},"Registrate")))):r.a.createElement("div",{className:"wrapper vh-100 Login"},r.a.createElement("div",{className:"box"},r.a.createElement("p",{className:"title"},"Registrarse"),r.a.createElement("form",{action:"/users",method:"post"},r.a.createElement("div",{className:"inputBox"},r.a.createElement("input",{type:"text",name:"name",required:!0}),r.a.createElement("label",null,"Nombre")),r.a.createElement("div",{className:"inputBox"},r.a.createElement("input",{type:"email",name:"email",required:!0}),r.a.createElement("label",null,"Email")),r.a.createElement("div",{className:"inputBox"},r.a.createElement("input",{type:"password",name:"password",required:!0}),r.a.createElement("label",null,"Contrase\xf1a")),r.a.createElement("button",{onClick:function(){return window.location.replace(!1)},className:"btn btn-primary centrado-h submit",type:"submit"},"Registrarse"),r.a.createElement("button",{onClick:function(){return window.location.href="/auth/google"},className:"btn btn-light centrado-h google"},r.a.createElement(m.a,null)," Ingresa con Google")),r.a.createElement("div",{className:"text-light"},"\xbfYa tienes una cuenta?",r.a.createElement("button",{className:"btn btn-link btn-secondary",onClick:function(){return l(!0)}},"Ingresa"))))},d=t(19),E=t(15),p=t(23),h=function(e){var a=Object(n.useState)([]),t=Object(s.a)(a,2),l=t[0],c=t[1],i=Object(n.useState)([]),o=Object(s.a)(i,2),m=o[0],u=o[1],h=Object(n.useState)([]),b=Object(s.a)(h,2),v=b[0],f=b[1],g=Object(n.useState)(0),N=Object(s.a)(g,2),w=N[0],y=N[1],A=Object(n.useState)({}),j=Object(s.a)(A,2),O=j[0],x=j[1],C=[{title:"Salud",codigos:[1,2,3],subareas:["Espiritual","Fisica","Alimentacion"]},{title:"Relaciones",codigos:[4,5,6],subareas:["Yo","Nosotros","Familia"]},{title:"Trabajo",codigos:[7,8,9],subareas:["Aprendizaje","Proyectos Alternos","Trabajo Principal"]}];Object(n.useEffect)((function(){var a=Object(d.a)({},O),t=function(e,a){return e.inputType==a.inputType?0:e.inputType>a.inputType?1:-1},n=0,r=e.habits.filter((function(a){return a.isDaily&&a.goalValue==C[e.area].codigos[0]})).sort(t);n+=0==r.length?0:1,r.map((function(e){if(void 0==a[e.title]){var t;switch(e.inputType){case"number":t=0;break;case"time":t="";break;case"checkbox":t=!1;break;default:t=""}a[e.title]=t}})),c(r),n+=0==(r=e.habits.filter((function(a){return a.isDaily&&a.goalValue==C[e.area].codigos[1]})).sort(t)).length?0:1,r.map((function(e){if(void 0==a[e.title]){var t;switch(e.inputType){case"number":t=0;break;case"time":t="";break;case"checkbox":t=!1;break;default:t=""}a[e.title]=t}})),u(r),n+=0==(r=e.habits.filter((function(a){return a.isDaily&&a.goalValue==C[e.area].codigos[2]})).sort(t)).length?0:1,r.map((function(e){if(void 0==a[e.title]){var t;switch(e.inputType){case"number":t=0;break;case"time":t="";break;case"checkbox":t=!1;break;default:t=""}a[e.title]=t}})),f(r),y(n),x(a),console.log("inputs",a)}),[]);var k=function(e,a){var t=Object(d.a)({},O);t[a]=e,x(t)},T=function(a){var t=new Date,n={date:"".concat(t.getDate(),"/").concat(t.getMonth()+1,"/").concat(t.getFullYear()),userEmail:e.user.email,habitTitle:a,value:O[a]};fetch("/records/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},F=function(a,t){if(t.length>0){var n,l=3==w&&3!=a?6:12,c=[];return 12==l&&(n=t.filter((function(e,a){return a%2==0})),c=t.filter((function(e,a){return a%2==1}))),r.a.createElement("div",{className:"col-".concat(l," subarea")},r.a.createElement("div",{className:"header"},r.a.createElement("h3",{className:"text centrado-v"},C[e.area].subareas[a-1])),r.a.createElement("div",{className:"row"},12==l?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"col-6 pr"},n.map((function(e,a){return r.a.createElement("div",{className:"habitItem",key:"1-".concat(a)},r.a.createElement("span",{className:"centrado-v d-block"},e.title),r.a.createElement("div",{className:"input centrado-v"},r.a.createElement("input",{value:O[e.title],onBlur:function(){return T(e.title)},onChange:function(a){return k(a.target.value,e.title)},className:"centrado-h",type:e.inputType})))}))),r.a.createElement("div",{className:"col-6 pl"},c.map((function(e,a){return r.a.createElement("div",{className:"habitItem",key:"2-".concat(a)},r.a.createElement("span",{className:"centrado-v d-block"},e.title),r.a.createElement("div",{className:"input centrado-v"},r.a.createElement("input",{value:O[e.title],onBlur:function(){return T(e.title)},onChange:function(a){return k(a.target.value,e.title)},className:"centrado-h",type:e.inputType})))})))):r.a.createElement("div",{className:"col-12 "},t.map((function(e,a){return r.a.createElement("div",{className:"habitItem",key:a},r.a.createElement("span",{className:"centrado-v d-block"},e.title),r.a.createElement("div",{className:"input centrado-v"},r.a.createElement("input",{value:O[e.title],onBlur:function(){return T(e.title)},onChange:function(a){return k(a.target.value,e.title)},className:"centrado-h",type:e.inputType})))})))))}return""};return r.a.createElement("div",{className:" DiaryCard card"},r.a.createElement("div",{className:"card-header ".concat(0==e.area?"":"collapsed"),"data-toggle":"collapse","data-target":"#collapse".concat(e.area),"aria-expanded":"true","aria-controls":"collapse".concat(e.area),tabIndex:0},r.a.createElement("h2",{className:"centrado-v title"},C[e.area].title),r.a.createElement("div",{className:"centrado-v collapse-icon closed "},r.a.createElement(E.a,null)),r.a.createElement("div",{className:"centrado-v collapse-icon open "},r.a.createElement(E.b,null))),r.a.createElement("div",{id:"collapse".concat(e.area),className:"collapse ".concat(0==e.area?"show":""),"aria-labelledby":"heading".concat(e.area),"data-parent":"#DiaryAreas"},r.a.createElement("div",{className:"card-body"},r.a.createElement("div",{className:"row subareas no-gutters"},0==l.length&&0==m.length&&0==v.length?r.a.createElement("div",{className:"col empty"},r.a.createElement("div",{className:"empty-icon centrado-h fit"},r.a.createElement(p.a,null)),r.a.createElement("h3",{className:"empty-text"},"Parece que no has creado ningun habito en esta categoria ")):r.a.createElement(r.a.Fragment,null,F(1,l),F(2,m),F(3,v))))))};var b=function(e){var a=Object(n.useState)([]),t=Object(s.a)(a,2),l=t[0],c=t[1],i=Object(n.useState)(!0),o=Object(s.a)(i,2),m=o[0],u=o[1];return Object(n.useEffect)((function(){fetch("/habits/filter?userEmail=".concat(e.user.email)).then((function(e){return e.json()})).then((function(e){c(e),u(!1)}))}),[]),r.a.createElement("div",{className:"Home"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-md-6 col-12 diary"},r.a.createElement("h1",{className:"titulo-seccion"},"Registro tus logros diarios"),r.a.createElement("div",{className:"accordion",id:"DiaryAreas"},m?r.a.createElement("div",{class:"spinner-border text-warning centrado",role:"status"},r.a.createElement("span",{class:"sr-only"},"Loading...")):r.a.createElement(r.a.Fragment,null,r.a.createElement(h,{area:0,user:e.user,habits:l}),r.a.createElement(h,{area:1,user:e.user,habits:l}),r.a.createElement(h,{area:2,user:e.user,habits:l})))),r.a.createElement("div",{className:"col-md-6 col-12"})))},v=t(12),f=t.n(v),g=t(24),N=t.n(g);var w=function(e){var a=Object(n.useState)(Object(o.g)().pathname),t=Object(s.a)(a,2),l=t[0];return t[1],r.a.createElement(r.a.Fragment,null,e.user.nuevo?"":r.a.createElement(r.a.Fragment,null,r.a.createElement("nav",{className:"Base"},r.a.createElement("a",{className:"logo",href:"/"},r.a.createElement("img",{className:"centrado-v",alt:"Logo iCUY",src:f.a})),r.a.createElement("div",{className:"links centrado-v"},r.a.createElement("ul",{className:"navbar-nav"},r.a.createElement("li",{className:"nav-item"},r.a.createElement("a",{className:"nav-link ".concat("/platform"==l?"active":""),href:"/platform"},"Inicio")),r.a.createElement("li",{className:"nav-item"},r.a.createElement("a",{className:"nav-link ".concat("/platform/profile"==l?"active":""),href:"/platform/profile"},"Perfil")),r.a.createElement("li",{className:"nav-item"},r.a.createElement("a",{className:"nav-link ".concat("/platform/habits"==l?"active":""),href:"/platform/habits"},"Mis Habitos")))),r.a.createElement("ul",{className:"navbar-nav profile centrado-v"},r.a.createElement("li",{className:"nav-item dropdown"},r.a.createElement("img",{className:"profile dropdown-toggle",alt:"mini profile",src:e.user.image?e.user.image:N.a,role:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}),r.a.createElement("div",{className:"dropdown-menu dropdown-menu-right","aria-labelledby":"profileMenu"},r.a.createElement("a",{className:"dropdown-item",href:"/profile"},"Mi Perfil"),r.a.createElement("a",{className:"dropdown-item",onClick:function(){return fetch("/auth/logout")},href:"/login"},"Cerrar Sesion"))))),r.a.createElement(o.d,null,r.a.createElement(o.b,{path:"/"},r.a.createElement(b,{user:e.user})))))},y=t(27),A=t.n(y);var j=function(){return r.a.createElement("div",{className:"LandPage"},r.a.createElement("nav",null,r.a.createElement("a",{className:"logo",href:"/"},r.a.createElement("img",{className:"centrado-v",alt:"Logo iCUY",src:f.a})),r.a.createElement(i.b,{to:"/login"},r.a.createElement("button",{className:"btn btn-outline btn-primary main-btn centrado-v",href:"/login"},"Ingresa"))),r.a.createElement("div",{className:"intro"},r.a.createElement("div",{className:"cover"}),r.a.createElement("div",{className:"row h-100"},r.a.createElement("div",{className:"col-4"},r.a.createElement("img",{className:"centrado-v intro-img",alt:"Mascota iCUY",src:A.a})),r.a.createElement("div",{className:"col-md-8 col-12"},r.a.createElement("div",{className:"intro-text centrado"},r.a.createElement("h2",{className:"title"},"Transforma tu Vida"),r.a.createElement("p",null,"Organiza y guia tu vida para ser la mejor version de ti mismo"),r.a.createElement("h3",null,"Haz de la felicidad tu habito")),r.a.createElement(i.b,{to:"/login"},r.a.createElement("button",{className:"btn btn-primary centrado-h inicio",href:"/login"},"Empieza Ya"))))),r.a.createElement("div",{className:"second"},r.a.createElement("h1",{className:"centrado-h title"},"Para que iCUY"),r.a.createElement("p",{className:"subtitle"},"Crea habitos en Salud, Relaciones y Trabajo para ayudarte a vivir una vida mas sana, feliz y satisfactoria."),r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col-4"},r.a.createElement("div",{className:"header"},r.a.createElement("h2",null,"Facil de Usar")),r.a.createElement("div",{className:"description"},"El ciudadoso dise\xf1o de la plataforma permite a cualquier usuario usarla de la manera que desee.")),r.a.createElement("div",{className:"col-4"},r.a.createElement("div",{className:"header"},r.a.createElement("h2",null,"It's free")),r.a.createElement("div",{className:"description"},"El unico proposito de esta plataforma es ayudar a cualquier persona a mejorar sus vidas, por este motivo es libre de pago.")),r.a.createElement("div",{className:"col-4"},r.a.createElement("div",{className:"header"},r.a.createElement("h2",null,"Avalado por John")),r.a.createElement("div",{className:"description"},"John Guerra desarrollador y mentor aprueba esta aplicaci\xf3n (#Aprobado).")))),r.a.createElement("div",{className:"third"},r.a.createElement("h1",{className:"title"},"Metodolog\xeda Feliz"),r.a.createElement("div",{className:"step"},r.a.createElement("div",{className:"number"},r.a.createElement("div",{className:"centrado fit num"},"1")),r.a.createElement("h2",{className:"header"},"Define Tus Habitos"),r.a.createElement("p",{className:"description"},"Puedes crear todos los habitos que creas mejoraran tu vida",r.a.createElement("br",null),"Salud | Relaciones | Trabajo")),r.a.createElement("div",{className:"step"},r.a.createElement("div",{className:"number"},r.a.createElement("div",{className:"centrado fit num"},"2")),r.a.createElement("h2",{className:"header"},"Registra tus Logros"),r.a.createElement("p",{className:"description"},"A\xf1ade registros de tu progreso cada ves que puedas.")),r.a.createElement("div",{className:"step"},r.a.createElement("div",{className:"number"},r.a.createElement("div",{className:"centrado fit num"},"3")),r.a.createElement("h2",{className:"header"},"Dale Seguimiento a Tu Progreso"),r.a.createElement("p",{className:"description"},"Puedes usar el Panel visual para observar tu avance en los habitos que te has propuesto"))),r.a.createElement("div",{className:"fourth"},r.a.createElement("h1",{className:"title centrado-v"},"Listo para Mejorar"),r.a.createElement(i.b,{to:"/login"},r.a.createElement("button",{className:"btn btn-primary inicio centrado-v",href:"/login"},"Empieza Ya"))))},O=t(18),x=t(11),C=t.n(x),k=function(e){var a=e.data.map((function(e){return e.date})),t=new Date(Math.max.apply(null,a)),n=new Date(Math.min.apply(null,a));Date.prototype.addDays=function(e){var a=new Date;return a.setDate(a.getDate()+e),a};var l=function(e,a){for(var t=new Array,n=e;n<=a;)t.push(n),n=n.addDays(1);return t}(n,t),c=function(e){var a=new Date(e),t=""+(a.getMonth()+1),n=""+a.getDate(),r=a.getFullYear();return t.length<2&&(Object(O.a)("month"),t="0"+t),n.length<2&&(Object(O.a)("day"),n="0"+n),[r,t,n].join("-")},s={options:{chart:{id:"basic-bar"},xaxis:{categories:[1991,1992,1993,1994,1995,1996,1997,1998]}},series:[{name:"Done",data:l.map((function(e){return t=a,n=c(e),(t.find((function(e){return e==n}))||[]).length>0?{x:c(e),y:29}:{x:c(e),y:11};var t,n}))}]};return r.a.createElement("div",{className:"w-100 h-75 position-absolute bottom-0 "},r.a.createElement(C.a,{options:s.options,series:s.series,type:"heatmap",width:"80%",height:"100%"}))},T=function(e){var a=e.data;a.sort((function(e,a){var t=new Date(e.date),n=new Date(a.date);return t<n?-1:t>n?1:0}));var t={chart:{id:"Dates"},xaxis:{categories:a.map((function(e){return e.date}))}},n=[{name:"Number",data:a.map((function(e){return e.value}))}];return r.a.createElement("div",{className:"w-100 h-75 position-absolute bottom-0 "},r.a.createElement(C.a,{options:t,series:n,type:"line",width:"80%",height:"100%"}))},F=function(e){var a=e.data;a.sort((function(e,a){var t=new Date(e.date),n=new Date(a.date);return t<n?-1:t>n?1:0}));var t={chart:{id:"Dates"},xaxis:{categories:a.map((function(e){return e.date}))}},n=[{name:"Hour",data:a.map((function(e){return e.value}))}];return r.a.createElement("div",{className:"w-100 h-75 position-absolute bottom-0 "},r.a.createElement(C.a,{options:t,series:n,type:"line",width:"80%",height:"100%"}))},L=function(e){var a=Object(n.useState)({}),t=Object(s.a)(a,2),l=t[0],c=t[1],i=Object(n.useState)(null),o=Object(s.a)(i,2),m=o[0],u=o[1];Object(n.useEffect)((function(){d(),E()}),[]);var d=function(){var a="/habits/filter?title=".concat(e.title,"&userEmail=").concat(e.userEmail),t=new Headers;t.append("Content-Type","application/json"),fetch(a,{method:"GET",headers:t}).then((function(e){return e.json()})).then((function(e){console.log("habits",e),c(e[0])}))},E=function(){var a="/records/filter?habitTitle=".concat(e.title,"&userEmail=").concat(e.userEmail),t=new Headers;t.append("Content-Type","application/json"),fetch(a,{method:"GET",headers:t}).then((function(e){return e.json()})).then((function(e){console.log("records",e);var a=e.map((function(e){return{date:e.date,value:e.value}}));console.log(a),u(a)}))};return r.a.createElement("div",null,r.a.createElement("div",{className:"w-100 p-3 h-25 flex",style:{background:"green"}},l.title?r.a.createElement("h1",{style:{color:"#F2F2F2"}},l.title):""),r.a.createElement("div",{className:"w-100 p-3 h-75 overflow-auto",style:{maxWidth:"100%"}},m?function(){switch(l.inputType){case"boolean":return r.a.createElement(k,{data:m});case"number":return r.a.createElement(T,{data:m});case"hour":return r.a.createElement(F,{data:m});default:return""}}():""))};var D=function(){var e=Object(n.useState)(null),a=Object(s.a)(e,2),t=a[0],l=a[1];return Object(n.useEffect)((function(){fetch("/auth/user").then((function(e){return e.json()})).then((function(e){console.log(e),l(e)}))}),[]),r.a.createElement(i.a,null,r.a.createElement(o.d,null,r.a.createElement(o.b,{path:"/login"},t?r.a.createElement(o.a,{to:"/platform"}):r.a.createElement(u,null)),r.a.createElement(o.b,{path:"/platform"},t?r.a.createElement(w,{user:t}):r.a.createElement(o.a,{to:"/login"})),r.a.createElement(o.b,{path:"/habits"},r.a.createElement(L,{title:"ToMeditate",userEmail:"jm.contreras10@uniandes.edu.co"})),r.a.createElement(o.b,{path:"/"},r.a.createElement(j,null))))};c.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(D,null)),document.getElementById("root"))}},[[28,1,2]]]);
  //# sourceMappingURL=main.bd026335.chunk.js.map