(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9417],{53558:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var a=n(86677),r=n.n(a),i=n(79956),l=n(30603),o=n(48400),s=n(83012),c=n(57510),d=n(41701),u=n(28827);let h=async(e,t)=>{let n=new c.m;try{let{data:a,error:r}=await n.syncUserWithDB(e,t);if(r)return console.error("Error syncing user",r),{error:r};return{data:a}}catch(e){return e instanceof s.p&&(console.log("OhaiLoginRequiredError"),r().push("/api/auth/logout")),{error:e}}};function m(){let[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)(!0),[s,c]=(0,i.useState)(void 0),[m,x]=(0,i.useState)(null),[f,p]=(0,i.useState)(),[b,g]=(0,i.useState)(void 0),[v,w]=(0,i.useState)(void 0);(0,o.U0)();let j=(0,a.useRouter)(),{user:k,isLoading:y}=(0,l.aF)(),N=(0,u.Z)(),[_]=(0,d.ASR)({fetchPolicy:"no-cache",onError:()=>{j.replace("/logout")}});return(0,i.useEffect)(()=>{async function e(e){var n,a,i,l,o;let{data:s,error:u}=await h(e,N.userAcquisition);if(u){console.error("Error calling fetchOrInsertUserInDB",u),r(!1);return}let m=await _();c(null===(n=m.data)||void 0===n?void 0:n.primaryHousehold),x((null==m?void 0:null===(a=m.data)||void 0===a?void 0:null===(i=a.primaryHousehold)||void 0===i?void 0:null===(l=i.subscription)||void 0===l?void 0:l.plan)||null),r(!1),t(s);let f=null===(o=m.data)||void 0===o?void 0:o.currentHouseholdMember;f&&(p(f),g((null==f?void 0:f.memberType)===d.jw1.Member),w((null==f?void 0:f.memberType)===d.jw1.Cho))}if(j.isReady){if(k&&!y){e(k);return}r(!1)}},[j,k,y]),{dbUser:e,isLoading:n,household:s,plan:m,currentHouseholdMember:f,isSeatMember:b,isCho:v}}},28827:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var a=n(86677),r=n(79956),i=n(27693),l=n.n(i),o=function(e,t){let[n,a]=(0,r.useState)(()=>{try{{let n=window.localStorage.getItem(e);return n&&"undefined"!=n?JSON.parse(n):t}}catch(e){return console.log(e),t}});return(0,r.useEffect)(()=>{try{let t="function"==typeof n?n(n):n;window.localStorage.setItem(e,JSON.stringify(t))}catch(e){console.log(e)}},[e,n]),[n,a]};let s=()=>{let e=(0,a.useRouter)(),[t,n]=(0,r.useState)(),[i,s]=o("user_acquisition",void 0);return(0,r.useEffect)(()=>{try{let t=e.query.utm_source,a=e.query.utm_medium,r=e.query.utm_campaign;if(t||a||r){let e={utm_source:t,utm_medium:a,utm_campaign:r,acquisition_date:new Date};s(e),n(e)}else if(i){let e=l()(i.acquisition_date),t=l()().diff(e,"d");t<=7&&t>=0?n(i):s(void 0)}}catch(e){console.debug("Error processing user_acquisition"),console.debug(e)}},[e.isReady]),{userAcquisition:t}};var c=s},69652:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var a=n(45213);function r(e){let{text:t,className:n,textSize:r}=e,i=t&&t.length>0?t.charAt(0).toUpperCase():"◦";return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"text-[".concat(r||"32px","] ").concat(n," rounded-[50%] text-brand-light-3 bg-[#CED3DE] text-center flex justify-center items-center my-[10px]"),children:i})})}},68554:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var a=n(45213),r=n(68666),i=n(69556),l=n.n(i);function o(e){let{children:t,className:n,isLoading:i=!1,buttonType:o,onClick:s,disabled:c=!1,variant:d="contained",...u}=e;return(0,a.jsxs)(r.Z,{variant:d,onClick:s,type:o,className:"".concat("text"==d||"outlined"==d?"border-[rgba(51, 51, 51, 0.3)]":""," py-[17px] px-8 rounded-full font-semibold ").concat(i?"opacity-50 cursor-not-allowed":""," ").concat(c?"opacity-50 cursor-not-allowed":""," ").concat(n),disabled:c,...u,children:[t,i&&(0,a.jsx)("div",{className:"inline-block ml-2 whitespace-nowrap",children:(0,a.jsx)(l(),{color:"white",speedMultiplier:.8,size:8,loading:i})})]})}},86438:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var a=n(45213),r=n(38579),i=n.n(r),l=n(79894),o=n.n(l),s=n(86677),c=n(2750);function d(e){let{version:t=1,lightMode:n=!1}=e,r=(0,s.useRouter)(),l=2===t;return(0,a.jsxs)("div",{className:"bg-black",children:[(0,a.jsx)("div",{className:"phone:block h-full w-[0.5px] pt-[1px] justify-center align-middle inline-flex ",children:(0,a.jsx)("div",{className:"w-screen h-0 border-solid border-0 border-t-[0.5px] border-[#5D6B92] border-opacity-70"})}),(0,a.jsx)("div",{className:"".concat(l?"vhp-container mx-auto px-0":" px-6 "," w-full lg:max-w-[90%] mx-auto align-end pt-10 pb-12 tablet:py-8"),children:(0,a.jsxs)("footer",{className:"".concat(l?"vhp-container mx-auto":"container"),children:[l&&(0,a.jsxs)("div",{className:"mb-8 clear-both min-h-[40px]",children:[(0,a.jsxs)("div",{className:"text-center mb-8 desktop:mb-2 my-2 desktop:text-left desktop:float-left",children:[(0,a.jsx)(o(),{href:"/",children:(0,a.jsx)(i(),{width:"136",height:"52",alt:"Ohai.ai Logo",src:"/images/logo/ohai-logo-new.svg",className:"mt-1 mr-2 mb-[21px]",priority:!0})}),(0,a.jsxs)(c.Z,{variant:"body2",component:"div",className:"text-center text-white/70 font-normal desktop:hidden block",children:["\xa9 ",new Date().getFullYear()," Ohai.ai. All Rights Reserved."]})]}),(0,a.jsxs)("div",{className:"text-center my-4 desktop:text-left desktop:float-right",children:[(0,a.jsx)("span",{className:"inline-blcok mx-4",children:(0,a.jsx)(o(),{href:"https://www.facebook.com/ohaidotai",target:"_blank",children:(0,a.jsx)(i(),{width:28,height:28,alt:"Facebook",src:"/images/icon/social/facebook-icon.svg",className:"mt-1 mr-1 desktop::mr-2"})})}),(0,a.jsx)("span",{className:"inline-blcok mx-4",children:(0,a.jsx)(o(),{href:"https://www.twitter.com/ohaidotai",target:"_blank",children:(0,a.jsx)(i(),{width:28,height:28,alt:"Twitter",src:"/images/icon/social/twitter-icon.svg",className:"mt-1 mr-1 desktop::mr-2"})})}),(0,a.jsx)("span",{className:"inline-blcok mx-4",children:(0,a.jsx)(o(),{href:"https://www.linkedin.com/company/ohaidotai",target:"_blank",children:(0,a.jsx)(i(),{width:28,height:28,alt:"linkedin",src:"/images/icon/social/linkedin-icon.svg",className:"mt-1 mr-1 desktop::mr-2"})})}),(0,a.jsx)("span",{className:"inline-blcok ml-4",children:(0,a.jsx)(o(),{href:"https://www.instagram.com/ohaidotai",target:"_blank",children:(0,a.jsx)(i(),{width:28,height:28,alt:"Instagram",src:"/images/icon/social/instagram-icon.svg",className:"mt-1 mr-1 desktop::mr-2"})})})]})]}),(0,a.jsxs)("div",{className:"w-full flex flex-col gap-8 items-center justify-between tablet:flex ".concat(l?"desktop:flex-row-reverse":"tablet:flex-row-reverse"," "),children:[(0,a.jsxs)(c.Z,{variant:"body2",component:"div",className:"".concat((r.pathname,"")," text-center text-white/70 font-normal flex ").concat(l&&"desktop:flex-row-reverse flex-col tablet:flex "," gap-5 tablet:gap-10 ").concat(n?"bg-white":"bg-black"),children:[l&&(0,a.jsx)(o(),{className:"text-white/70 no-underline desktop:hidden",href:"/blog",children:"Blog"}),(0,a.jsx)(o(),{className:"text-white/70 no-underline",href:"/terms-of-service",children:"Terms"}),(0,a.jsx)(o(),{className:"text-white/70 no-underline",href:"/privacy-policy",children:"Privacy"})," ",(0,a.jsx)(o(),{className:"text-white/70 no-underline",href:"/cookie-policy",children:"Cookies"})," ",(0,a.jsx)("a",{className:"text-white/70",onClick:()=>{"undefined"!=typeof Osano&&Osano.cm.showDrawer("osano-cm-dom-info-dialog-open")},children:(0,a.jsx)("span",{className:"cursor-pointer",children:"Manage Cookies"})}),(0,a.jsx)(o(),{className:"text-white/70 no-underline ".concat(l?"hidden desktop:inline-block":""),href:"/blog",children:"Blog"})]}),(0,a.jsxs)(c.Z,{variant:"body2",component:"div",className:"".concat((r.pathname,"")," text-center text-white/70 font-normal ").concat(n?"bg-white":"bg-black"," ").concat(l&&"desktop:block hidden"),children:["\xa9 ",new Date().getFullYear()," Ohai.ai. All Rights Reserved."]})]})]})})]})}},4986:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var a=n(45213),r=n(86677),i=n(79956),l=n(94776),o=n(68181),s=n(25310),c=n(90005),d=n.n(c),u=n(86438),h=n(2750),m=n(40057);let x=(0,i.forwardRef)((e,t)=>{let[n,r]=(0,i.useState)(!0),[s,c]=(0,i.useState)(0),d=(0,l.Z)();(0,o.Z)(d.breakpoints.down("sm"));let{headerBannerHeight:u,setHeaderBannerHeight:x}=e,[f,p]=(0,i.useState)([]);return(0,i.useEffect)(()=>{(0,m.I)("/ohai-site-config",{populate:"*"},{cache:"no-cache",next:{revalidate:600},headers:{"Content-Type":"application/json",Authorization:"Bearer b3068597c6c53902e7e7ca5bdee6a32fa8bbf84e230f4854324883de7f3d8b6584c4f19867076f73457c5829b5c11daacfeadede64d403c2757a87ec1171c6f8653e4b5e309bfd80d7e94c00e032ac0cf18dd5753131621e7d45eeacae4c6ba93f8111f8e62d8c1be5af2c2bcd92ef08752db411afb3e5edb7dc0b8f333c775f"}}).then(e=>{var t,n,a;console.log("results",e),e&&(null==e?void 0:null===(t=e.data)||void 0===t?void 0:null===(n=t.attributes)||void 0===n?void 0:null===(a=n.global_banner_items)||void 0===a?void 0:a.data)&&(x(1),p(e.data.attributes.global_banner_items.data.map(e=>({url:e.attributes.url,title:e.attributes.title}))))})},[]),(0,i.useEffect)(()=>{s>=0&&(null==f?void 0:f.length)>1&&setTimeout(()=>{s<(null==f?void 0:f.length)-1?c(s+1):c(0)},15e3)},[s,f]),(0,a.jsx)(a.Fragment,{children:n&&(null==f?void 0:f.length)>0&&f[s]&&(0,a.jsx)("div",{ref:t,className:"w-full min-h-8 bg-brand-turqoise-300",children:(0,a.jsx)("div",{className:"text-center bg-brand-secondary-dark text-brand-black-1 px-2 py-2",children:(0,a.jsx)("div",{className:"mx-auto max-w-[940px]",children:(0,a.jsx)(h.Z,{variant:"body2",children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:f[s].title}})})})})})})});x.displayName="OhaiGlobalBanner";var f=n(88764),p=n.n(f);function b(e){let{bodyBackground:t="white",pageHeader:n,showFooter:c=!0,children:h,backGroundColor:m=!1,fullWidthContent:f=!1,bgColor:b="",vhp:g=!1,showHeaderBorder:v=!0,showGlobalBanner:w=!1}=e;(0,r.useRouter)();let j=(0,l.Z)();(0,o.Z)(j.breakpoints.down("sm"));let[k,y]=(0,i.useState)(0),N=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(N.current){let e=new ResizeObserver(e=>{y(e[0].contentRect.height)});e.observe(N.current)}},[N.current]),(0,a.jsxs)(s.Z,{className:"App bg-cover bg-center bg-no-repeat flex flex-col overflow-x-hidden relative ".concat(m?b||"bg-brand-black-1":p().ohaiGradientBackground),style:{backgroundRepeat:"no-repeat",backgroundSize:"100% 100%",backgroundPosition:"center center",backgroundAttachment:"fixed",minHeight:"100svh"},children:[(0,a.jsxs)("div",{className:"w-full min-h-4 z-10 ".concat(g?" fixed ".concat(b," "):""),children:[w&&(0,a.jsx)(x,{ref:N,fixed:g,headerBannerHeight:k,setHeaderBannerHeight:y}),n]}),(0,a.jsx)("div",{className:d()("flex-1","flex-col","items-center","mx-auto","overflow-x-hidden","h-full",f?"w-full":"md:max-w-3xl lg:max-w-6xl",w&&k>0?"pt-[113px] tablet:pt-[103px]":{"pt-[62px] tablet:pt-[76px] overflow-x-hidden":g}),children:h}),c&&(0,a.jsx)(u.Z,{version:g?2:1,lightMode:"white"==t}),!f&&!g&&!1,!g&&v&&n&&!1]})}},62930:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a=n(45213),r=n(86677),i=n(79956),l=n(25585),o=n(71157),s=n(41701),c=n(53558),d=n(21373),u=n(69652);function h(e){var t;let{}=e,n=(0,r.useRouter)(),{dbUser:h,isLoading:m}=(0,c.Z)(),[x,f]=(0,i.useState)(),[p,b]=(0,i.useState)(),[g,v]=(0,i.useState)(!1),[w,j]=(0,i.useState)(),k=null===(t=(0,l.l)(d.y.household.currentHouseholdId))||void 0===t?void 0:t.id,[y,{loading:N,error:_,data:S,refetch:E}]=(0,s.s0U)();(0,i.useEffect)(()=>{h&&y({fetchPolicy:"no-cache"})},[h]),(0,i.useEffect)(()=>{_&&n.push("/logout")},[_]),(0,i.useEffect)(()=>{S&&j(null==S?void 0:S.households)},[S]),(0,i.useEffect)(()=>{k&&w&&b(null==w?void 0:w.find(e=>e.id===k))},[k,w]);let{data:Z,loading:R}=(0,s.rSJ)(),C=null==Z?void 0:Z.getChoHouseholdMember;return(0,i.useEffect)(()=>{C&&f(C)},[C]),(0,a.jsx)(a.Fragment,{children:w&&w.length>=1&&(0,a.jsxs)(a.Fragment,{children:[x&&(0,a.jsxs)("div",{className:"px-8 pb-4 mb-2 relative min-h-[52px] cursor-pointer",onClick:()=>{w.length>1?v(!0):n.push("/user")},children:[(0,a.jsx)("div",{className:"pt-5 align-middle min-h-[42px]",children:null==p?void 0:p.name}),(0,a.jsx)("div",{className:"absolute top-[0] right-8",children:(0,a.jsx)(u.Z,{className:"h-[42px] w-[42px] bg-brand-black-3 text-brand-light-3 border-brand-black-2 text-[18px]",textSize:"24px",text:"".concat(null==x?void 0:x.firstName)})})," "]}),g&&w.length>1&&(0,a.jsxs)("div",{className:"absolute top-[80px] right-0 border-2 border-bg-brand-black-3 rounded-[24px] mx-4 my-2 max-w-[420px] w-[90%] bg-brand-black-2 z-30",children:[(0,a.jsx)("div",{className:"cursor-pointer px-4 py-4 min-h-[30px] mb-4",onClick:()=>{v(!1)},children:(0,a.jsx)("span",{className:"float-right",children:(0,a.jsx)(o.Z,{})})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"my-4 px-8",children:[(0,a.jsx)("span",{className:"cursor-pointer",onClick:()=>{v(!1),n.push("/user")},children:"Manage my account"})," "]}),(0,a.jsx)("hr",{className:"bg-brand-black-3 opacity-10 mt-6 mx-8"}),w&&(null==w?void 0:w.length)>1&&w.map(e=>{let t=null==e?void 0:e.members.filter(e=>"CHO"===e.memberType)[0],n=null==e?void 0:e.members.filter(e=>("MEMBER"===e.memberType||"CHO"===e.memberType)&&e.userId===(null==h?void 0:h.id))[0];if(n)return(0,a.jsx)("div",{className:"mb-4 border-2 border-solid border-brand-black-2 border-b-brand-black-2",onClick:()=>{v(!1),d.y.household.currentHouseholdId({id:t.householdId})},children:(0,a.jsxs)("div",{className:"px-8 pb-4 mb-2 relative min-h-[52px]",children:[(0,a.jsx)("div",{className:"pt-5 align-middle min-h-[42px]",children:null==e?void 0:e.name}),(0,a.jsx)("div",{className:"absolute top-0 right-8",children:(0,a.jsx)(u.Z,{className:"h-[42px] w-[42px] bg-brand-black-3 text-brand-light-3 border-brand-black-2 text-[18px]",textSize:"24px",text:"".concat(null==t?void 0:t.lastName)})})]})},null==t?void 0:t.userId)})]})]})]})})}},41259:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var a=n(45213),r=n(38579),i=n.n(r),l=n(79894),o=n.n(l),s=n(86677),c=n(79956),d=n(39146),u=n(92133),h=n(62930);function m(e){let{showBackButton:t=!0,showOhailogo:n=!0,showTalktoO:r=!1}=e,l=(0,s.useRouter)(),[m,x]=(0,c.useState)(!0);(0,c.useEffect)(()=>{("/user/add-user-information"===l.pathname||l.pathname.indexOf("/onboard/")>-1)&&x(!1)},[l.pathname]);let f=(0,c.useRef)(null),p=(0,a.jsx)(i(),{width:110,height:44,alt:"Ohai.ai Logo",src:"/images/logo/ohai-logo-new.svg",className:"",priority:!0});return!function(e,t){let[n,a]=(0,c.useState)(!1),[r,i]=(0,c.useState)(0),[l,o]=(0,c.useState)(0),s=e=>{i(e.target.documentElement.scrollTop),a(e.target.documentElement.scrollTop>r)};(0,c.useEffect)(()=>{window.addEventListener("scroll",s)},[]),(0,c.useEffect)(()=>{e.current&&o(e.current.clientHeight)},[e.current]),(0,c.useEffect)(()=>{var n,a;r>l?null===(n=e.current)||void 0===n||n.classList.add(t):null===(a=e.current)||void 0===a||a.classList.remove(t)},[r])}(f,"bg-white"),(0,a.jsxs)("header",{className:"w-full flex flex-col items-center justify-center min-h-[74px] py-5 px-4 relative ",ref:f,children:[(0,a.jsxs)("div",{className:"w-full flex justify-center items-center relative",children:[t&&(0,a.jsx)(u.Z,{onClick:()=>l.back(),size:"small",className:" text-white text-lg absolute left-0 my-auto p-[2px]",children:(0,a.jsx)(d.Z,{})}),n&&(m?(0,a.jsx)(o(),{href:"/",children:p}):p)]}),(0,a.jsx)("div",{className:"hidden",children:(0,a.jsx)(h.Z,{})})]})}},40057:function(e,t,n){"use strict";n.d(t,{I:function(){return o},p:function(){return l}});var a=n(8139),r=n.n(a),i=n(27061);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat("https://cms.ohai.ai").concat(e)}async function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={headers:{"Content-Type":"application/json",Authorization:"Bearer "+i.env.STRAPI_API_TOKEN},...n},o=r().stringify(t),s="".concat(l("/api".concat(e).concat(o?"?".concat(o):"")));try{let e=await fetch(s,a);if(!e.ok)throw console.error(e.statusText),Error("An error occurred please try again");let t=await e.json();return t}catch(e){console.error(e)}return null}},88764:function(e){e.exports={ohaiGradientBackground:"gradient_ohaiGradientBackground__fS_9X",ohaiDarkBackground:"gradient_ohaiDarkBackground__9eVD3",ohaiPaymentScreenBackground:"gradient_ohaiPaymentScreenBackground__1Z05j",ohaiUpgradePaymentScreenBackground:"gradient_ohaiUpgradePaymentScreenBackground__OL8SO","calendar-backGroundColor":"gradient_calendar-backGroundColor__RYghg"}},96553:function(){}}]);