PageSourceSearch

https://www.fitspot.ai/_next/static/chunks/9612-09ae5dff6946ba51.js

js fitspot.ai collected 2026-10-05 15:21:50 UTC 6,506 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a109b4-81fd-7382-8a77-20a6ffca9ef5")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9612],{4181:(e,t,r)=>{r.d(t,{H:()=>o});var i=r(86431),n=r(99743);let o=async()=>{try{let e=(0,n.eV)();return(0,i.Em)({method:"GET",url:"/api/user",params:{timezone:e}})}catch(e){return Promise.reject(e)}}},24940:(e,t,r)=>{r.d(t,{$o:()=>p,FU:()=>a,NN:()=>u,OK:()=>y,RR:()=>c,Vt:()=>g,WO:()=>d,Xf:()=>w,aQ:()=>k,gm:()=>n,k:()=>h,kL:()=>l,l2:()=>s,lt:()=>b,mF:()=>x,oV:()=>o,oq:()=>v,p0:()=>f,rT:()=>A,t7:()=>m,tA:()=>_,uX:()=>E});var i=r(32535);function n(e,t){i.Ay.identify(e,t?{email:t}:void 0)}function o(){i.Ay.reset()}function a(e){e?i.Ay.has_opted_out_capturing()||i.Ay.opt_out_capturing():i.Ay.has_opted_out_capturing()&&i.Ay.opt_in_capturing()}function s(e){i.Ay.captureException(e)}function c(e){i.Ay.capture("paywall_buy_blocked_entitled",{source:e})}function u(){i.Ay.capture("paywall_buy_check_failed")}function l(e){i.Ay.capture("paywall_sync_pending",{outcome:e})}function p(e,t,r){i.Ay.capture("onboarding_step_viewed",{step_id:e,step_index:t,total_steps:r})}function d(e){i.Ay.capture("onboarding_step_completed",{step_id:e})}function _(e){i.Ay.capture("account_created",{method:e})}function y(){i.Ay.capture("email_verified")}function f(){i.Ay.capture("subscription_paywall_viewed")}function g(e){i.Ay.capture("subscription_plan_selected",{price_id:e})}function h(e){i.Ay.capture("subscription_started",{is_trial:e.is_trial,status:e.status,intent_type:e.intent_type,price_id:e.price_id})}function w(e){i.Ay.capture("checkout_started",{price_id:e.price_id,intent_type:e.intent_type,is_trial:e.is_trial})}function A(e){i.Ay.capture("onboarding_step_back_navigated",{step_id:e})}function m(){i.Ay.capture("trial_explanation_viewed")}function v(){i.Ay.capture("trial_explanation_continued")}function E(e){i.Ay.capture("signup_error",{error:e})}function b(e){i.Ay.capture("email_verification_error",{error:e})}function k(e){i.Ay.capture("payment_error",{error:e.message,error_code:e.code,decline_code:e.decline_code,error_type:e.type,intent_type:e.intent_type})}function x(e){i.Ay.capture("social_auth_clicked",{provider:e})}},31551:(e,t,r)=>{r.d(t,{$4:()=>o,Ct:()=>a,ud:()=>n});let i=null,n=e=>{i=e},o=(e,t)=>{let r=new URLSearchParams({reason:e});return t&&r.set("currentPeriodEnd",t),`/subscription?${r.toString()}`},a=(e,t)=>{if(!window.location.pathname.startsWith("/subscription")){if(i)return void i(e,t);window.location.href=window.location.origin+o(e,t)}}},49612:(e,t,r)=>{r.d(t,{vu:()=>v,Jd:()=>A,P_:()=>m});var i=r(95155),n=r(12115),o=r(73321),a=r(77805);let s=(0,a.F3)("CookieClearer",{web:{clearAll:async()=>{}}});async function c(){if(!a.Ii.isNativePlatform())return;let e=a.Ii.getPlatform();try{"ios"===e?await s.clearAll():await a.qV.clearAllCookies()}catch{}}var u=r(35625),l=r(48934),p=r(26708),d=r(41127),_=r(86431);let y=async()=>{try{return(0,_.Em)({method:"GET",url:"/api/auth/logout"})}catch(e){return Promise.reject(e)}};var f=r(24940),g=r(4181);let h=(0,n.createContext)({user:null,setUser:()=>{},refetchUser:()=>{},entitlementSettling:!1,setEntitlementSettling:()=>{},accountActionsLocked:!1,setAccountActionsLocked:()=>{},isUserRefetching:!1,isUserLoading:!1,logoutMutation:{}}),w=(0,n.createContext)(null);function A(){return(0,n.useContext)(h)}function m(){return{user:(0,n.useContext)(w)}}function v({children:e,serverUser:t}
1){let[s,A]=(0,n.useState)(null),[m,E]=(0,n.useState)(!1),[b,k]=(0,n.useState)(!1),x=(0,o.useRouter)(),P=(0,u.jE)();(0,n.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(e=>e.unregister())})},[]);let S=(0,l.n)({mutationFn:y,onMutate:async()=>{(0,_.Wg)(!0),await P.cancelQueries(),A(null)},onSettled:()=>{(0,_.Wg)(!1)},onSuccess:async()=>{if((0,f.oV)(),a.Ii.isNativePlatform()){P.clear();try{let{SocialLogin:e}=await r.e(8546).then(r.bind(r,38546));await e.logout({provider:"google"}),"ios"===a.Ii.getPlatform()&&await e.logout({provider:"apple"})}catch{}await c(),x.replace("/login");return}window.location.href="/login"},onError:e=>{(0,d.$U)({title:"Logout failed",description:e.message,severity:"danger",color:"danger"})}}),{refetch:C,isRefetching:R,isLoading:U}=(0,p.I)({queryKey:["currentUser"],queryFn:async()=>{let e=await (0,g.H)();return e?(A(t=>t&&JSON.stringify(t)===JSON.stringify(e)?t:e),e):(S.mutate(),null)},enabled:!!t||!!s,staleTime:0,refetchOnWindowFocus:!0});return(0,n.useEffect)(()=>{s?._id&&((0,f.FU)(s.analyticsOptOut??!1),(0,f.gm)(s._id,s.email))},[s?._id,s?.email,s?.analyticsOptOut]),(0,i.jsx)(h.Provider,{value:{user:s,setUser:A,refetchUser:C,entitlementSettling:m,setEntitlementSettling:E,accountActionsLocked:b,setAccountActionsLocked:k,isUserRefetching:R,isUserLoading:U,logoutMutation:S},children:(0,i.jsx)(w.Provider,{value:s,children:e})})}},86431:(e,t,r)=>{r.d(t,{Em:()=>d,J1:()=>_,Sn:()=>a,Wg:()=>l,yG:()=>c});var i=r(41127),n=r(61766),o=r(31551);r(41463);let a=n.A.create({baseURL:"https://api.fitspot.ai",withCredentials:!0,timeout:2e4,headers:{"Content-Type":"application/json"}}),s=null;function c(){return s||(s=a.post("/api/auth/refresh").then(()=>void 0).finally(()=>{s=null})),s}let u=!1,l=e=>{u=e},p=!1;a.interceptors.request.use(e=>e,e=>(console.error(`[Request Error] ${e.message}`),Promise.reject(e))),a.interceptors.response.use(e=>e,e=>(console.error(`[Response Error] ${e.message}`),Promise.reject(e)));let d=async e=>{try{return(await a(e)).data}catch(t){if(!u&&n.A.isAxiosError(t)&&t.response?.status===402&&t.response.data?.code==="SUBSCRIPTION_REQUIRED"){let e=t.response.data;throw(0,o.Ct)(e.reason,e.currentPeriodEnd??null),e}if(!u&&n.A.isAxiosError(t)&&t.response?.status===401)try{return await c(),(await a(e)).data}catch(e){throw n.A.isAxiosError(e)&&e.response?.status===401&&!p&&(p=!0,(0,i.$U)({title:"Session expired, redirecting to login...",severity:"danger"}),await a.get("/api/auth/logout"),window&&(window.location.href=window.origin+"/login")),e}if(n.A.isAxiosError(t)&&t.response?.data?.message){let e=t.response.data;throw Array.isArray(e.message)&&(e.message=e.message.join(". ")),e}throw t}},_=async()=>{try{await c()}catch(e){throw console.error("Failed to refresh token:",e),e}}}}]);
2//# chunkId=01a109b4-81fd-7382-8a77-20a6ffca9ef5

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.