!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2543f87b-2c57-469e-86ee-c0c1c85b3ca9",e._sentryDebugIdIdentifier="sentry-dbid-2543f87b-2c57-469e-86ee-c0c1c85b3ca9")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8450],{59601:function(e,t,r){r.d(t,{JoyScoreCard:function(){return x}});var s=r(13868),n=r(9607),a=r(80074),l=r(21295),i=r(96405),o=r(95614),c=r(51700),d=r(27103),u=r(82491),A=r(39875),h=r(50762),m=r(60435),f=r(71839),g=r(36878);let p="relative rounded-2xl flex h-full gap-3 bg-white p-6 transition-shadow hover:shadow-[0px_8px_24px_0px_#959DA533] motion-reduce:transition-none",x=e=>{var t,r;let x=(0,a.U0)(),[y,b]=(0,l.useState)(!1),[v,j]=(0,l.useState)(e.finished&&e.score>0?Math.round(e.score):"..."),[w,E]=(0,l.useState)((null===(t=e.aiStatus)||void 0===t?void 0:t.status)==="SCHEDULED"),I=(0,n.useRouter)();(0,l.useEffect)(()=>{if(e.finished&&e.score>0)return;let t=setInterval(async()=>{try{let t=await (0,A.Er)(e.joyScoreId);if(E((null==t?void 0:t.status)==="SCHEDULED"),!e.finished){j("...");return}if((null==t?void 0:t.status)!=="SCHEDULED"){let t=await (0,A.$m)(e.joyScoreId);if(null==t||0===t){j("...");return}j("".concat(Math.round(t))),I.refresh()}}catch(e){j("...")}},3e3);return()=>{clearInterval(t)}},[e.finished,e.joyScoreId,I,e]);let S=async()=>{try{await (0,A.Pb)(e.joyScoreId),o.ZP.success("Assessment dicarded"),b(!1),I.refresh()}catch(e){o.ZP.error("Error discarding assessment")}},N=(0,s.jsx)("div",{"aria-hidden":!0,style:{backgroundImage:"url(".concat(c.default.src,")")},className:"h-10 w-10 flex-none bg-contain"}),D=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.h,{className:"absolute right-4 top-4",icon:"discard",onPress:()=>b(!0),"data-sentry-element":"IconButton","data-sentry-source-file":"JoyScoreCard.tsx"}),y?(0,s.jsxs)(m.u_,{isOpen:!0,onOpenChange:b,children:[(0,s.jsx)(m.xB,{className:"sm:hidden"}),(0,s.jsx)("p",{className:"typography",children:"Are you sure you want to discard assessment?"}),(0,s.jsxs)(m.mz,{className:"flex justify-end gap-4",children:[(0,s.jsx)(d.zx,{variant:"outlined",onPress:()=>b(!1),children:"Cancel"}),(0,s.jsx)(d.zx,{onPress:()=>S(),children:"Discard"})]})]}):null]});return e.finished?(0,s.jsxs)("div",{className:(0,f.cn)(p),children:[(0,s.jsxs)(i.r,{className:t=>{let{isFocusVisible:r}=t;return(0,f.cn)("relative flex w-full gap-3 outline-none",e.canDelete&&"mr-6",r&&"outline-default outline outline-2")},href:"/app/joy-score/".concat(e.joyScoreId,"/results"),style:{WebkitTouchCallout:"none"},onPress:()=>{x.capture("joy score card clicked")},children:[N,(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"typography-title-h2",children:v}),(0,s.jsx)("time",{dateTime:(0,g.l)(e.finishedAt),className:"typography-body-14 block text-neutral-50",children:(0,g.F)(e.finishedAt)})]}),w?(0,s.jsx)(h.Q,{isDisabled:!0,className:"absolute -top-2 right-0",size:"small",children:"Processing..."}):null,(null===(r=e.aiStatus)||void 0===r?void 0:r.status)==="FAILED"?(0,s.jsx)(h.Q,{isDisabled:!0,className:"bg-brand-95 text-brand-50 absolute -top-2 right-0",size:"small",children:"Error"}):null]}),e.canDelete?D():null]}):(0,s.jsxs)("div",{className:(0,f.cn)(p,"items-center"),"data-sentry-component":"JoyScoreCard","data-sentry-source-file":"JoyScoreCard.tsx",children:[(0,s.jsx)("div",{className:"flex-none blur-sm",children:N}),(0,s.jsx)("div",{className:"flex flex-col gap-1",children:(0,s.jsx)(h.Q,{href:"/app/joy-score/".concat(e.joyScoreId,"/steps"),variant:"outlined",className:"min-h-11 px-4 py-2","data-sentry-element":"LinkButton","data-sentry-source-file":"JoyScoreCard.tsx",children:"Continue"})}),e.canDelete?D():null]})}},60577:function(e,t,r){r.d(t,{Carousel:function(){return l}});var s=r(13868),n=r(21295),a=r(71839);let l=e=>{let{items:t,className:r,focusedElement:l=0}=e,[i,o]=(0,n.useState)(1),c=(0,n.useRef)(null),d=(0,n.useRef)([]),u=(0,n.useRef)(null),A=e=>{if(c.current&&d.current[e]){let t=c.current,r=d.current[e],s=t.clientWidth,n=r.clientWidth,a=r.offsetLeft-t.offsetLeft-(s-n)/2;t.scrollTo({left:a,behavior:"smooth"}),u.current=e+1,o(e+1)}};return(0,n.useEffect)(()=>{A(l)},[l]),(0,n.useEffect)(()=>{let e=()=>{if(c.current){let e=c.current,t=e.scrollLeft+e.clientWidth/2,r=0,s=1/0;d.current.forEach((n,a)=>{if(n){let l=Math.abs(t-(n.offsetLeft+n.clientWidth/2-e.offsetLeft));l{t&&t.removeEventListener("scroll",e)}},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:c,className:(0,a.cn)("no-scrollbar flex snap-x scroll-px-4 overflow-x-auto md:scroll-px-6 lg:scroll-px-12 xl:scroll-px-20",r),children:t.map((e,t)=>(0,s.jsx)("div",{ref:e=>{e&&(d.current[t]=e)},children:e},t))}),(0,s.jsx)("div",{className:"mt-4 flex justify-center space-x-2 md:hidden",children:t.map((e,t)=>(0,s.jsx)("button",{onClick:()=>A(t),className:(0,a.cn)("h-2 w-2 rounded-full",t===i-1?"bg-brand-50":"bg-neutral-90 hover:bg-neutral-400"),children:(0,s.jsx)("div",{})},t))})]})}},43208:function(e,t,r){r.d(t,{WhyIsJoyScoreImportant:function(){return h}});var s=r(13868),n=r(46496),a=r(21295),l={src:"/_next/static/media/video-1-cover-image.d3d3500b.png",height:1798,width:1020,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAICAIAAAC+k6JsAAAAi0lEQVR42gGAAH//AKOqqaKop66up6ilnKKflwCcpKGkraypqaOfmpCtraQAr7azmaKhxaWTz6eNnZuTAMzd4KmlneWrlOGoi6iZigDS7POPjITSnIO2im+fiGoAl6CibEMAsZJ5dltHdFEuAIdyZnVOIRkTFEotF5duSACPbUpgSDAiHhpmSjGbcENxAkBRPN/T/AAAAABJRU5ErkJggg==",blurWidth:5,blurHeight:8},i={src:"/_next/static/media/video-2-cover-image.a47c68d9.png",height:1800,width:1024,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAICAIAAAC+k6JsAAAAiklEQVR42mO48eLL0Tsf1px/1zRlGQMQfPn19+bjl8eu3IuITQLx////v33VxoKoDCYGYUNTG4bHj5+snz23MDC+q6OxoLSIoXbm/s6pe/PDInMq5wYmVDOEVx21yjnhn7DAJn67TuhGBgW35Xoh601iNprGbLYKWs6gZDNZP3SNittM3ZDVegELAKLxO9Xt+3GUAAAAAElFTkSuQmCC",blurWidth:5,blurHeight:8},o=r(60577);let c=e=>(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 67 67",fill:"none",...e,"data-sentry-element":"svg","data-sentry-component":"PlayVideoIcon","data-sentry-source-file":"PlayVideoIcon.tsx",children:(0,s.jsx)("path",{fill:"currentColor",d:"M33.5.688a32.812 32.812 0 1 1 0 65.624 32.812 32.812 0 0 1 0-65.624m0 60.937a28.125 28.125 0 1 0 0-56.25 28.125 28.125 0 0 0 0 56.25m-3.516-18.136L44.97 33.5l-14.986-9.99zm.778-25.097 18.272 12.183a3.515 3.515 0 0 1 0 5.85L30.763 48.608a3.516 3.516 0 0 1-5.466-2.925v-24.37a3.515 3.515 0 0 1 5.465-2.925z","data-sentry-element":"path","data-sentry-source-file":"PlayVideoIcon.tsx"})}),d=e=>{let{className:t}=e,r=[{id:"1",value:"Scores for each life dimension"},{id:"2",value:"An overall Joy Score"},{id:"3",value:"Evidence-based insights"}];return(0,s.jsxs)("div",{className:t,"data-sentry-component":"WhatYouWillGet","data-sentry-source-file":"WhatYouWillGet.tsx",children:[(0,s.jsx)("h3",{className:"typography-title-h3 font-bold",children:"What you'll get:"}),(0,s.jsx)("div",{children:null==r?void 0:r.map(e=>(0,s.jsxs)("div",{className:"border-neutral-80 flex w-full flex-row items-center gap-3 border-b border-dashed py-5",children:[(0,s.jsx)("div",{className:"bg-brand-95 flex h-9 w-9 items-center justify-center rounded-full",children:null==e?void 0:e.id}),(0,s.jsx)("p",{children:null==e?void 0:e.value})]},"info-".concat(null==e?void 0:e.id)))})]})},u=e=>{let{children:t,title:r,subtitle:n,body:a,leftSideContent:l}=e;return(0,s.jsxs)("div",{className:"flex w-full flex-col gap-4 lg:flex-row lg:gap-8","data-sentry-component":"SectionsLayout","data-sentry-source-file":"SectionsLayout.tsx",children:[(0,s.jsxs)("div",{className:"flex flex-col lg:w-2/5",children:[(0,s.jsx)("h3",{className:"typography-title-h3 font-bold mb-4 md:mb-6",children:r}),n?(0,s.jsx)("h4",{className:"mb-0 typography-title-h4 font-medium",children:n}):null,a?(0,s.jsx)("p",{children:a}):null,l||null]}),(0,s.jsx)("div",{className:"flex w-full flex-col lg:w-3/5 lg:pl-8",children:t})]})},A=e=>{let{src:t,activeVideo:r,setActiveVideo:l,id:i,coverImage:o,videoRef:d,setFocusedElement:u}=e,[A,h]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{r&&r===i&&d.current?d.current.play():d.current&&d.current.pause()},[r,i,d]),(0,a.useEffect)(()=>{let e=()=>{d.current&&(d.current.paused||d.current.ended?h(!1):h(!0))},t=d.current;return t&&(t.addEventListener("play",e),t.addEventListener("pause",e),t.addEventListener("ended",e)),()=>{t&&(t.removeEventListener("play",e),t.removeEventListener("pause",e),t.removeEventListener("ended",e))}},[d]),(0,s.jsxs)("button",{type:"button",id:i,className:"relative mr-8 h-[471px] w-[266px]","aria-label":"Play video ".concat(i),onClick:()=>{l(i),u("video-1"===i?0:1),d.current&&(d.current.currentTime=0)},"data-sentry-component":"Video","data-sentry-source-file":"WhyIsJoyScoreImportant.tsx",children:[(0,s.jsxs)("video",{controls:!0,className:"rounded-2xl",ref:d,onError:()=>{console.error("Error loading video: ".concat(t))},children:[(0,s.jsx)("source",{src:t,type:"video/mp4"}),"Your browser does not support the video tag."]}),!A&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.default,{src:o,alt:"Play button",className:"absolute inset-0 m-auto h-full w-full cursor-pointer rounded-2xl blur-sm grayscale-[0.5]",layout:"fill",objectFit:"cover"}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)(c,{className:"text-neutral-80 h-28 w-28 opacity-50"})})]})]})},h=()=>{let[e,t]=(0,a.useState)(""),[r,n]=(0,a.useState)(0),c=(0,a.useRef)(null),h=(0,a.useRef)(null),m=[(0,s.jsx)(A,{id:"video-1",videoRef:c,coverImage:l,activeVideo:e,setActiveVideo:t,setFocusedElement:n,src:"https://camas-creek-api.s3.us-east-2.amazonaws.com/video_1_joyscore.mp4"},"video-1"),(0,s.jsx)(A,{id:"video-2",videoRef:h,coverImage:i,activeVideo:e,setActiveVideo:t,setFocusedElement:n,src:"https://camas-creek-api.s3.us-east-2.amazonaws.com/video_2_joy_score.mp4"},"video-2")];return(0,a.useEffect)(()=>{let t=()=>{let t=document.querySelector("#why-is-joy-score-important");if(t){var r,s,a,l,i;let o=t.getBoundingClientRect();o.top>=0&&o.bottom<=window.innerHeight&&c.current&&h.current?("video-1"===e&&(null===(r=c.current)||void 0===r||r.play()),""===e&&(null===(s=c.current)||void 0===s||s.play()),"video-2"===e&&(null===(a=h.current)||void 0===a||a.play(),n(1))):(null===(l=c.current)||void 0===l||l.pause(),null===(i=h.current)||void 0===i||i.pause())}};return window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}},[e]),(0,a.useEffect)(()=>{let e=()=>{h.current&&(t("video-2"),n(1))},r=()=>{var e,r;(null===(e=c.current)||void 0===e?void 0:e.ended)&&(null===(r=h.current)||void 0===r?void 0:r.ended)&&(t("done-playing"),n(0))},s=c.current,a=h.current;return s&&s.addEventListener("ended",e),a&&a.addEventListener("ended",r),()=>{s&&s.removeEventListener("ended",e),a&&a.removeEventListener("ended",r)}},[c,h]),(0,s.jsx)("div",{id:"why-is-joy-score-important","data-sentry-component":"WhyIsJoyScoreImportant","data-sentry-source-file":"WhyIsJoyScoreImportant.tsx",children:(0,s.jsx)(u,{title:"Here's Why You Should Take Our Free Assessment",body:"In just 3–5 minutes, this free assessment gives you a snapshot of your well-being across three essential areas: Relationship Health, Life Satisfaction, and Self-Worth.",leftSideContent:(0,s.jsx)(d,{className:"mt-3"}),"data-sentry-element":"SectionsLayout","data-sentry-source-file":"WhyIsJoyScoreImportant.tsx",children:(0,s.jsx)(o.Carousel,{focusedElement:r,items:m,"data-sentry-element":"Carousel","data-sentry-source-file":"WhyIsJoyScoreImportant.tsx"})})})}},51700:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/joy-score-bubble@2x.73cc64a7.png",height:88,width:88,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAABBklEQVR42gVAvUrDQBz//e8uH21qJZUY6KJDXLqIg7rp4OBiwU3EQRCfQnwA8SEEndxcXKRgQYROiqCTEEUq1hZKNTRf9nIn9HtywAEUSXjWsOpbe6wyV6Up/xbAFatYIAAYnjZ3+HRwyUouwASIGQA3LgDs88E65o3GRpt7CxypM2FkAibXgF4iolwUxeK2CscGp1SO35iRxwVmlkuKagT1p3fF6DW37LwH+e7i88tG/0li1Zglf62MaFiYrMuD1vOHh4f7WHT7iRwhU4MwnegMUMAN2+xdP8ZO/TixSpASgoOYBkyd6U6tSUe8BZDz07mLyisvWumqsNi369nnQeQfirad/gOyH2I7G7NxnAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},11764:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/joy-score-page-image.591ca9ae.svg",height:299,width:522,blurWidth:0,blurHeight:0}},84506:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/large-joy-score-page-image.48b28e93.svg",height:762,width:475,blurWidth:0,blurHeight:0}},71759:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/small-joy-score-page-image.b0ea2ad1.svg",height:211,width:343,blurWidth:0,blurHeight:0}},73834:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/Derek.c98deb00.png",height:896,width:880,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAA00lEQVR42gHIADf/AKakkpaSgkdCOh4cGVFNQ4iKgoOJh5KTiQCjo5R4b2JVNixfSD8sAABZXV1wen2Nj4YAnZ+QnI+BtJCHjW1lYkM4XlhVYmhoiIl/AJqdj6mfkdm0rJ95b3NWSn56cGRmYYeHegCam42VmIa5qJWmhnhpTTh0bmZeY2CBgnUAnJ+Sm6Gaoqeps5mFk3lmZ296bXmIYW12AJ6np5muxJWnuqWio5CYon+PoXqJm1lneACisb2Fl6uWprWgr7yJmap/jZ55h5lTXWgc2WAMuETJXgAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},41060:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/Kevin.c8344995.png",height:851,width:796,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAICAIAAAC6ZnJRAAAAu0lEQVR42mNIczKKDHC6cff2zy9fL144m5bicWDbKobOeL8Ue/W5/a27ausOl5XMbshavmIyw5Ss4GmJXvYMDEmqvFsaytY0FGUX+DDMzAudmxXko6vWHOW1qLZoanVBUqwdQ0W4h4eNlaOafFek66zcpLn1xb72UgzW2ioMYvKyCsrqkrzt2SnpMUE2JrwMGvJSkpIycrKKwkJiuprqWtra1qYqDBrqWgbmNupmDpKSsiLCoob6BmYmqgCWIDle2MGU0wAAAABJRU5ErkJggg==",blurWidth:7,blurHeight:8}},88132:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/Michelle-W.fc3ace31.png",height:839,width:875,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAz0lEQVR42mOwtjJwcrJUVlNmYGCQl5d1sLdwcra2d7RicHW21DXRzwzzWNNZYiInIigt7eXl6ObpxODl6aBmoNVZnLpndntltC9Qn6OTlX+wN4OPt7Okgda0moJziycuKo43V5Q2MjcOjghkcPdwdPZwtDLV2zaxtjczBKjDwtIsODqUwdbBKiDIh0FEuSHJdUJBMAMDj5SIsJO7C0NEdFhTU21EoM/8qtjZFTFMDLzqCnJAIxhy87NaGivdnO2m16Svbssw11AyMdCNCfMDADuENwi2IioIAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},15577:function(e,t,r){r.r(t),t.default={src:"/_next/static/media/Naomi.9c5bbca5.png",height:794,width:723,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAICAIAAAC6ZnJRAAAAtklEQVR42mOYsaSyuD6qvLLK3sFVR0HT0M729KFlDNlZMbHRsd1tfdFe3gxg0NOQx2Bj7uDt6bm8u7snOVqJh4GBid/GRI9BTkE1LTqsqzg7M8DN0VCHkZVPXkqcwdverCTcb1V9ZbG9nq+WLAMDm5m+BkNBql+Kj9X09LhQTSVtOTEGBoaCggyG0nxrjyiDan+DcG1xcxkOBkXlqskTGSobs3o7KzZ0VbYGWTQEmjc72xVWlAIAuwEzOy5+axEAAAAASUVORK5CYII=",blurWidth:7,blurHeight:8}}}]);