text: (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{119:function(e,t,a){e.exports=a(199)},154:function(e,t,a){},155:function(e,t,a){},199:function(e,t,a){"use strict";a.r(t);a(120),a(133),a(136),a(140),a(143);var n=a(0),r=a.n(n),l=a(93),c=a.n(l),o=(a(154),a(155),a(35)),i=a(8),s=a(29),u=a(95),m=a.n(u),d=a(96),g=a.n(d),p=function(e){var t=e.removeLogin,a=e.history;return r.a.createElement(s.Header,{"aria-label":"Hello"},r.a.createElement(s.SkipToContent,null),r.a.createElement(s.HeaderName,{element:o.c,to:"/",prefix:"Xtress"},"Health"),r.a.createElement(s.HeaderNavigation,{"aria-label":"Health"}),r.a.createElement(s.HeaderGlobalBar,null,t?null:r.a.createElement(s.HeaderGlobalBar,null,r.a.createElement(s.HeaderGlobalAction,{"aria-label":"User Avatar",onClick:function(){a.push("/login")}},r.a.createElement(m.a,null))),r.a.createElement(s.HeaderGlobalAction,{"aria-label":"App Switcher"},r.a.createElement(g.a,null))))},b=a(209),f=a(218),E=a(210),h=a(219),v=a(220);var _=function(e){return r.a.createElement("section",{className:"bx--row ".concat(e.className," info-section")},r.a.createElement("div",{className:"bx--col-md-8 bx--col-lg-4 bx--col-xlg-3"},r.a.createElement("h3",{className:"info-section__heading"},e.heading)),e.children)},x=function(e){var t=function(e){var t=e.split(" "),a=t.pop();return[t.join(" "),a]}(e.heading);return r.a.createElement("div",{className:"info-card bx--col-md-4 bx--col-lg-4 bx--col-xlg-3 bx--offset-xlg-1"},r.a.createElement("h4",{className:"info-card__heading"},"".concat(t[0]," "),r.a.createElement("strong",null,t[1])),r.a.createElement("p",{className:"info-card__body"},e.body),e.icon)},w=a(99),N=a.n(w),y=a(97),O=a.n(y),j=a(98),C=a.n(j),S={selected:0,triggerHref:"#",role:"navigation"},I={href:"#",role:"presentation",tabIndex:0},k=function(){return r.a.createElement("div",{className:"bx--grid bx--grid--full-width landing-page"},r.a.createElement("div",{className:"bx--row landing-page__banner"},r.a.createElement("div",{className:"bx--col-lg-16"},r.a.createElement(b.a,{noTrailingSlash:!0,"aria-label":"Page navigation"},r.a.createElement(f.a,null,r.a.createElement("a",{href:"/"},"Getting Started"))),r.a.createElement("h1",{className:"landing-page__heading"},"Providing Stress-Free Health Monitoring"))),r.a.createElement("div",{className:"bx--row landing-page__r2"},r.a.createElement("div",{className:"bx--col bx--no-gutter"},r.a.createElement(E.a,Object.assign({},S,{"aria-label":"Tab navigation"}),r.a.createElement(h.a,Object.assign({},I,{label:"About"}),r.a.createElement("div",{className:"bx--grid bx--grid--no-gutter bx--grid--full-width"},r.a.createElement("div",{className:"bx--row landing-page__tab-content"},r.a.createElement("div",{className:"bx--col-md-4 bx--col-lg-7"},r.a.createElement("h2",{className:"landing-page__subheading"},"Why XtressHealth?"),r.a.createElement("p",{className:"landing-page__p"},"001"),r.a.createElement(v.a,null,"Learn more")),r.a.createElement("div",{className:"bx--col-md-4 bx--offset-lg-1 bx--col-lg-8"},r.a.createElement("img",{className:"landing-page__illo",src:"".concat("","/tab-illo.png"),alt:"Carbon illustration"}))))),r.a.createElement(h.a,Object.assign({},I,{label:"Design"}),r.a.createElement("div",{className:"bx--grid bx--grid--no-gutter bx--grid--full-width"},r.a.createElement("div",{className:"bx--row landing-page__tab-content"},r.a.createElement("div",{className:"bx--col-lg-16"},r.a.createElement("h2",{className:"landing-page__subheading"},"Why XtressHealth?"),r.a.createElement("p",{className:"landing-page__p"},"001"),r.a.createElement(v.a,null,"Learn more")),r.a.createElement("div",{className:"bx--col-md-4 bx--offset-lg-1 bx--col-lg-8"},r.a.createElement("img",{className:"landing-page__illustration",src:"".concat("","/Illustration.jpg"),alt:"Design illustration"}))))),r.a.createElement(h.a,Object.assign({},I,{label:"Develop"}),r.a.createElement("div",{className:"bx--grid bx--grid--no-gutter bx--grid--full-width"},r.a.createElement("div",{className:"bx--row landing-page__tab-content"},r.a.createElement("div",{className:"bx--col-lg-16"},r.a.createElement("h2",{className:"landing-page__subheading"},"Why XtressHealth?"),r.a.createElement("p",{className:"landing-page__p"},"001"),r.a.createElement(v.a,null,"Learn more")),r.a.createElement("div",{className:"bx--col-md-4 bx--offset-lg-1 bx--col-lg-8"},r.a.createElement("img",{className:"landing-page__illo",src:"".concat("","/tab-illo.png"),alt:"Carbon illustration"})))))))),r.a.createElement(_,{heading:"The Principles",className:"landing-page__r3"},r.a.createElement(x,{heading:"XtressHealth is Human-Centric",body:"",icon:r.a.createElement(O.a,null)}),r.a.createElement(x,{heading:"XtressHealth is Modular",body:"",icon:r.a.createElement(C.a,null)}),r.a.createElement(x,{heading:"XtressHealth is Consistent",body:"",icon:r.a.createElement(N.a,null)})))},L=a(38),P=a.n(L),T=a(49),A=a(31),H=a(217),B=a(214),D=a(213),R=a(216),U=Object(n.createContext)({}),X=((new Date).getTime(),(new Date).getTime(),(new Date).getTime(),(new Date).getTime(),(new Date).getTime(),function(){var e=Object(R.a)().t,t=Object(n.useState)({isAuth:!1,firstName:"",lastName:"",email:""}),a=Object(A.a)(t,2);return{currentUser:a[0],setCurrentUser:a[1],t:e}}),G=a(116),M=a(211),W=a(215),J=a(212),q=a(222),z=a(221),V=function(e){var t=e.setLoginId,a=e.setStep,l=e.step,c=e.initLogin,o=e.loginId,i=e.setError,s=Object(n.useContext)(U).t,u=Object(n.useState)(!1),m=Object(A.a)(u,2),d=m[0],g=m[1],p=r.a.createRef(),b=function(){i(""),a(1)};return Object(n.useEffect)(function(){2===l&&p.current.focus()}),r.a.createElement(G.a,{initialValues:{openeewId:o,password:""},validate:function(e){var t={};return 1!==l||e.xtressId||(t.openeewId=s("content.login.form.errors.idRequired")),2!==l||e.password||(t.password=s("content.login.form.errors.passwordRequired")),t},onSubmit:function(e,n){var r=n.setSubmitting;1===l?(t(e.xtressId),a(2)):c(e.password,r)}},function(e){var t=e.values,a=e.errors,n=e.handleChange,c=e.handleBlur,i=e.handleSubmit,u=e.isSubmitting;return r.a.createElement(M.a,{onSubmit:function(e){e.preventDefault(),g(!0),i()}},2===l&&r.a.createElement("input",{type:"email",style:{display:"none"}}),r.a.createElement(W.a,{id:1===l?"xtressId":"password",type:1===l?"email":"password",className:"login_textInput",ref:p,"aria-label":1===l?"enter your email":"enter your password",labelText:1===l?r.a.createElement("p",{className:"login__instructions"},r.a.createElement("span",null,s("content.login.enterId"))):r.a.createElement("p",{className:"login__goBack",onClick:b,tabIndex:0,"aria-label":"back to email",role:"button",onKeyDown:function(e){return function(e,t){switch(e.keyCode){case 32:case 13:t()}}(e,b)}},r.a.createElement("span",null,r.a.createElement(z.a,{className:"login__back-arrow"}),o)),placeholder:s(1===l?"content.login.form.labels.xtressId":"content.login.form.labels.password"),onBlur:c,invalid:1===l?a.xtressId&&d:a.password&&d,onChange:n,value:1===l?t.xtressId:t.password,autoComplete:1===l?"email":"current-password"}),1===l&&r.a.createElement("input",{type:"password",style:{display:"none"}}),r.a.createElement(v.a,{renderIcon:1===l?z.b:null,className:"login__continue-button marb-1 ".concat(u?"display-none":""),type:"submit",iconDescription:s("content.login.continue")},1===l?"Continue":"Log in"),1===l?r.a.createElement(J.a,{labelText:s("content.login.rememberMe"),className:"login__checkbox",id:"login_rememberMe"}):null,u?r.a.createElement(q.a,{className:"space-t-2",description:s("content.login.loggingIn"),status:"active","aria-live":"polite"}):null)})};function F(){return(F=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function K(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var Z=r.a.createElement("defs",null,r.a.createElement("style",null,"\n      .cls-1 {\n        fill: #a3a3a3;\n      }\n\n      .cls-2 {\n        fill: #fff;\n      }\n    ")),Y=r.a.createElement("g",{id:"Layer_2","data-name":"Layer 2"},r.a.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},r.a.createElement("polygon",{className:"cls-1",points:"47.98 65.43 59.32 65.72 61.12 20.13 49.44 18.9 47.98 65.43"}),r.a.createElement("polygon",{className:"cls-1",points:"29.14 64.87 33.15 26.75 44.78 26.75 40.17 65.43 29.14 64.87"}),r.a.createElement("path",{className:"cls-2",d:"M48,0a46.19,46.19,0,0,0-19,3.3l4.1,10.89A34.62,34.62,0,0,1,76.86,62.36L61.12,20.13,49.43,18.9,63.32,56.4,73.56,83.54A46.24,46.24,0,0,0,48,0ZM59.32,78.28A34.61,34.61,0,0,1,15.6,30.14L29.06,64.87h.08l11,.56-5.64-15-6.7-17.87L18.76,9.05A46.25,46.25,0,0,0,63.51,89.14Z"}),r.a.createElement("polygon",{className:"cls-2",points:"59.32 65.72 47.98 65.43 44.07 55.24 38.33 40.25 33.15 26.75 44.78 26.75 49.82 40.25 59.32 65.72"}))),$=function(e){var t=e.svgRef,a=K(e,["svgRef"]);return r.a.createElement("svg",F({viewBox:"0 0 92.47 92.47",ref:t},a),Z,Y)},Q=r.a.forwardRef(function(e,t){return r.a.createElement($,F({svgRef:t},e))}),ee=(a.p,a(105)),te=a(106),ae={base_url:Object({NODE_ENV:"production",PUBLIC_URL:""}).REACT_APP_DEPLOY_URL},ne=new(function(){function e(){Object(ee.a)(this,e)}return Object(te.a)(e,[{key:"handleError",value:function(){var e=Object(T.a)(P.a.mark(function e(t){var a;return P.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,t.json();case 3:throw a=e.sent,new Error(a.clientCode?a.clientCode:"generic");case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"login",value:function(e,t){var a=this;return new Promise(function(n,r){fetch("".concat(ae.base_url,"/api/login"),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({username:e,password:t}),credentials:"include"}).then(a.handleError).then(function(e){return e.json()}).then(function(e){return localStorage.setItem("attemptSilentLogin",!0),n(e)}).catch(function(e){return r(e.message)})})}},{key:"getCurrentUser",value:function(){return new Promise(function(e,t){fetch("".concat(ae.base_url,"/api/user"),{credentials:"include"}).then(function(e){return e.json()}).then(function(t){return e(t)}).catch(function(){return t()})})}},{key:"getCurrentUserByToken",value:function(e){var t=this;return new Promise(function(a,n){fetch("".concat(ae.base_url,"/api/user/token"),{headers:{Authorization:"Bearer ".concat(e)}}).then(t.handleError).then(function(e){return e.json()}).then(function(e){return a(e)}).catch(function(e){return n(e.message)})})}},{key:"onboardUser",value:function(e,t){var a=this;return new Promise(function(n,r){fetch("".concat(ae.base_url,"/api/user/onboard"),{method:"POST",headers:{Authorization:"Bearer ".concat(e),Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({password:t})}).then(a.handleError).then(function(e){return e.json()}).then(function(e){return console.log(e),n(e)}).catch(function(e){return r(e.message)})})}},{key:"logout",value:function(){return new Promise(function(e,t){fetch("".concat(ae.base_url,"/api/logout"),{method:"POST",credentials:"include"}).then(function(e){return e.json()}).then(function(){return localStorage.setItem("attemptSilentLogin",!1),e()}).catch(function(e){return t()})})}}]),e}()),re=function(e){var t=e.history,a=Object(n.useContext)(U),l=a.t,c=a.setCurrentUser,o=Object(n.useState)(""),i=Object(A.a)(o,2),s=i[0],u=i[1],m=Object(n.useState)(1),d=Object(A.a)(m,2),g=d[0],b=d[1],f=Object(n.useState)(""),E=Object(A.a)(f,2),h=E[0],v=E[1],_=Object(n.useCallback)(function(){var e=Object(T.a)(P.a.mark(function e(a,n){var r;return P.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),u(""),e.prev=2,e.next=5,ne.login(h,a);case 5:return r=e.sent,n(!1),c({isAuth:!0,email:r.email,firstName:r.givenName,lastName:r.familyName}),console.log("Login successful ",r.email),e.abrupt("return",t.push("/"));case 12:return e.prev=12,e.t0=e.catch(2),n(!1),e.abrupt("return",u(e.t0));case 16:case"end":return e.stop()}},e,null,[[2,12]])}));return function(t,a){return e.apply(this,arguments)}}(),[h,c,t]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(p,{removeLogin:!0}),r.a.createElement("div",{className:"login__container"},r.a.createElement("div",{className:"login__spacer"}),r.a.createElement("div",null,r.a.createElement(Q,{width:50,className:"marb-2"}),r.a.createElement("h1",{className:"login__title",tabIndex:0},l("content.login.title"),r.a.createElement("span",{className:"login__xtresstwins"}," XtressTwins"))),r.a.createElement(H.a,{exitBeforeEnter:!0,initial:!1},r.a.createElement(B.a.div,{key:"login-".concat(g),transition:{type:"spring",bounce:.4,duration:.35},initial:{x:200,opacity:0},animate:{x:0,opacity:1},exit:{x:-200,opacity:0}},r.a.createElement("div",{className:"login__supportingContainer"},2===g?r.a.createElement("p",{className:"login__forgotPassword",tabIndex:0,role:"button"},r.a.createElement("span",null,l("content.login.forgotPassword"))):null),r.a.createElement(V,{step:g,setStep:b,setLoginId:v,initLogin:_,loginId:h,setError:u}),s?r.a.createElement(D.a,{kind:"error",subtitle:r.a.createElement("span",null,l("content.login.errors.".concat(s))),tabIndex:0,title:l("content.login.errors.errorHeading"),hideCloseButton:!0}):null))))},le=function(){return r.a.createElement(o.a,null,r.a.createElement(p,null),r.a.createElement("div",{className:"app-content"},r.a.createElement(i.c,null,r.a.createElement(i.a,{exact:!0,path:"/",component:k}),r.a.createElement(i.a,{exact:!0,path:"/Login",component:re}))))},ce=function(){return r.a.createElement(U.Provider,{value:X()},r.a.createElement(le,null))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var oe=a(117),ie=a(115),se=new oe.a({uri:"https://api.github.com/graphql",headers:{authorization:"Bearer ".concat(Object({NODE_ENV:"production",PUBLIC_URL:""}).REACT_APP_GITHUB_PERSONAL_ACCESS_TOKEN)}});c.a.render(r.a.createElement(ie.a,{client:se},r.a.createElement(o.b,null,r.a.createElement(ce,null))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})}},[[119,1,2]]]);
  //# sourceMappingURL=main.1a8ae8d7.chunk.js.map