PageSourceSearch

https://gutgraph.com/_next/static/chunks/3712-c453a1b7e5cfcfd2.js?dpl=29810582e9a40cec5bd74c6e19e6978ad3f290ad

js gutgraph.com collected 2026-10-10 02:12:08 UTC 8,561 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3712],{19663:(e,t,a)=>{a.d(t,{t:()=>o});let n=["/","/login","/register","/verify-email","/forgot-password","/reset-password","/onboarding","/pricing","/about","/methodology","/blog","/foods","/low-fodmap-foods","/high-fodmap-foods","/moderate-fodmap-foods","/reengagement","/cookies","/privacy","/terms","/medical-disclaimer","/ibs-food-diary"],r=/\.(xml|txt|json|js|ico|png|jpg|jpeg|svg|webp|webmanifest)$/i;function o(e){return!!e&&(r.test(e)||e.startsWith("/icons")||e.startsWith("/opengraph-image")||e.startsWith("/twitter-image")||n.some(t=>e===t||e.startsWith(t+"/"))||e.startsWith("/is-")||e.startsWith("/low-fodmap-alternatives-to-")||e.startsWith("/proxy/"))}},50252:(e,t,a)=>{a.d(t,{LJ:()=>i,V3:()=>s,bC:()=>n.Ay,l2:()=>l,mZ:()=>c});var n=a(27362),r=a(70773);let o={maskAllInputs:!0,maskTextSelector:"*",blockSelector:"img, picture, video, canvas, .recharts-wrapper, [data-ph-block]",recordHeaders:!1,recordBody:!1,maskCapturedNetworkRequestFn:e=>({...e,name:"string"==typeof e.name?(0,r.J)(e.name):e.name,requestHeaders:void 0,requestBody:void 0,responseHeaders:void 0,responseBody:void 0})};function i(){if(n.Ay.__loaded)return;let e="phc_JdM7gISReoALkfHy7g1XEzuWKEhb5wsrRiA63939BeZ";e&&n.Ay.init(e,{api_host:"https://t.gutgraph.com",person_profiles:"identified_only",capture_pageview:!1,capture_pageleave:!0,autocapture:!0,mask_all_text:!0,mask_all_element_attributes:!0,mask_personal_data_properties:!0,capture_performance:!1,session_recording:o,before_send:r.g})}async function s(e){let t=new TextEncoder().encode(e.toLowerCase().trim());return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>e.toString(16).padStart(2,"0")).join("")}function c(e,t){n.Ay.__loaded&&(n.Ay.has_opted_out_capturing()||n.Ay.capture(e,t))}function l(e,t){n.Ay.__loaded&&(n.Ay.has_opted_out_capturing()||n.Ay.captureException(e,t))}},66210:(e,t,a)=>{a.d(t,{Hj:()=>r,JA:()=>i,Lc:()=>s,QX:()=>g,WO:()=>m,dp:()=>o,iY:()=>f,ng:()=>d,u7:()=>p,y6:()=>_});var n=a(19663);let r="/consent",o="HEALTH_DATA_CONSENT_REQUIRED",i="HEALTH_DATA_PROCESSING_PAUSED",s="Health-data processing is paused. You can view, download or delete your data. Turn it back on any time.",c=["/onboarding"],l=[r,"/do-not-sell","/profile"];function u(e,t){return t.some(t=>e===t||e.startsWith(t+"/"))}function d(e,t,a){return!a&&!!(null==t?void 0:t.consentRequired)&&!(!e||u(e,l))&&(!!u(e,c)||!(0,n.t)(e))}let h=RegExp("[\\u0000-\\u001f\\u007f\\\\]");function p(e){let t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.origin;if(!e||!e.startsWith("/")||h.test(e))return null;try{t=new URL(e,a)}catch(e){return null}return t.origin!==new URL(a).origin||u(t.pathname,[r])?null:t.pathname+t.search+t.hash}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"".concat(r,"?next=").concat(encodeURIComponent(e+t))}let m="enable",g="health-data";function _(e){return"".concat(f(e),"&").concat(m,"=").concat(g)}},70773:(e,t,a)=>{a.d(t,{J:()=>i,g:()=>c});let n=/(\/reengagement\/(?:survey|unsubscribe)\/)[^/?#]+/,r=/^\$.*(url|referrer|pathname)$/i,o=new Set(["TypeError","ReferenceError","RangeError","ChunkLoadError"]);function i(e){let t=e.search(/[?#]/);return(-1===t?e:e.slice(0,t)).replace(n,"$1[redacted]")}function s(e){if(e)for(let[t,a]of Object.entries(e))"string"==typeof a&&r.test(t)&&(e[t]=i(a))}function c(e){return e&&(s(e.properties),s(e.$set),s(e.$set_once),!function(e){if("string"==typeof e.$elements_chain&&(e.$elements_chain=e.$elements_chain.replace(/(href=")([^"]*)(")/g,(e,t,a,n)=>t+i(a)+n)),Array.isArray(e.$elements))for(let t of e.$elements)"string"==typeof(null==t?void 0:t.attr__href)&&(t.attr__href=i(t.attr__href));if(e.$heatmap_data&&"object"==typeof e.$heatmap_data){let a={};for(let[n,r]of Object.entries(e.$heatmap_data)){var t;let e=i(n);a[e]=[...null!=(t=a[e])?t:[],...r]}e.$heatmap_data=a}}(e.properties),"$exception"===e.event&&function(e){if(Array.isArray(e.$exception_list))for(let t of e.$exception_list)t&&!o.has(t.type)&&(t.value="[redacted]");"string"!=typeof e.$exception_message||o.has(e.$exception_type)||(e.$exception_message="[redacted]")}(e.properties)),e}},73712:(e,t,a)=>{a.d(t,{AuthProvider:()=>f,Y:()=>d,A:()=>m});var n=a(65251),r=a(20515),o=a(7092),i=a(50252),s=a(19663),c=a(87),l=a(66210);function u(e){let{user:t,isLoading:a,children:i}=e,s=(0,o.usePathname)(),u=(0,o.usePathname)(),d=(0,o.useRouter)();return((0,r.useEffect)(()=>
1{if(!(0,l.ng)(u,t,a)||!u)return;let e=window.location.search;d.replace((0,l.iY)(u,e))},[u,t,a,d]),(0,l.ng)(s,t,a))?(0,n.jsxs)("div",{className:"min-h-screen flex items-center justify-center bg-background",role:"status",children:[(0,n.jsx)(c.A,{className:"h-8 w-8 animate-spin text-brand-400","aria-hidden":"true"}),(0,n.jsx)("span",{className:"sr-only",children:"Loading"})]}):(0,n.jsx)(n.Fragment,{children:i})}var d=function(e){return e.MALE="MALE",e.FEMALE="FEMALE",e.OTHER="OTHER",e.PREFER_NOT_TO_SAY="PREFER_NOT_TO_SAY",e}({});let h=(0,r.createContext)(void 0);function p(e,t,a){try{fetch("".concat(e,"/auth/diagnostic"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({event:t,...a,timestamp:new Date().toISOString()})}).catch(()=>{})}catch(e){}}function f(e){var t;let{children:a,initialHasAccessTokenCookie:c}=e,[l,d]=(0,r.useState)(null),f=(0,o.usePathname)(),m=c||!(0,s.t)(null!=f?f:"/"),[g,_]=(0,r.useState)(m),[y,b]=(0,r.useState)(null),w=(0,r.useRef)(c),v="https://api.gutgraph.com",E=(0,r.useCallback)(async()=>{if(!("undefined"!=typeof document&&document.cookie.split(";").some(e=>e.trim().startsWith("".concat("csrf_token","=")))))try{await fetch("".concat(v,"/auth/csrf-token"),{credentials:"include"})}catch(e){console.error("Failed to fetch CSRF token:",e)}},[v]),A=(0,r.useCallback)(async()=>{if(!m){_(!1),d(null);return}try{let e=await fetch("".concat(v,"/auth/me"),{credentials:"include"});if(e.ok){let t=await e.json();if(w.current=!0,d(t.user),i.bC.__loaded){let e=await (0,i.V3)(t.user.email);i.bC.identify(t.user.id,{email_hash:e,auth_provider:t.user.authProvider,onboarding_completed:t.user.onboardingCompleted})}await E()}else if(y){w.current=!0,p(v,"CHECK_AUTH_COOKIE_FAILED",{status:e.status});let t=await fetch("".concat(v,"/auth/me"),{headers:{Authorization:"Bearer ".concat(y)}});if(t.ok){let e=await t.json();w.current=!0,d(e.user),await E()}else p(v,"SESSION_LOST",{reason:"Both cookie and bearer auth failed",cookieStatus:e.status,bearerStatus:t.status}),d(null)}else 401===e.status&&w.current&&p(v,"SESSION_LOST",{reason:"Cookie auth failed and no bearer token available",status:e.status}),d(null)}catch(e){p(v,"CHECK_AUTH_ERROR",{error:e instanceof Error?e.message:String(e)}),d(null)}finally{_(!1)}},[v,y,E,m]);(0,r.useEffect)(()=>{if(_(m),!m)return void d(null);let e=!0;(async()=>{e&&await A()})();let t=()=>{"visible"===document.visibilityState&&e&&A()};return document.addEventListener("visibilitychange",t),()=>{e=!1,document.removeEventListener("visibilitychange",t)}},[A,m]);let S=async(e,t)=>{let a=await fetch("".concat(v,"/auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:e,password:t})});if(!a.ok)throw Error((await a.json()).message||"Login failed");let n=await a.json();w.current=!0,d(n.user),n.token&&b(n.token)},k=async(e,t,a,n,r)=>{let o=await fetch("".concat(v,"/auth/register"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:e,password:t,firstName:a,lastName:n,...r})});if(!o.ok)throw Error((await o.json()).message||"Registration failed");let i=await o.json();w.current=!0,d(i.user),i.token&&b(i.token)},C=async()=>{try{await fetch("".concat(v,"/auth/logout"),{method:"POST",credentials:"include"})}catch(e){}finally{i.bC.__loaded&&i.bC.reset(),d(null),b(null),w.current=!1}},O=(0,r.useCallback)(e=>{let{consentRequired:t,healthDataConsent:a}=e;d(e=>e?{...e,consentRequired:t,healthDataConsent:a}:e)},[]);return(0,n.jsx)(h.Provider,{value:{user:l,isAuthenticated:!!l,isLoading:g,onboardingCompleted:null!=(t=null==l?void 0:l.onboardingCompleted)&&t,login:S,register:k,logout:C,checkAuth:A,loginWithGoogle:()=>{window.location.href="".concat(v,"/auth/google")},setOnboardingCompleted:e=>{l&&d({...l,onboardingCompleted:e})},applyConsentStatus:O},children:(0,n.jsx)(u,{user:l,isLoading:g,children:a})})}function m(){let e=(0,r.useContext)(h);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}}}]);

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.