1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d254896b-460f-4256-92b4-e8529754e9de",e._sentryDebugIdIdentifier="sentry-dbid-d254896b-460f-4256-92b4-e8529754e9de")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6661],{87499:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/weight-loss",function(){return r(4937)}])},54795:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(85893);function a(e){let{children:t,className:r}=e;return(0,n.jsx)("div",{className:"overflow-hidden rounded-xl border border-black/10 bg-white p-6 md:p-8 ".concat(r),children:t})}},3271:function(e,t,r){"use strict";var n=r(85893),a=r(41664),l=r.n(a),s=r(65147);t.Z=function(e){var t,r,a;let{link:i,onClick:o}=e,d=[];return(null==i?void 0:i.size)==="small"?d.push("px-[25px] py-[12px]"):d.push("px-6 py-3 md:px-8 md:py-4"),(null==i?void 0:i.color)==="purple"?d.push("bg-purple hover:bg-midPurple text-white border-purple"):(null==i?void 0:i.color)==="navy"?d.push("bg-darkNavy border-darkNavy hover:bg-lightNavy text-white"):(null==i?void 0:i.color)==="blue"?d.push("bg-darkBlue border-darkBlue hover:bg-darkBlue/70 text-white"):d.push("border-fadedPurple text-lightNavy hover:text-purple bg-white"),(0,n.jsxs)(l(),{href:(null==i?void 0:null===(t=i.link)||void 0===t?void 0:t.url)||"/#",target:null==i?void 0:null===(r=i.link)||void 0===r?void 0:r.target,className:"".concat("inline-flex items-center rounded-4xl border t-16 font-medium tracking-[0.02em] transition-all duration-200"," ").concat(d.join(" ")),onClick:o,children:[(0,n.jsx)("span",{className:"leading-[16px]!",children:null==i?void 0:null===(a=i.link)||void 0===a?void 0:a.title}),(null==i?void 0:i.icon)&&(0,n.jsx)("div",{className:"mr-[-8px] ml-[14px]",children:(0,n.jsx)(s.Z,{className:(null==i?void 0:i.color)==="secondary"?"text-secondary":"text-white"})})]})}},65147:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(85893);function a(e){let{size:t=20,className:r,...a}=e;return(0,n.jsx)("svg",{width:t,viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,...a,children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.7071 0.292893C10.3166 -0.0976311 9.68342 -0.0976311 9.29289 0.292893C8.90237 0.683418 8.90237 1.31658 9.29289 1.70711L15.5858 8H0V10H15.5858L9.29289 16.2929C8.90237 16.6834 8.90237 17.3166 9.29289 17.7071C9.68342 18.0976 10.3166 18.0976 10.7071 17.7071L18.7071 9.70711L19.4142 9L18.7071 8.29289L10.7071 0.292893Z",fill:"currentColor"})})}},4937:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return H}});var n,a=r(85893),l=r(67294),s=r(98215),i=r(15417),o=r(19576),d=r(73612),c=r(41664),u=r.n(c);let m=e=>{let{dosage:t,productName:r}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium sm:text-lg sm:font-semibold",children:"Medication details"}),(0,a.jsxs)("h3",{className:"sm:text-md text-sm text-gray-400",children:[r," - ",t]})]})};var x=r(35739);let p={CONSULTATION_IN_PROGRESS:"consultationInProgress",PENDING:"pending",IN_PROGRESS:"orderInProgress",COMPLETE:"complete",CANCELLED:"cancelled"},f=e=>{var t,r,n;let a=!!e.startTipSubmittedAt&&!e.tipSubmittedAt,l=!!e.tipSubmittedAt,s=(null===(t=e.consultationNotifications[0])||void 0===t?void 0:t.type)===x.Nx.ConsultationApproved,i=(null===(r=e.orderNotifications[0])||void 0===r?void 0:r.type)===x.ck.OrderFulfilled,o=(0,x.Bo)(null===(n=e.orderNotifications[0])||void 0===n?void 0:n.type);return o?p.CANCELLED:s&&i?p.COMPLETE:l?p.IN_PROGRESS:a?p.PENDING:e.startTipSubmittedAt?p.PENDING:p.CONSULTATION_IN_PROGRESS},h={[p.CONSULTATION_IN_PROGRESS]:"Order not complete",[p.PENDING]:"Pending",[p.IN_PROGRESS]:"Awaiting clinical review",[p.COMPLETE]:"Complete",[p.CANCELLED]:"Cancelled"},v=e=>{let t,{status:r}=e;switch(r){case p.CONSULTATION_IN_PROGRESS:t="bg-error";break;case p.PENDING:t="bg-orange-400";break;case p.IN_PROGRESS:t="bg-blue-400";break;case p.COMPLETE:t="bg-green-500";break;case p.CANCELLED:t="bg-error";break;default:t="bg-orange-400"}
1return(0,a.jsx)("div",{className:"".concat(t," w-fit rounded-[0.25em] px-2 py-1 text-sm text-white md:text-base"),children:h[r]})};function y(e){let{className:t,...r}=e;return(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",fill:"currentColor",className:t,...r,children:(0,a.jsx)("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"})})}let N=e=>{let{trackingLink:t}=e;return(0,a.jsx)("div",{children:(0,a.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"text-purple hover:underline sm:text-lg",children:"Track order"}),(0,a.jsx)("div",{className:"h-[18px] w-[18px] text-purple",children:(0,a.jsx)(y,{})})]})})};var g=r(65147),b=r(30120);let j=e=>{let t=b.ou.fromISO(e,{setZone:!0});return t>b.ou.fromISO("2025-10-26T01:00:00Z")?t:t>b.ou.fromISO("2025-03-30T01:00:00Z")?t.setZone("UTC+1"):t>b.ou.fromISO("2024-10-27T01:00:00Z")?t:t>b.ou.fromISO("2024-03-31T01:00:00Z")?t.setZone("UTC+1"):t>b.ou.fromISO("2023-10-29T01:00:00Z")?t:t>b.ou.fromISO("2023-03-26T01:00:00Z")?t.setZone("UTC+1"):t},w=e=>{let t={th:"th",rd:"rd",nd:"nd",st:"st"};if(11===e||12===e||13===e)return t.th;let r=e.toString().slice(-1);switch(r){case"1":return t.st;case"2":return t.nd;case"3":return t.rd;default:return t.th}},T=e=>{let t=j(e),r=w(t.day);return t.toFormat("ccc, d'".concat(r,"' LLL yyyy"))},O=e=>{var t,r,n;let{order:l}=e,s=f(l),i=s===p.COMPLETE,o=s===p.CONSULTATION_IN_PROGRESS,d=l.orderNotifications[0],c=i?null==d?void 0:null===(r=d.data)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.tracking_link:null;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-md bg-white p-6 shadow-sm ring-1 ring-darkNavy/10 sm:gap-4 sm:p-8",children:[(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-4 xs:flex-row xs:justify-between xs:gap-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"font-semibold sm:text-xl",children:["Order #",l.orderId]}),l.tipSubmittedAt&&(0,a.jsxs)("p",{className:"text-sm text-gray-400",children:["Placed ",T(l.tipSubmittedAt)]})]}),(0,a.jsx)("div",{className:"sm:self-auto",children:(0,a.jsx)(v,{status:s})})]}),o&&(0,a.jsxs)(u(),{href:"/flow/".concat(l.flowId),className:"flex items-center gap-1 text-purple hover:underline",children:["Continue your order ",(0,a.jsx)(g.Z,{className:"text-purple",size:14})]}),(null===(n=l.productDetails)||void 0===n?void 0:n.variant)&&(0,a.jsx)(m,{dosage:l.productDetails.variant,productName:l.productDetails.productName}),i&&(0,a.jsx)(N,{trackingLink:c})]})};var S=e=>{let{orders:t=[]}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"text-xl font-medium",children:"My orders"}),(0,a.jsx)("div",{className:"flex h-full w-full flex-col",children:(0,a.jsx)("ul",{className:"mt-4",children:t.map(e=>(0,a.jsx)("li",{className:"not-first:mt-4",children:(0,a.jsx)(O,{order:e})},e.id))})})]})},k=r(54795),C=r(3271),E=()=>(0,a.jsxs)(k.Z,{children:[(0,a.jsx)("p",{className:"t-18 mb-6 font-medium",children:"Interested In Weight Loss?"}),(0,a.jsx)(C.Z,{link:{link:{title:"Start Your Journey Now",url:"/weight-loss/start"},color:"purple"}})]}),A=r(37120);let P="text-xs font-semibold uppercase tracking-wider text-lightBlue",I="mt-2 max-w-[38ch] text-sm text-white/75",L=e=>{if(!e)return{label:"Order in progress",className:"bg-altLightBlue text-darkNavy"};if(!e.ctaText){let{daysUntilEarlyReorder:t}=e;return{label:"Reorder opens in ".concat(t," ").concat(1===t?"day":"days"),className:"bg-coral text-darkNavy"}}return e.status===A.Y.READY?{label:"Ready to reorder",className:"bg-paleGreen text-darkNavy"}:{label:"Early reorder available",className:"bg-offWhiteBlue text-darkBlue"}},D=e=>{let{reorderDetails:t}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:P,children:"Your next order"}),(0,a.jsx)("h2",{className:"mt-2 max-w-[22ch] text-2xl font-semibold leading-tight",children:null!==(n=null==t?void 0:t.mainText)&&void 0!==n?n:"Your order is in progress"}),(null==t?void 0:t.additionalText)&&(0,a.jsx)("p",{className:I,children:t.additionalText})]})},R=e=>{let{reorderDetails:t}=e;return(null==t?void 0:t.ctaText)?(0,a.jsx)(u(),{href:"/flow/2/start",className:"mt-4 inline-flex items-center rounded-4xl bg-white px-[25px] py-[12px] text-base font-medium tracking-[0.02em] text-darkNavy transition-colors hover:bg-lightBlue",children:t.ctaText}):null},_=e=>{let{summary:t,reorderDetails:r}=e,n=t.upcomingDiscount;if(!n)return(0,a.jsxs)("div",{className:"flex flex-col items-start bg-darkNavy p-6 text-white sm:p-8",children:[(0,a.jsx)(D,{reorderDetails:r}),(0,a.jsx)(R,{reorderDetails:r})]});let l=r&&r.status!==A.Y.READY?r.mainText:"As part of your offer, your next order comes with ".concat(n.valueLabel," off");return(0,a.jsxs)("div",{className:"flex flex-col items-start bg-darkNavy p-6 text-white sm:p-8",children:[(0,a.jsx)("p",{className:P,children:"Your offer"}),(0,a.jsxs)("p",{className:"mt-2 text-5xl leading-none font-bold tracking-tight sm:text-6xl",children:[n.valueLabel," ",(0,a.jsx)("span",{className:"text-lightBlue",children:"off"})]}),(0,a.jsx)("p",{className:"mt-1 text-xl font-medium",children:"your next order"}),(0,a.jsx)("p",{className:I,children:l}),(null==r?void 0:r.additionalText)&&(0,a.jsx)("p",{className:"mt-1 max-w-[42ch] text-[13px] text-white/60",children:r.additionalText}),(0,a.jsx)(R,{reorderDetails:r})]})},Y=e=>{let{summary:t,reorderDetails:r}=e,n=L(r),l=[];return t.plan&&l.push({label:"Current dose",value:"".concat(t.plan.productName," ").concat(t.plan.variant)}),t.nextPaymentAt&&l.push({label:"Next payment",value:T(t.nextPaymentAt)}),l.push({label:"Status",value:(0,a.jsx)("span",{className:"".concat("inline-flex items-center gap-2 rounded-full px-2.5 py-1 text-xs font-semibold uppercase tracking-wide before:size-1.5 before:rounded-full before:bg-current before:content-['']"," ").concat(n.className),children:n.label})}),(0,a.jsx)("dl",{className:"flex flex-col justify-center px-6 py-3 sm:px-8 sm:py-4",children:l.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b border-darkNavy/10 py-3.5 last:border-b-0",children:[(0,a.jsx)("dt",{className:"text-sm text-gray-400",children:e.label}),(0,a.jsx)("dd",{className:"text-right font-medium tabular-nums",children:e.value})]},e.label))})},Z="rounded bg-current opacity-20",B=()=>
1(0,a.jsxs)("div",{"aria-hidden":!0,className:"mb-8 grid animate-pulse overflow-hidden rounded-md bg-white shadow-sm ring-1 ring-darkNavy/10 sm:grid-cols-[1.05fr_1fr]",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start bg-darkNavy p-6 text-white sm:p-8",children:[(0,a.jsx)("div",{className:"h-4 w-28 ".concat(Z)}),(0,a.jsx)("div",{className:"mt-2 h-12 w-48 sm:h-[60px] ".concat(Z)}),(0,a.jsx)("div",{className:"mt-1 h-7 w-40 ".concat(Z)}),(0,a.jsx)("div",{className:"mt-2 h-5 w-64 ".concat(Z)}),(0,a.jsx)("div",{className:"mt-1 h-4 w-56 ".concat(Z)}),(0,a.jsx)("div",{className:"mt-4 h-12 w-40 rounded-4xl ".concat(Z)})]}),(0,a.jsx)("div",{className:"flex flex-col justify-center px-6 py-3 text-darkNavy sm:px-8 sm:py-4",children:[0,1,2].map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b border-darkNavy/10 py-3.5 last:border-b-0",children:[(0,a.jsx)("div",{className:"h-5 w-24 ".concat(Z)}),(0,a.jsx)("div",{className:"h-5 w-28 ".concat(Z)})]},e))})]});var G=e=>{let{summary:t,reorderDetails:r,loading:n}=e,l=!!t&&!!(t.plan||t.nextPaymentAt||t.upcomingDiscount);return n?(0,a.jsx)(B,{}):l||r?l?(0,a.jsxs)("div",{className:"mb-8 grid overflow-hidden rounded-md bg-white shadow-sm ring-1 ring-darkNavy/10 sm:grid-cols-[1.05fr_1fr]",children:[(0,a.jsx)(_,{summary:t,reorderDetails:r}),(0,a.jsx)(Y,{summary:t,reorderDetails:r})]}):(0,a.jsx)("div",{className:"mb-8 overflow-hidden rounded-md shadow-sm ring-1 ring-darkNavy/10",children:(0,a.jsxs)("div",{className:"flex flex-col items-start gap-4 bg-darkNavy p-6 text-white sm:flex-row sm:items-center sm:justify-between sm:p-8",children:[(0,a.jsx)("div",{children:(0,a.jsx)(D,{reorderDetails:r})}),(0,a.jsx)(R,{reorderDetails:r})]})}):null},M=r(32810),J=r(81714),F=r(24726);let U=e=>{var t,r;let n=null==e?void 0:null===(r=e.orderNotifications)||void 0===r?void 0:null===(t=r.find(e=>e.type===x.ck.OrderFulfilled))||void 0===t?void 0:t.createdAt;if(!n)return null;let a=(0,A.P)(n),l=b.ou.fromISO(n,{setZone:!0}).set({hour:3,minute:0,second:0,millisecond:0}),s=l.plus({days:Number("14")}),i=Math.ceil(s.diffNow(["days"]).days);return a===A.Y.NOT_READY?e.earlyRenewalAllowed?{status:a,daysUntilEarlyReorder:i,mainText:"You can reorder early to stay on track",additionalText:null,ctaText:"Reorder early"}:{status:a,daysUntilEarlyReorder:i,mainText:"Going away soon? In ".concat(i," ").concat(1===i?"day":"days"," you can reorder early to stay on track."),additionalText:"Please note we usually recommend reordering at least ".concat(Number("21")," days after you received your last order. Your last order was fulfilled on ").concat(T(n),"."),ctaText:null}:a===A.Y.EARLY?{status:a,daysUntilEarlyReorder:i,mainText:"Going away soon? You can reorder early to stay on track",additionalText:null,ctaText:"Reorder early"}:a===A.Y.READY?{status:a,daysUntilEarlyReorder:i,mainText:"You're all set to place your next order",additionalText:null,ctaText:"Reorder now"}:null},q=()=>{var e;let{session:t}=(0,M.a)(),{semblePatient:r,orders:n,ordersError:d}=(0,s.i)(),[c,u]=(0,l.useState)(null),[m,x]=(0,l.useState)(!0);(0,l.useEffect)(()=>{var e;if(!(null==t?void 0:null===(e=t.user)||void 0===e?void 0:e.id))return;let r=async()=>{try{var e;let{response:t,json:r}=await (0,i.SL)();u(t.ok&&null!==(e=r.data)&&void 0!==e?e:null)}catch(e){u(null)}finally{x(!1)}};r()},[null==t?void 0:null===(e=t.user)||void 0===e?void 0:e.id]);let p=(0,l.useMemo)(()=>[...n].sort(F.K),[n]),f=(0,l.useMemo)(()=>U(p.find(e=>!(0,J.x)(e))),[p]);return r&&n.length?(0,a.jsxs)("section",{children:[d&&(0,a.jsx)(o.Z,{textArray:[d],color:"bg-red-400"}),!d&&!!n.length&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(G,{summary:c,reorderDetails:f,loading:m}),(0,a.jsx)(S,{orders:p})]})]}):(0,a.jsxs)("section",{children:[(0,a.jsx)("h1",{className:"t-36",children:"Welcome Back"}),(0,a.jsx)("div",{className:"mt-7 md:mt-12",children:(0,a.jsx)(E,{})})]})};q.getLayout=e=>(0,a.jsx)(d.Z,{children:e});var H=q},15417:function(e,t,r){"use strict";r.d(t,{JL:function(){return a},SL:function(){return l},q3:function(){return n}});let n=async e=>{let t=await fetch("/api/payment/get-payment-info?consultationId=".concat(e)),r=await t.json();return{response:t,json:r}},a=async(e,t,r)=>{let n=await fetch("/api/payment/attempt-dosage-pay-update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({consultationId:e,confirmedVariantId:t,returnUrl:r})}),a=await n.json();return{response:n,json:a}},l=async()=>{let e=await fetch("/api/payment/get-subscription-summary"),t=await e.json();return{response:e,json:t}}},93748:function(e,t,r){"use strict";r.d(t,{A2:function(){return l},YS:function(){return n},qe:function(){return a}});let n=async e=>{let{flowId:t,questionAnswers:r}=e,n=await fetch("/api/semble/create-consultation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowId:t,...r&&{questionAnswers:r}})}),a=await n.json();return{response:n,json:a}},a=async()=>{let e=await fetch("/api/semble/get-consultations-with-notifications"),t=await e.json();return{response:e,json:t}},l=async e=>{let{consultationId:t}=e,r=await fetch("/api/semble/get-consultation-order-submission-status?consultationId=".concat(t)),n=await r.json();return{response:r,json:n}}},44122:function(e,t,r){"use strict";r.d(t,{_s:function(){return n},hK:function(){return a},tq:function(){return s},xu:function(){return l}});let n=async()=>{let e=await fetch("/api/semble/get-patient"),t=await e.json();return{response:e,json:t}},a=async e=>{let t=await fetch("/api/semble/create-patient",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patientData:e})}),r=await t.json();return{response:t,json:r}},l=async e=>{let t=await fetch("/api/semble/update-patient",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patientData:e})}),r=await t.json();return{response:t,json:r}},s=async(e,t,r)=>{let n=await fetch("/api/semble/create-patient-and-consultation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patientData:e,flowId:t,...r&&{questionAnswers:r}})}),a=await n.json();return{response:n,json:a}}},72790:function(e,t,r){"use strict";r.d(t,{E:function(){return a},a:function(){return n}});let n=async e=>{let t=await fetch("/api/semble/add-gp-relationship",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relationshipContact:e})}),r=await t.json();return{response:t,json:r}},a=async e=>{let t=await fetch("/api/semble/update-gp-relationship",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relationshipContact:e})}),r=await t.json();return{response:t,json:r}}},35739:function(e,t,r){"use strict";r.d(t,{Bo:function(){return l},Nx:function(){return n},ck:function(){return a}});let n={ConsultationApproved:"ConsultationApproved",ConsultationDeclined:"ConsultationDeclined",ConsultationDeclinedByPartnerApi:"ConsultationDeclinedByPartnerApi"},a={OrderFulfilled:"OrderFulfilled",OrderCancelled:"OrderCancelled",OrderCancelledByPartnerApi:"OrderCancelledByPartnerApi"};a.OrderCancelled,a.OrderCancelledByPartnerApi;let l=e=>e===a.OrderCancelled||e===a.OrderCancelledByPartnerApi},81714:function(e,t,r){"use strict";r.d(t,{x:function(){return a}});var n=r(35739);let a=e=>e.orderNotifications.some(e=>(0,n.Bo)(e.type))},24726:function(e,t,r){"use strict";r.d(t,{K:function(){return n}});let n=(e,t)=>e.createdAt>t.createdAt?-1:e.createdAt<t.createdAt?1:0},37120:function(e,t,r){"use strict";r.d(t,{P:function(){return l},Y:function(){return a}});var n=r(30120);let a={NOT_READY:"notReady",EARLY:"early",READY:"ready"},l=e=>{if(!e)throw Error("No previous fulfilled date");let t=n.ou.fromISO(e,{setZone:!0}).set({hour:3,minute:0,second:0,millisecond:0}),r=-t.diffNow(["days","minutes"]).days;return r<Number("14")?a.NOT_READY:r<Number("21")?a.EARLY:a.READY}}},function(e){e.O(0,[9345,4898,120,5837,342,2136,7622,3864,3006,3612,9774,2888,179],function(){return e(e.s=87499)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.